duy 2 жил өмнө
parent
commit
8a7438425a

+ 32 - 0
src/views/formula/edit.vue

@@ -475,6 +475,10 @@ export default {
       type:String,
       default:''
     },
+    fromcurNode:{
+      type:Object,
+      default:{}
+    }
   },
   data() {
     return {
@@ -617,12 +621,38 @@ export default {
           this.treeLoad = false;
           this.treeData = res.data.data;
           this.defaultExpanded = [this.nodeid];
+          
+          this.$nextTick(()=>{
+            let isArray = Array.isArray(this.$refs.tree)
+            if (isArray) {
+              // 根据 id 获取节点信息
+              this.$refs.tree[0].setCurrentKey(this.nodeid);
+            } else {
+                this.$refs.tree.setCurrentKey(this.nodeid);
+            }
+              this.getNodeDetail(this.fromcurNode)
+              this. getNodeDetailComp(this.fromcurNode)
+          })
+          
         })
       }else{
         getAlltree(this.userInfo.tenant_id, 1, this.wbsid).then((res) => {
           this.treeLoad = false;
           this.treeData = res.data.data;
           this.defaultExpanded = [this.nodeid];
+           console.log(this.$refs.tree,'tree');
+          this.$nextTick(()=>{
+            let isArray = Array.isArray(this.$refs.tree)
+            if (isArray) {
+              // 根据 id 获取节点信息
+              this.$refs.tree[0].setCurrentKey(this.nodeid);
+            } else {
+                this.$refs.tree.setCurrentKey(this.nodeid);
+            }
+             this.getNodeDetail(this.fromcurNode)
+              this. getNodeDetailComp(this.fromcurNode)
+          })
+          
         })
       }
     },
@@ -1268,6 +1298,7 @@ export default {
     getNodeDetail(data) {
       if(this.pid){
           this.eleListable=true;
+          console.log(data.id,'data.id');
         wbsPrivateGetNodeTabAndParam(data.id, this.pid, this.wbsid).then((res) => {
           if(res.data.data.tabData.length){
             this.eleTableList = res.data.data.tabData;
@@ -1379,6 +1410,7 @@ export default {
 
     //方法下面的点击树节点
     getNodeDetailComp(data) {
+       console.log(data.id,'data.id111111111');
       if(this.pid){
         wbsPrivateGetNodeTabAndParam(data.id, this.pid, this.wbsid).then((res) => {
           if(res.data.data.tabData.length){

+ 8 - 4
src/views/formula/edit1.vue

@@ -221,7 +221,7 @@
                   <div class="flex">
                       <el-input
                         size="small"
-                        placeholder="输入关键字搜索222"
+                        placeholder="输入关键字搜索"
                         clearable
                         @clear="clearfiltertext"
                         v-model="filterText">
@@ -1332,12 +1332,16 @@ export default {
     showChooseEle(argumenObj){
       this.argumenObj = argumenObj;
       this.chooseEleVisible = true;
-      this.eleList=[];
-      this.eleTableList=[];
+      // this.eleList=[];
+      // this.eleTableList=[];
       this.eleTableId='';
       this.allTreeShow=false;
       this.filterText=''
-       this.treeId=''
+       this.eleList.forEach((ele)=>{
+          this.$set(ele,'checked',false);
+          //ele.checked = false;
+        })
+      //  this.treeId=''
 
     },
 

+ 4 - 2
src/views/manager/wbsinfo/edit.vue

@@ -1632,12 +1632,13 @@
     </el-dialog>
 
     <el-dialog title="" :visible.sync="formulaCompVisible" fullscreen append-to-body class="full-dialog">
-      <FormulaEdit  :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" :globaltype="formulaCurRow.globaltype" @hideDialog="formulaCompVisible = false" v-if="formulaCompVisible"></FormulaEdit>
+      <FormulaEdit  :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" :globaltype="formulaCurRow.globaltype" @hideDialog="formulaCompVisible = false"
+       v-if="formulaCompVisible" :fromcurNode="curTreeData"></FormulaEdit>
     </el-dialog>
 
      <el-dialog title="" :visible.sync="formulaCompVisible1" fullscreen append-to-body class="full-dialog">
       <FormulaEditone  :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id"   :elementType="formulaCurRow.elementType"
-      :globaltype="formulaCurRow.globaltype" @hideDialog="formulaCompVisible1 = false"
+      :globaltype="formulaCurRow.globaltype" @hideDialog="formulaCompVisible1 = false"  :fromcurNode="curEleTable"
        v-if="formulaCompVisible1">
        </FormulaEditone>
     </el-dialog>
@@ -2516,6 +2517,7 @@ export default {
       //   }
       // });
       //this.editEleFormulaVisible = false;
+      this.curEleTable=row;
       this.formulaCurRow = row;
       this.formulaCurRow.globaltype = type;
       if(type===1){