From db860f9c08a23fe916121a2c76001e05d2acee3e Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期一, 07 八月 2023 15:17:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue |  432 +++++++++++++++++++++++++++++------------------------
 1 files changed, 234 insertions(+), 198 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index cad2aeb..2868e1a 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -24,16 +24,16 @@
           </div>
         </div>
         <!--        鏍戣妭鐐规坊鍔犲璇濇-->
-        <el-dialog :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :visible.sync="TreeAddFormVisible" append-to-body
+        <el-dialog :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :before-close="TreeEscHandler" :visible.sync="TreeAddFormVisible"  v-loading="AddLoading" append-to-body
                    style="width: 1700px;margin: auto">
-          <el-form :model="TreeAddform" :rules="rules">
+          <el-form ref="myForm" :model="TreeAddform" :rules="rules">
             <el-form-item :label="this.TreeFlag ? '鍒嗙被缂栧彿锛�' :'涓婚搴撶紪鍙凤細'" label-width="150px" style="display: inline-block" prop="id">
               <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input>
             </el-form-item>
             <el-form-item :label="this.TreeFlag ? '鍒嗙被鍚嶇О锛�' :'涓婚搴撳悕绉帮細'" label-width="110px" style="display: inline-block" prop="name">
               <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input>
             </el-form-item>
-            <el-form-item label="瀛樺偍鐨勪笟鍔$被鍨嬶細" label-width="150px" v-if="TreeFlagCode==false" prop="btmTypeName">
+            <el-form-item label="瀛樺偍鐨勪笟鍔$被鍨嬶細" label-width="150px" v-if="TreeFlagCode" prop="btmTypeName">
               <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" @focus="btmFoucus"></el-input>
             </el-form-item>
             <el-form-item label="鎻忚堪锛�" label-width="150px">
@@ -52,13 +52,13 @@
             </el-form-item>
           </el-form>
           <div slot="footer" class="dialog-footer">
-            <el-button @click="TreeAddFormVisible = false">鍙� 娑�</el-button>
+            <el-button @click="TreeEscHandler">鍙� 娑�</el-button>
             <el-button type="primary" @click="TreeAddHandler">纭� 瀹�</el-button>
           </div>
         </el-dialog>
         <!--        淇敼瀵硅瘽妗�-->
         <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="淇敼鍒嗙被">
-          <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'" @MasterHandler="MasterHandler" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="TreeFlagCode" ::nodeClickList="nodeClickList" @referTreeForm="referTreeForm" @flushed="flushed"></classifyTreeform>
+          <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'" @MasterHandler="MasterHandler" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode" :nodeClickList="nodeClickList" @referTreeForm="referTreeForm" @flushed="flushed"></classifyTreeform>
         </el-dialog>
         <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" :defaultExpandAll="false"
                    :option="Treeoption"
@@ -121,12 +121,12 @@
         </div>
            </el-dialog>
               <!--            妯℃澘鍏嬮殕  -->
-                <el-dialog :visible.sync="CloneVisible" append-to-body title="鍏嬮殕妯℃澘">
+                <el-dialog :visible.sync="CloneVisible" append-to-body title="鍏嬮殕妯℃澘" :before-close="cloneClose">
                   <el-container>
                     <el-aside width="300px">
                       <div style="margin-bottom: 5px"><el-tag>涓婚搴撳垎绫�</el-tag></div>
                       <!--                      鍏嬮殕妯℃澘鐨勬爲 娌跨敤棣栭〉鏍戠殑loading鍜宱ption锛屼絾鏄痙ata鍜寁-model缁戝畾鐨勬暟鎹垱寤轰竴涓柊鐨勫彉閲忥紝鍙﹀鐐瑰嚮鏂规硶涔熸槸閲嶆柊鑾峰彇鏉ユ搷浣滃厠闅嗘ā鏉跨殑鏁版嵁-->
-                        <avue-tree  v-model="TreeAvueform" v-loading="loading" :data="Treedata"
+                        <avue-tree ref="cloneTree" v-model="TreeAvueform" v-loading="loading" :data="Treedata"
                                     :defaultExpandAll="false"
                                     :option="Treeoption"
                                     style="height: 50.5vh;margin-right: 10px"
@@ -160,7 +160,7 @@
                     </el-container >
                    <div style="display: flex; justify-content: flex-end; align-items: center;margin-top: 10px" >
                      <el-button size="small " type="primary" @click="Clonehandler">纭畾</el-button>
-                     <el-button size="small" @click="CloneVisible=false" >鍙栨秷</el-button>
+                     <el-button size="small" @click="cloneClose" >鍙栨秷</el-button>
                    </div>
                       <el-dialog
                         width="30%"
@@ -231,7 +231,11 @@
             <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input>
             <el-button size="small"  type="primary" plain @click="SelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button>
           </template>
-          <avue-crud :data="masterData" :option="masterOption" @select="masterSelect"></avue-crud>
+          <avue-crud :data="masterData" :option="masterOption" @row-click="masterSelect">
+            <template slot="radio" slot-scope="{row}">
+              <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio>
+            </template>
+          </avue-crud>
           <div style="height: 30px">
             <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.TreeAddform.coderuleoidName ==''?'鏈缃��':this.TreeAddform.coderuleoidName}}]</div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
@@ -255,7 +259,11 @@
             <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input>
             <el-button size="small"  type="primary" plain @click="KeySelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button>
           </template>
-          <avue-crud :data="KeyData" :option="masterOption" @select="KeySelect"></avue-crud>
+          <avue-crud :data="KeyData" :option="masterOption" @row-click="KeySelect">
+            <template slot="radio" slot-scope="{row}">
+              <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio>
+            </template>
+          </avue-crud>
           <div style="height: 30px">
             <div style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.TreeAddform.codeKeyAttrRepeatOidName ==''?'鏈缃��':this.TreeAddform.codekeyattrrepeatoidName}}]</div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
@@ -279,7 +287,11 @@
             <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input>
             <el-button size="small"  type="primary" plain @click="SimSelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button>
           </template>
-          <avue-crud :data="simData" :option="masterOption" @select="simSelect"></avue-crud>
+          <avue-crud :data="simData" :option="masterOption" @row-click="simSelect">
+            <template slot="radio" slot-scope="{row}">
+              <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio>
+            </template>
+          </avue-crud>
           <div style="height: 30px">
             <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.TreeAddform.codeResembleRuleOidName ==''?'鏈缃��':this.TreeAddform.codeResembleRuleOidName}}]</div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
@@ -303,7 +315,11 @@
             <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input>
             <el-button size="small"  type="primary" plain @click="BtmSelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button>
           </template>
-          <avue-crud :data="BtmData" :option="masterOption" @select="btmSelect"></avue-crud>
+          <avue-crud :data="BtmData" :option="masterOption" @row-click="btmSelect">
+            <template slot="radio" slot-scope="{row}">
+              <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio>
+            </template>
+          </avue-crud>
           <div style="height: 30px">
             <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.TreeAddform.btmTypeName}}]</div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
@@ -350,12 +366,18 @@
   inject: ["crudTreeData"],
   data() {
     return {
+      masterRow:null,
+      AddLoading:false,
+      // 瀹氫箟涓�涓彉閲忔潵淇濆瓨鏍戣姹傜殑鏁伴噺
+      requestCount:null,
       //瀵煎叆鐘舵�佹
       ThemeImportVisible:false,
       selectRow:'',
       selectList:[],
       //鏍戣妭鐐规樉绀洪殣钘�
-      TreeFlagCode:false,
+      TreeFlagCode:true,
+      //淇敼鑺傜偣鏄剧ず闅愯棌
+      editTreeFLagCode:false,
       //缂栫爜瑙勫垯
       MasterdialogVisible:false,
       masterData:[],
@@ -384,10 +406,15 @@
         addBtn:false,
         index:true,
         border:true,
-        selection:true,
         menu:false,
         height:380,
         column:[
+          {
+            label: '',
+            prop: 'radio',
+            width: 60,
+            display: false
+          },
           {
             label:'鑻辨枃鍚嶇О',
             prop:'id'
@@ -412,7 +439,7 @@
           label: '鑻辨枃鍚嶇О'
         }
       ],
-      SelectValue:"",
+      SelectValue:"id",
       SelectFInd:"",
       addFlag:false,
       // 琛ㄦ牸褰撳墠琛宨d
@@ -483,10 +510,10 @@
       },
       rules: {
         id: [
-          { required: true, message: '璇疯緭鍏ュ悕绉�', trigger: 'blur' },
+          { required: true, message: '璇疯緭鍏ョ紪鍙�', trigger: 'blur' },
         ],
         name:[
-          { required: true, message: '璇疯緭鍏ョ紪鍙�', trigger: 'blur' },
+          { required: true, message: '璇疯緭鍏ュ悕绉�', trigger: 'blur' },
         ],
         btmTypeName:[
           { required: true, message: '璇烽�夋嫨涓氬姟绫诲瀷', trigger: 'blur' },
@@ -656,6 +683,9 @@
       showEditBtn:false,
     }
   },
+  watch:{
+
+  },
   //tab鏍忛粯璁ゆ槸琛ㄦ牸
   mounted() {
     this.type = this.tabOption.column[0];
@@ -666,7 +696,7 @@
         this.$refs.tree.setCurrentKey(null)
         this.nodeClickList = {}
         this.TreeList=[]
-        this.TreeFlagCode=false;
+        this.TreeFlagCode=true;
       }
     }, true)
   },
@@ -731,6 +761,8 @@
 
   },
   methods: {
+    // 鍏抽棴寮圭獥
+
     /** 瀵煎叆 */
     ImportExcel(){
       this.ThemeImportVisible=true;
@@ -739,17 +771,12 @@
     ExportExcel(){
       if(this.nodeClickList){
         exportClassify({oid:this.nodeClickList.oid}).then(res=>{
-          console.log(res)
-          func.downloadFileByBlob(res);
+          func.downloadFileByBlobHandler(res);
         })
       }else {
         this.$message.warning('璇峰厛閫夋嫨瑕佸鍑虹殑涓婚搴撳垎绫�')
       }
     },
-    //妯℃澘绠$悊宸插彂甯冪紪杈�
-    // checkShowEditBtn() {
-    //   this.showEditBtn = this.Formlist.some(item => item.lcStatus === 'Released');
-    // },
     //缂栫爜瑙勫垯澶辩劍
     CodeFoucus(){
       this.MasterdialogVisible=true;
@@ -757,11 +784,11 @@
     },
     //缂栫爜澶氶��
     masterSelect(row){
-    if(row.length>0){
+      this.masterRow=row.$index;
       this.masterSelectList=row;
-      this.masterName=row[0].name;
-      this.masterOid=row[0].oid;
-    }
+      this.masterName=row.name;
+      this.masterOid=row.oid;
+
     },
     //缂栫爜瑙勫垯鏌ヨ
     SelectFindeHandler(){
@@ -770,15 +797,11 @@
           'conditionMap[id]':this.SelectFInd
         }
         this.MasterdefaultRend(masterParameter);
-        this.SelectValue=""
-        this.SelectFInd=""
       }else if(this.SelectValue == 'name'){
         const masterParameter={
           'conditionMap[name]':this.SelectFInd
         }
         this.MasterdefaultRend(masterParameter)
-        this.SelectValue=""
-        this.SelectFInd=""
       }
     },
     //缂栫爜瑙勫垯纭畾
@@ -829,15 +852,11 @@
           'conditionMap[id]':this.SelectFInd
         }
         this.KeydefaultRend(masterParameter);
-        this.SelectValue="";
-        this.SelectFInd="";
       }else if(this.SelectValue == 'name'){
         const masterParameter={
           'conditionMap[name]':this.SelectFInd
         }
         this.KeydefaultRend(masterParameter)
-        this.SelectValue=""
-        this.SelectFInd=""
       }
     },
     //鍏抽敭灞炴�ф帴鍙�
@@ -852,9 +871,10 @@
     },
     // 鍏抽敭澶氶��
     KeySelect(row){
+      this.masterRow=row.$index;
       this.KeySelectLIst=row;
-      this.KeyName=row[0].name;
-      this.KeyOid=row[0].oid;
+      this.KeyName=row.name;
+      this.KeyOid=row.oid;
     },
     //鍏抽敭澶辩劍
     simFouce(){
@@ -882,22 +902,19 @@
           'conditionMap[id]':this.SelectFInd
         }
         this.simdefaultRend(masterParameter);
-        this.SelectValue=""
-        this.SelectFInd=""
       }else if(this.SelectValue == 'name'){
         const masterParameter={
           'conditionMap[name]':this.SelectFInd
         }
         this.simdefaultRend(masterParameter)
-        this.SelectValue=""
-        this.SelectFInd=""
       }
     },
     //  鐩镐技椤瑰閫�
     simSelect(row){
+      this.masterRow=row.$index;
       this.simSelectList=row;
-      this.simName=row[0].name;
-      this.simOid=row[0].oid;
+      this.simName=row.name;
+      this.simOid=row.oid;
     },
     //鐩镐技椤归」鎺ュ彛
     simdefaultRend(){
@@ -935,22 +952,19 @@
           'conditionMap[id]':this.SelectFInd
         }
         this.btmdefaultRend(masterParameter);
-        this.SelectValue=""
-        this.SelectFInd=""
       }else if(this.SelectValue == 'name'){
         const masterParameter={
           'conditionMap[name]':this.SelectFInd
         }
         this.btmdefaultRend(masterParameter);
-        this.SelectValue="";
-        this.SelectFInd="";
       }
     },
     //涓氬姟绫诲瀷澶氶��
     btmSelect(row){
+      this.masterRow=row.$index;
       this.btmSelectList=row;
-      this.btmName=row[0].name;
-      this.btmOid=row[0].id;
+      this.btmName=row.name;
+      this.btmOid=row.id;
     },
     //涓氬姟绫诲瀷鎺ュ彛
     btmdefaultRend(masterParameter){
@@ -967,29 +981,7 @@
       this.crudOid=row.oid;
       this.crudLCStatus=row.lcStatus;
       this.crudArray.push(row);
-      gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.Formlist[this.selectRow].oid}).then(res => {
-        this.ProData = res.data.data;
-        //鍒嗙被娉ㄥ叆鏁版嵁鏍煎紡
-        this.ProData =  res.data.data.map((item) => {
-          //濡傛灉鍒嗙被娉ㄥ叆classifyInvokeAttr涓虹┖璇存槑鏄垵濮嬬姸鎬�
-          if(item.classifyInvokeAttr !== ''){
-            if (!item.hasOwnProperty('classifyInvokeText')) { // 妫�鏌lassifyInvokeText灞炴�ф槸鍚﹀瓨鍦�
-              item = {
-                ...item,
-                classifyInvokeText: {
-                  "娉ㄥ叆绫诲瀷": item.classifyInvokeAttr,
-                  "娉ㄥ叆绫诲瀷鍚嶇О": item.classifyInvokeAttrName,
-                  "灞傜骇璁剧疆": item.classifyInvokeLevel,
-                  "鏄惁鍙慨鏀�": item.classifyInvokeEditFlag
-                }
-              };
-            }
-          }
-          return item;
-        });
-      }).catch(res => {
-        this.$message.error(res)
-      })
+      this.gridCode()
     },
     //鍒嗙被鏍戞暟鎹鐞�
     getAttr() {
@@ -1003,8 +995,16 @@
         })
         //璋冪敤淇敼灞炴�у悕鏂规硶
         this.ModifyProperties(this.CloneTreedata, 'name', 'label');
+        console.log(this.CloneTreedata)
+        this.CloneTreedata = this.CloneTreedata.map(item => {
+          if (item.attributes.lcStatus === "Disabled") {
+            item.label += '銆愬仠鐢ㄣ��';
+          }
+          return item;
+        });
       }).catch(res => {
         this.$message.error(res)
+
       })
     },
     //瀹氫箟涓�涓慨鏀规暟鎹睘鎬у悕鐨勬柟娉�
@@ -1020,36 +1020,61 @@
       }
     },
     //鏍戣妭鐐规坊鍔犳寜閽�
-    TreeAdd() {
-      this.TreeAddFormVisible = true;
-      // 鍒ゆ柇褰撳墠鏄惁鏈夌偣鍑诲瓙椤�
-      if (this.nodeClickList !== "") {
-        this.TreeFlag = true
+    async TreeAdd() {
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.3)'
+      });
+      try {
+        //鏂板琛ㄥご鍚嶇О
+        this.TreeFlag=!this.nodeClickList
+        await new Promise(resolve => setTimeout(resolve, 500));
+        this.TreeAddFormVisible = true;
+        loading.close();
+      } catch (error) {
+        this.$message.error(error);
+        loading.close();
       }
+    },
+    //鏍戣妭鐐瑰彇娑堜簨浠�
+    TreeEscHandler(){
+      this.TreeAddform={};
+      this.TreeAddFormVisible=false;
+      // 鍏抽棴寮圭獥娓呯┖鏍¢獙
+      this.$refs.myForm.clearValidate();
     },
     //鏍戣妭鐐规坊鍔犱簨浠�
     TreeAddHandler() {
-      const data = this.TreeAddform;
-      // data.btmtypename= this.TreeList.btmtypename
-      this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
-      TreeSave(data)
-        .then(() => {
-          this.$message({
-            type: "success",
-            message: "娣诲姞鎴愬姛!",
+      if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) {
+        this.$message.warning('璇疯緭鍏ュ唴瀹癸紒');
+      }else {
+        const data = this.TreeAddform;
+        // data.btmtypename= this.TreeList.btmtypename
+        this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
+        TreeSave(data)
+          .then(() => {
+            this.$message({
+              type: "success",
+              message: "娣诲姞鎴愬姛!",
+            });
+            Object.keys(this.TreeAddform).forEach(key => {
+              this.TreeAddform[key] = "";
+            });
+            this.getAttr();
+            this.TreeAddFormVisible = false;
+            //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
+            this.ProData=[];
+            this.Formlist=[];
+          })
+          .catch((res) => {
+            this.$message({
+              type: "warning",
+              message: res,
+            });
           });
-          Object.keys(this.TreeAddform).forEach(key => {
-            this.TreeAddform[key] = "";
-          });
-          this.getAttr();
-          this.TreeAddFormVisible = false;
-        })
-        .catch((res) => {
-          this.$message({
-            type: "warning",
-            message: res,
-          });
-        });
+      }
     },
     //鏍戣妭鐐瑰垹闄ゆ寜閽�
     TreeDel() {
@@ -1197,69 +1222,60 @@
     },
     //鏍戠偣鍑讳簨浠�
     async nodeClick(data) {
-      //瀹氫箟涓�涓ā鏉垮睘鎬d锛屾暟鎹槸妯℃澘绠$悊琛ㄦ牸閲岄潰鐨刼id
-      if(data.parentId == ""){
-        this.TreeFlagCode=true;
-
-      }
-      this.nodeClickList = data
-      this.selectRow=0;
+      console.log(data);
+      //鎿嶄綔鏂板鍜屼慨鏀圭殑涓氬姟绫诲瀷闅愯棌
+      this.TreeFlagCode = !data;
+      this.editTreeFLagCode = !data.parentId;
+      this.nodeClickList = data;
+      this.selectRow = 0;
+      this.crudArray=[]
       try {
-        await TreeObjcet(data.oid).then(res => {
-          this.FlagObj = res.data.data
-        }).catch(res => {
-          this.$message.error(res)
-        })
-        //妯℃澘绠$悊琛ㄦ牸鏁版嵁
-        await gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}).then(res => {
-          this.Formlist = res.data.data.filter(item => {
-            if (item.codeclassifyoid != "") {
-              this.codeClassifyOid = item.codeclassifyoid
-              return item.codeclassifyoid == this.nodeClickList.oid
-            }
-          })
-          console.log('form',this.Formlist)
-          if(this.Formlist.length >= 1){
-            this.crudLCStatus=this.Formlist[0].lcStatus;
-            this.crudArray.push(this.Formlist[0]);
-            gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.Formlist[0].oid}).then(res => {
-              this.ProData = res.data.data;
-              console.log(this.ProData)
-              //鍒嗙被娉ㄥ叆鏁版嵁鏍煎紡
-              this.ProData =  res.data.data.map((item) => {
-                //濡傛灉鍒嗙被娉ㄥ叆classifyInvokeAttr涓虹┖璇存槑鏄垵濮嬬姸鎬�
-                if(item.classifyInvokeAttr !== ''){
-                  if (!item.hasOwnProperty('classifyInvokeText')) { // 妫�鏌lassifyInvokeText灞炴�ф槸鍚﹀瓨鍦�
-                    item = {
-                      ...item,
-                      classifyInvokeText: {
-                        "娉ㄥ叆绫诲瀷": item.classifyInvokeAttr,
-                        "娉ㄥ叆绫诲瀷鍚嶇О": item.classifyInvokeAttrName,
-                        "灞傜骇璁剧疆": item.classifyInvokeLevel,
-                        "鏄惁鍙慨鏀�": item.classifyInvokeEditFlag
-                      }
-                    };
-                  }
-                }
-                return item;
-              });
-            }).catch(res => {
-              this.$message.error(res)
-            })
-          }else {
-              this.ProData = [];
+        this.requestCount += 1;
+        const [res1, res2, res3] = await Promise.all([
+          TreeObjcet(data.oid),
+          gridCodeClassifyTemplate({ 'conditionMap[codeclassifyoid]': data.oid }),
+          getObjectByOid(data.oid)
+        ]);
+        this.FlagObj = res1.data.data;
+        this.Formlist = res2.data.data.filter(item => {
+          if (item.codeclassifyoid != "") {
+            this.codeClassifyOid = item.codeclassifyoid;
+            return item.codeclassifyoid == this.nodeClickList.oid;
           }
-        }).catch(res => {
-          this.$message.error(res)
-        })
-        //  鍩烘湰淇℃伅琛ㄥ崟鏁版嵁
-          await getObjectByOid(this.nodeClickList.oid).then(res => {
-            this.TreeList = res.data.data;
-          }).catch(res => {
-            this.$message.error(res)
-          })
+        });
+        if (this.Formlist.length >= 1) {
+          this.crudLCStatus = this.Formlist[this.selectRow].lcStatus;
+          this.crudArray.push(this.Formlist[this.selectRow]);
+          this.crudOid = this.Formlist[this.selectRow].oid;
+          await this.gridCode();
+        } else {
+          this.ProData = [];
+          this.crudOid=''
+        }
+        this.TreeList = res3.data.data;
       } catch (error) {
-        this.$message.error(error)
+        this.$message.error(error);
+      }
+    },
+
+    async gridCode() {
+      try {
+        const res = await gridCodeClassifyTemplateAttr({ 'conditionMap[classifyTemplateOid]': this.Formlist[this.selectRow].oid, limit: -1 });
+        this.ProData = res.data.data.map(item => {
+          if (item.classifyInvokeAttr !== '') {
+            if (!item.hasOwnProperty('classifyInvokeText')) {
+              item.classifyInvokeText = {
+                '娉ㄥ叆绫诲瀷': item.classifyInvokeAttr,
+                '娉ㄥ叆绫诲瀷鍚嶇О': item.classifyInvokeAttrName,
+                '灞傜骇璁剧疆': item.classifyInvokeLevel,
+                '鏄惁鍙慨鏀�': item.classifyInvokeEditFlag
+              };
+            }
+          }
+          return item;
+        });
+      } catch (error) {
+        this.$message.error(error);
       }
     },
     treeClick(e) {
@@ -1326,14 +1342,13 @@
         });
       } else {
         this.$set(row, "codeclassifyoid", this.nodeClickList.oid)
-        console.log(this.nodeClickList)
         addSave(row).then(() => {
           this.$message({
             type: "success",
             message: "娣诲姞鎴愬姛!"
           });
           done(row)
-          this.CrudRend()
+          this.TemRefresh();
         }).catch(res => {
           this.$message({
             type: 'info',
@@ -1345,7 +1360,7 @@
     //妯℃澘绠$悊淇敼
     CrudRowUpdata(row,index,done) {
       editSave(row).then(() => {
-        this.CrudRend()
+        this.TemRefresh();
         this.$message({
           type: "success",
           message: "鎿嶄綔鎴愬姛!"
@@ -1358,7 +1373,7 @@
     //妯℃澘绠$悊鍒犻櫎
     CrudRowDel(row) {
       deleteData(row).then(()=> {
-        this.CrudRend()
+        this.TemRefresh();
       }).catch(res => {
         this.$message({
           type: 'info',
@@ -1366,20 +1381,13 @@
         });
       })
     },
-    //妯℃澘绠$悊琛ㄦ牸鏌ヨ,鍙湁涓�鏉℃暟鎹病蹇呰鍋氭悳绱�
-    /*nterFind() {
-      if (this.findText == "") {
-        gridCodeClassifyTemplate().then(res => {
-          this.Formlist = res.data.data
-        })
-      } else {
-        gridCodeClassifyTemplate().then(res => {
-          this.Formlist = res.data.data.filter(item => {
-            return item.name.includes(this.findText)
-          })
-        })
-      }
-    },*/
+    //鍏嬮殕鍙栨秷
+    cloneClose(){
+      this.$refs.cloneTree.setCurrentKey(null)
+      this.ClonenodeClickList = {}
+      this.CloneFormlist=[]
+      this.CloneVisible=false;
+    },
     //鍏嬮殕妯℃澘鏌ヨ
     CloneEnterFind(){
       gridCodeClassifyTemplate().then(res => {
@@ -1428,38 +1436,66 @@
       }
     },
     //鍏嬮殕妯℃澘鍗曢�夋鏀瑰彉
-    selectionChange(row){
-      this.CloneSelect=row;
-      //鍙屽悜缁戝畾锛屾彁浜よ〃鍗曡緭鍏ユ鍥炲~涓婂綋鍓嶉�夋嫨鐨勬暟鎹�
-      this.CloneModel.id=row[0].id;
-      this.CloneModel.name=row[0].name;
-      //杩欓噷鏈夌偣缁曪紝CloneSelect鏄垜閫夋嫨妗嗛�夋嫨鐨勬暟鎹�傜瓑浜巘his.nodeClickList.oid鏄洜涓猴紝鍏嬮殕妯℃澘浼犻�掓暟鎹鎶婂綋鍓嶉�夋嫨鏍戠殑oid浼犻�掔粰鍚庣銆傝�屼笉鏄綋鍓嶈鍏嬮殕妯℃澘鐨刼id
-      this.CloneSelect[0].codeclassifyoid=this.nodeClickList.oid
+    selectionChange(row) {
+      this.CloneSelect = row;
+      const { id, name } = row[0];
+      this.CloneModel = { id, name };
+      this.CloneSelect[0].codeclassifyoid = this.nodeClickList.oid;
+      console.log('row',row)
+      console.log('CloneSelect',this.CloneSelect)
+      console.log('CloneModel',this.CloneModel)
     },
     //鍏嬮殕琛ㄥ崟鎻愪氦
-    Clonesubmit(row,done){
-      //閲嶆柊璧嬪�糃loneSelect浼犻�掔殑鏁版嵁涓鸿緭鍏ユ鍙互淇敼鐨勬暟鎹紝CloneModel鎻愪氦琛ㄥ崟杈撳叆妗嗗弻鍚戠粦瀹氭暟鎹�
-      this.CloneSelect[0].id=this.CloneModel.id;
-      this.CloneSelect[0].name=this.CloneModel.name;
-      copy(this.CloneSelect[0]).then(()=>{
-        //鍥犱负鏄祵濂楀脊绐楁墍浠ユ墜鍔ㄥ叧闂瑿loneinnerVisible锛孋loneVisible涓や釜寮圭獥銆�
-        this.CloneinnerVisible=false
-        this.CloneVisible=false
-        this.$message.success("澶嶅埗鎴愬姛")
-        this.CrudRend()
-        done(row)
-      }).catch(res=>{
-        done(res)
-      })
+    Clonesubmit(row, done) {
+      // 閲嶆柊璧嬪�糃loneSelect浼犻�掔殑鏁版嵁涓鸿緭鍏ユ鍙互淇敼鐨勬暟鎹紝CloneModel鎻愪氦琛ㄥ崟杈撳叆妗嗗弻鍚戠粦瀹氭暟鎹�
+      Object.assign(this.CloneSelect[0], this.CloneModel);
+      // CloneSelect鏁扮粍绗竴椤� 鍖归厤CloneModel瀵硅薄
+      copy(this.CloneSelect[0])
+        .then(() => {
+          // 鍥犱负鏄祵濂楀脊绐楁墍浠ユ墜鍔ㄥ叧闂瑿loneinnerVisible锛孋loneVisible涓や釜寮圭獥銆�
+          this.CloneinnerVisible = false;
+          this.CloneVisible = false;
+          this.$message.success("澶嶅埗鎴愬姛");
+          this.TemRefresh();
+          done(row);
+        })
+        .catch((error) => {
+          done(error);
+        });
     },
     //鍒锋柊
     TemRefresh() {
-      this.FormLoing = true
+      this.FormLoing = true;
       if (this.nodeClickList.oid != "") {
         gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': this.nodeClickList.oid}).then(res => {
           this.Formlist = res.data.data.filter(item => {
             return item.codeclassifyoid == this.nodeClickList.oid
           })
+          this.crudLCStatus=this.Formlist[this.selectRow].lcStatus;
+          this.crudArray.push(this.Formlist[this.selectRow]);
+          gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]':  res.data.data[this.selectRow].oid,limit:-1}).then(res => {
+            this.ProData = res.data.data;
+            //鍒嗙被娉ㄥ叆鏁版嵁鏍煎紡
+            this.ProData =  res.data.data.map((item) => {
+              //濡傛灉鍒嗙被娉ㄥ叆classifyInvokeAttr涓虹┖璇存槑鏄垵濮嬬姸鎬�
+              if(item.classifyInvokeAttr !== ''){
+                if (!item.hasOwnProperty('classifyInvokeText')) { // 妫�鏌lassifyInvokeText灞炴�ф槸鍚﹀瓨鍦�
+                  item = {
+                    ...item,
+                    classifyInvokeText: {
+                      "娉ㄥ叆绫诲瀷": item.classifyInvokeAttr,
+                      "娉ㄥ叆绫诲瀷鍚嶇О": item.classifyInvokeAttrName,
+                      "灞傜骇璁剧疆": item.classifyInvokeLevel,
+                      "鏄惁鍙慨鏀�": item.classifyInvokeEditFlag
+                    }
+                  };
+                }
+              }
+              return item;
+            });
+          }).catch(res => {
+            this.$message.error(res)
+          })
         })
       } else {
         this.FormLoing = true

--
Gitblit v1.9.3