浏览代码

左侧树优化

wyh 9 月之前
父节点
当前提交
060b6a936d
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 9 6
      src/components/module_interLock/UEquipmentTree/UEquipmentTree.vue

+ 9 - 6
src/components/module_interLock/UEquipmentTree/UEquipmentTree.vue

@@ -2,7 +2,7 @@
   <div class="equipment-tree-container">
     <div>
       <a-button type="primary" icon="plus"  style="width:13%;"/>
-      <a-input-search style="width:85%;margin-left:2%" placeholder="Search" @change="onChange" />
+      <a-input-search style="width:85%;margin-left:2%" placeholder="请输入" @change="onChange" />
     </div>
 
     <div class="tree-container">
@@ -45,15 +45,18 @@
     },
     methods: {
       getTpmTreeData(){
-        getAction(`/base/interlockBase/lever12`).then(res=>{
+        // 现版本
+        // getAction(`/base/interlockBase/lever12`).then(res=>{
+        // 原版本
+        getAction(`/base/interlockBase/list`).then(res=>{
           // if (res.success) {
             console.log('11111',res)
             // 防止res.result对tpmListData造成地址赋值的问题
             this.tpmListData = JSON.parse(JSON.stringify(res))
             // 现版本
-            this.tpmTreeData = this.tpmListData
+            // this.tpmTreeData = this.tpmListData
             // 原版本
-            // this.tpmTreeData = this.handleTree(res, "id", "parentId")
+            this.tpmTreeData = this.handleTree(res, "id", "pid")
             console.log(this.tpmTreeData)
           // } else {
 
@@ -88,9 +91,9 @@
 
 
         // 原版本
-        // this.tpmTreeData = this.handleTree(filterData, "id", "parentId")
+        this.tpmTreeData = this.handleTree(filterData, "id", "pid")
         // 现版本
-        this.tpmTreeData = filterData
+        // this.tpmTreeData = filterData
         // const expandedKeys = dataList.map(item => {
         //   if (item.name.indexOf(value) > -1) {
         //       // return getParentKey(item.key, gData);