duy 2 жил өмнө
parent
commit
bea7546b0d

+ 12 - 4
src/views/manager/wbsinfo/element.vue

@@ -749,12 +749,20 @@ export default {
     },
     nodeClick(data){
           console.log(data,'treedata');
+          if(data.hasChildren){
+                this.tabTypeLazyTreeAll(data.id, this.page.current,this.page.size).then((res)=>{
+                this.loadData=res.records
+                this.page.total=res.total
+              })
+          }else{
+            let arr=[]
+            arr.push(data)
+            this.loadData=arr
+            this.page.total=1
+          }
           this.curTreeData=data
           this.treeId=data.id
-          this.tabTypeLazyTreeAll(data.id, this.page.current,this.page.size).then((res)=>{
-          this.loadData=res.records
-           this.page.total=res.total
-        })
+      
       },