Răsfoiți Sursa

Merge branch 'master' of http://47.110.251.215:3000/web/saber

duy 2 ani în urmă
părinte
comite
5e5aa24612

+ 59 - 55
src/views/formula/edit1.vue

@@ -93,8 +93,8 @@
                  lazy
                   :load="treeLoadNode"
                    v-show="!allTreeShow"
-                
-                > 
+
+                >
                 </el-tree>
                  <el-tree
                   style="width: 100%"
@@ -119,14 +119,14 @@
             </el-select> -->
             <el-select v-model="input3" filterable placeholder="请选择元素字段"  @change="getTableEle"  style="width:100%"  :popper-append-to-body="false">
               <el-option
-              
+
                 v-for="item in eleTableList"
                 :key="item.id"
                 :label="item.eName"
                 :value="item.eName">
               </el-option>
             </el-select>
-            
+
             <div class="mg-t-10 no-mb-col flex1 ov-hidden" style="height: 360px; overflow-y: auto; max-height: 360px;">
               <el-scrollbar style="height: 100%">
                 <el-row v-loading="eleListable">
@@ -135,7 +135,7 @@
                       <span v-if="item.k">{{item.name}}</span>
                       <span v-else>{{item.eName}}</span>
                        <!-- <span >{{item.title}}</span> -->
-                      
+
                       <el-checkbox v-model="item.checked" @change="value => eleChang(value,item)"></el-checkbox>
                     </div>
                   </el-col>
@@ -221,7 +221,7 @@
                   <div class="flex">
                       <el-input
                         size="small"
-                        placeholder="输入关键字搜索"
+                        placeholder="输入关键字搜索222"
                         clearable
                         @clear="clearfiltertext"
                         v-model="filterText">
@@ -421,7 +421,7 @@
               <el-option v-if="paramDataList.length" label="选择节点参数3" value="选择节点参数"></el-option>
               <el-option  v-for="item in eleTableList" :key="item.id" :label="item.eName" :value="item.id"></el-option>
             </el-select>
-           
+
             <div class="mg-t-10 mg-b-10 no-mb-col">
               <el-scrollbar style="height: 460px;">
                 <el-row >
@@ -528,7 +528,7 @@ export default {
     },
     elementType:{
       type:Boolean,//公有还是私有
-      
+
     },
     nodeid:{
       type:String,
@@ -558,7 +558,7 @@ export default {
       formulaid:'',
       treeloading:false,//搜索树加载效果
       allTreeData:[],//过滤树
-      
+
 
       treeData:[],//树节点
       treeLoad:false,
@@ -651,8 +651,8 @@ export default {
       nodeZero: null,
       resolveZero: null,
       loading: false
-   
-     
+
+
     };
   },
   computed: {
@@ -674,7 +674,7 @@ export default {
         return null;
       }
     },
-   
+
 
     //是否显示元素下挂载的计算式信息
     showFunDetail:function(){
@@ -684,8 +684,8 @@ export default {
         return false;
       }
     },
-   
-    
+
+
   },
 
   created() {
@@ -704,8 +704,8 @@ export default {
       this.formulaStringToArray();
     },
 
-   
-   
+
+
            //#region 接口
     async tabTypeLazyTree (parentId, projectId,current,size,titleName) {//清表树
       const { data: res } = await tabTypeLazyTree({ parentId, projectId,current,size,titleName })
@@ -713,7 +713,7 @@ export default {
         return res.data;
       }
     },
-   
+
 
     //懒加载树
     loadNode(node, resolve) {
@@ -724,7 +724,7 @@ export default {
         parentId = node.data.id;
       }
       if(this.globaltype===1&&!this.elementType){
-        
+
            tabTypeLazyTreeAll({parentId,current:1,size:1000}).then((res) => {
             let arr = [];
             if (Array.isArray(res.data.data.records)) {
@@ -733,7 +733,7 @@ export default {
             return resolve(arr);
           });
       }else if(this.globaltype===1&&this.elementType){
-       
+
          tabTypeLazyTree({parentId,projectId:this.projectid,pcurrent:1,size:1000}).then((res) => {
             let arr = [];
             if (Array.isArray(res.data.data.records)) {
@@ -741,9 +741,9 @@ export default {
             }
             return resolve(arr);
           });
-       
+
       }
-     
+
     },
      treeLoadNode(node, resolve){
        let parentId = 12345678910;
@@ -759,19 +759,22 @@ export default {
                   this.loading=false
                  resolve(data);
                 this.$nextTick(() => {
-                  let expandid=Number(this.fromcurNode.data.parentId)-1
+                  let expandid=Number(this.fromcurNode.parentId)-1
                    node.childNodes[expandid].expand();
 
-                    let paramsId = this.nodeid
-                    console.log(this.nodeid,'this.initTableId');
+                    let paramsId = this.fromcurNode.id
+                  console.log(paramsId, "paramsId")
+                  let isArray = Array.isArray(this.$refs.tree)
+                  if (isArray) {
                     // 根据 id 获取节点信息
-                    let getNodeById = this.$refs.tree.getNode(paramsId);
-                    if(getNodeById){
-                        // 设置节点选中
-                        this.$refs.tree.setCurrentKey(paramsId);
-                          this.getNodeDetail(this.fromcurNode.data,this.fromcurNode)
-                            this.getNodeDetailComp(this.fromcurNode.data,this.fromcurNode)
-                    }
+                    this.$refs.tree[0].setCurrentKey(paramsId);
+                  } else {
+                    this.$refs.tree.setCurrentKey(paramsId);
+                  }
+
+                  this.getNodeDetail(this.fromcurNode)
+                  this.getNodeDetailComp(this.fromcurNode)
+
                 })
             })
          }else if(this.globaltype===1&&this.elementType){
@@ -781,23 +784,24 @@ export default {
                   this.loading=false
                  resolve(data);
                 this.$nextTick(() => {
-                  let expandid=Number(this.fromcurNode.data.parentId)-1
+                  console.log(this.fromcurNode,'this.fromcurNode')
+                  let expandid=Number(this.fromcurNode.parentId)-1
                    node.childNodes[expandid].expand();
-                    let paramsId = this.nodeid
+                    let paramsId = this.fromcurNode.id
                     console.log(this.nodeid,'this.initTableId');
                     // 根据 id 获取节点信息
                     let getNodeById = this.$refs.tree.getNode(paramsId);
                     if(getNodeById){
                         // 设置节点选中
                         this.$refs.tree.setCurrentKey(paramsId);
-                         this.getNodeDetail(this.fromcurNode.data,this.fromcurNode)
-                            this.getNodeDetailComp(this.fromcurNode.data,this.fromcurNode)
+                         this.getNodeDetail(this.fromcurNode)
+                            this.getNodeDetailComp(this.fromcurNode)
                     }
                 })
             })
          }
 
-      
+
     },
 
     //搜索树
@@ -821,7 +825,7 @@ export default {
              }else{
                 parentId=this.curData.parentId
              }
-            
+
                tabTypeLazyTreeAll({parentId:parentId,current:1,size:1000,titleName:this.filterText}).then((res) => {
                   this.treeloading = false;
                   this.allTreeData = res.data.data.records;
@@ -830,8 +834,8 @@ export default {
                       this.$refs.treeall.filter(this.filterText);
                     });
               })
-             
-             
+
+
           }else if(this.globaltype===1&&this.elementType){
              let parentId=''
              if(this.curData.hasChildren){
@@ -1071,7 +1075,7 @@ export default {
         })
       }
     },
- 
+
 
     //添加括号
     addBrackets(text,type){
@@ -1324,7 +1328,7 @@ export default {
       this.allTreeShow=false;
       this.filterText=''
        this.treeId=''
-      
+
     },
 
     //移除挂载的函数
@@ -1518,9 +1522,9 @@ export default {
 
       }
     },
- 
+
     getNodeDetail(data,node){
-      console.log(data,node,'data');
+      console.log(data,node,'getNodeDetail');
       this.curNode=node;
       this.curData=data;
       this.treeId=data.initTableId;
@@ -1534,7 +1538,7 @@ export default {
                 this.eleList=res.data.data;
                  this.eleTableList =res.data.data;
                 this.eleListable=false;
-             } 
+             }
            })
         }
         else{
@@ -1545,11 +1549,11 @@ export default {
               this.eleListable=false
             }, 1000);
         }
-       
-          
+
+
     },
 
-  
+
 
     getEleDeatil(){
       getEleDeatil(this.eleid).then((res)=>{
@@ -1565,7 +1569,7 @@ export default {
       })
     },
 
-  
+
     getTableEle(tableId){
        let arr=[]
       arr=this.eleTableList.filter((item)=>{
@@ -1602,15 +1606,15 @@ export default {
                 this.eleTableIdComp = this.eleTableListComp[0].id;
               ;
                }
-               
-             } 
+
+             }
            })
         }
         else{
-         
+
            this.eleListComp=[]
            this.page.total=0
-           
+
         }
     },
 
@@ -1780,9 +1784,9 @@ export default {
  .el-select-dropdown{
         max-width:600px ;
     }
-    .el-select-dropdown__item{
-        display: inline-block;
-    }
+    //.el-select-dropdown__item{
+    //    display: inline-block;
+    //}
     .el-select-dropdown__item span {
         min-width: 300px;
         display: inline-block;

+ 30 - 30
src/views/manager/projectinfo/independent.vue

@@ -22,12 +22,12 @@
             <span
               class="custom-tree-node"
               slot-scope="{ data ,node }"
-            
+
               style="box-sizing: border-box;padding-right:70px!important;;"
             >
               <div style="width:100%;">
                 <span style="text-overflow: ellipsis;"> {{ data.title }} </span>
-              
+
               <!-- 调整排序 -->
               <el-link :underline="false">
                 <i
@@ -66,8 +66,8 @@
               @size-change="sizeChange"
               @refresh-change="refreshChange"
             >
-            
-         
+
+
               <template slot="menuRight">
                             <el-button
                               type="primary"
@@ -76,12 +76,12 @@
                               @click="quteEle"
                             >引用元素表单库
                             </el-button>
-                      
+
                           <el-button
                             size="small"
                             type="danger"
                             plain
-                            
+
                             @click="handleDelete"
                           >删除表单
                           </el-button>
@@ -91,7 +91,7 @@
                    <el-input placeholder="请输入你想搜索的表单名称" v-model="input3" :size="size"  clearable  @clear="clearinput" >  </el-input>
                     <el-button type="primary" icon="el-icon-search"  size="small"  @click="searchChange">搜索</el-button>
                  </div>
-                     
+
                      <!-- <i  class="el-icon-search" slot="append" @click="searchChange" style=" cursor:pointer;font-size: 16px;"></i> -->
                 </template>
                 <template slot-scope="{type,size,row}" slot="menu">
@@ -99,7 +99,7 @@
                       <el-button  :size="size" :type="type"  @click="rightClick(row)">编辑元素</el-button>
                       <el-button  :size="size" :type="type"  :disabled="row.excelIds == -1" @click="adjustExcel(row.id,row.primaryKeyId)">调整表单</el-button>
                       <el-button  :size="size" :type="type" @click="handleEditFormula(row)">编辑公式</el-button>
-                      
+
                 </template>
             </avue-crud>
           </div>
@@ -199,7 +199,7 @@
       @close="closeformulaComp"
     >
       <FormulaEdit
-      :fromcurNode="curNode"
+      :fromcurNode="curEleTable"
        :initTableId='curTreeData.id'
         :wbsid="id"
         :nodeid="curTreeData.id"
@@ -216,7 +216,7 @@
       title="调整排序"
       :visible.sync="sortTag"
       width="50%"
-    
+
       append-to-body
     >
       <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
@@ -392,7 +392,7 @@ export default {
         nodeid: "",
       }, //
       excelHtml:false,//调整表单
-      
+
       //#region 调整表单
       adjustmentExcel: "",
       curEleTable: {},//编辑元素公式
@@ -428,7 +428,7 @@ export default {
         this.editEleListFilter = res.data.data;
         this.editEleListAll = [].concat(this.editEleListFilter);
       })
-      
+
     },
     async sortpai(data,node) {
       this.curNode=node;
@@ -496,25 +496,25 @@ export default {
          if(this.treeId){
             this.onLoad2()
           }else{
-             this.$message.warning("请先选择左侧节点");  
+             this.$message.warning("请先选择左侧节点");
           }
     },
     currentChange (currentPage) {
         this.page.current = currentPage;
-        
+
     },
     sizeChange (pageSize) {
         this.page.size = pageSize;
     },
     refreshChange () {
       this.searchChange();
-     
+
     },
     clearinput(){
       this.searchChange()
     },
     onLoad2(){
-   
+
            if(this.curTreeData.hasChildren){
             this.tabloading=true;
             this.tabTypeLazyTree(this.curTreeData.id, this.projectid, this.page.current,this.page.size,this.input3).then((res)=>{
@@ -532,18 +532,18 @@ export default {
             this.page.total=1
             setTimeout(() => {
               this.tabloading=false
-              
+
             }, 1000);
-        }else{   
+        }else{
           this.tabloading=true;
            this.loadData=[]
            this.page.total=0;
             setTimeout(() => {
               this.tabloading=false
-              
+
             }, 1000);
         }
-     
+
     },
     onLoad1(){
       if(this.curNode.level===1&&this.curNode.data.hasChildren){
@@ -554,7 +554,7 @@ export default {
            this.tabloading=false
         })
       }else{
-        
+
           this.tabTypeLazyTree(this.curTreeData.parentId, this.projectid, this.page.current,1000,this.input3).then((res)=>{
            let faArr=res.records;
            this.loadData=faArr.filter((item)=>{
@@ -576,7 +576,7 @@ export default {
         })
       }
     },
-    
+
 
     nodeClick (data,node) {//外层树结构
         console.log(data,node,'treedata');
@@ -597,13 +597,13 @@ export default {
             this.page.total=1
             setTimeout(() => {
               this.tabloading=false
-              
+
             }, 1000);
         }else{
            this.loadData=[]
             this.page.total=0
         }
-       
+
     },
 
     handleClose(done) {
@@ -618,7 +618,7 @@ export default {
       this.$refs.Qute.show();
 
     },
-    
+
     handleDelete () {
       if (this.selectionList.length === 0) {
         this.$message.warning("请选择至少一条数据");
@@ -630,7 +630,7 @@ export default {
         type: "warning"
       })
         .then(() => {
-        return delAprojectTab(this.ids,this.projectid);  
+        return delAprojectTab(this.ids,this.projectid);
         })
         .then(() => {
         this.onLoad1()
@@ -654,7 +654,7 @@ export default {
        console.log('关联清表',row);
        this.$refs.Relation.show()
       // this.GLExcelFrom.name = row.title;
-   
+
       this.GLExcelFrom.id = row.primaryKeyId;
       this.GLExcelFrom.excelId =row.excelIds;
       this.GLExcelFrom.ids = row.id;
@@ -732,15 +732,15 @@ export default {
       refreshTree(){
         //刷新左边树形数据
       if(this.curNode.level===1){
-         const parentId =12345678910 
+         const parentId =12345678910
         tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
             this.data=res.data.data.records;
              this.$nextTick(()=>{
               this.defaultExpandKey.push(this.curNode.data.id);
               this.$refs.trees.setCurrentKey(this.curNode.data.id);
-            
+
             })
-          
+
           });
       }else{
         this.updateTreeNewNode()

+ 22 - 22
src/views/manager/wbsinfo/element.vue

@@ -9,11 +9,11 @@
     >
       <div class="boxnei" style="display: flex;flex-direction: column;">
         <div style="overflow: auto;flex:1">
-          <avue-tree 
-          :option="treeOption" 
+          <avue-tree
+          :option="treeOption"
           :data="treeData"
-           @node-click="nodeClick" 
-           ref="avueTree"   
+           @node-click="nodeClick"
+           ref="avueTree"
            style="display: inline-block;min-width: 100%;">
              <span
             class="custom-tree-node"
@@ -264,7 +264,7 @@
       @close="closeformulaComp"
     >
       <FormulaEdit
-        :fromcurNode="curNode"
+        :fromcurNode="curEleTable"
         :wbsid="id"
         :nodeid="curTreeData.id"
         :eleid="formulaCurRow.id"
@@ -485,7 +485,7 @@
       :visible.sync="sortTag"
       width="50%"
       append-to-body
-    
+
     >
       <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
       <span slot="footer" class="dialog-footer">
@@ -715,7 +715,7 @@ export default {
           value:'id',
           children:'children'
         },
-       
+
         lazy: true,
         treeLoad: function (node, resolve) {
            const parentId = (node.level === 0) ? 12345678910 : node.data.id;
@@ -758,7 +758,7 @@ export default {
         this.editEleListFilter = res.data.data;
         this.editEleListAll = [].concat(this.editEleListFilter);
       })
-      
+
     },
         //#region  树形控件外层左侧事件
     mouseLeave (data) {
@@ -812,7 +812,7 @@ export default {
         this.sort =tabArr
       }
     },
-   
+
     addEleRow (list) {
       list.push({});
     },
@@ -859,12 +859,12 @@ export default {
         this.page.current = currentPage;
           this.page.currentPage = currentPage;
       //  this.searchChange();
-       
+
       },
       sizeChange (pageSize) {
         this.page.size = pageSize;
       //  this.searchChange();
-       
+
       },
       selectionChange (list) {
       this.selectionList = list;
@@ -899,13 +899,13 @@ export default {
             this.page.total=1
             setTimeout(() => {
               this.tabloading=false
-              
+
             }, 1000);
         }else{
            this.loadData=[]
            this.page.total=0
         }
-          
+
       },
 
 
@@ -932,7 +932,7 @@ export default {
            this.tabloading=false
         })
       }else{
-        
+
           this.tabTypeLazyTreeAll(this.curNode.data.parentId,this.page.current,1000,this.input3).then((res)=>{
            let faArr=res.records;
            this.loadData=faArr.filter((item)=>{
@@ -962,7 +962,7 @@ export default {
             this.page.total=1;
             setTimeout(() => {
               this.tabloading=false
-              
+
             }, 1000);
         }else{
            this.tabloading=true;
@@ -970,7 +970,7 @@ export default {
             this.page.total=0
             setTimeout(() => {
               this.tabloading=false
-              
+
             }, 1000);
         }
       }else{
@@ -1022,21 +1022,21 @@ export default {
     //       if(this.curNode.level===1){
     //          this.treeOption.defaultExpandedKeys.push(this.curNode.data.id);
     //          this.$refs.avueTree.setCurrentKey(this.curNode.data.id)
-           
+
     //       }else{
     //          this.treeOption.defaultExpandedKeys.push(this.curNode.data.parentId);
     //           // 设置选中的节点
     //           this.treeOption.currentNode =this.curNode.data.id
-    //           this.$refs.avueTree.setCurrentKey(this.curNode.data.id)      
-    //       }   
-          
+    //           this.$refs.avueTree.setCurrentKey(this.curNode.data.id)
+    //       }
+
     //     })
     //   });
     // },
         //刷新左边树形数据
       refreshTreeData(){
       if(this.curNode.level===1){
-         const parentId =12345678910 
+         const parentId =12345678910
         tabTypeLazyTreeAll({parentId,current:1,size:1000}).then(res => {
             this.data=res.data.data.records;
              this.$nextTick(()=>{
@@ -1483,7 +1483,7 @@ export default {
 /deep/.el-input-group__append{
    background-color: #ecf5ff;
     color: #409EFF;
-   
+
 }
 /deep/.el-input-group__append:hover{
    background-color: #409EFF;