From bf74d819239bb136f72ddc92129ecdbabbc38fa7 Mon Sep 17 00:00:00 2001
From: lihang <lihang@vci-tech.com>
Date: 星期五, 04 八月 2023 18:44:16 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs

---
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue |  131 +++++++++++++++++++++++--------------------
 1 files changed, 69 insertions(+), 62 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index 7ca191b..581c486 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -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" >
@@ -427,7 +439,7 @@
           label: '鑻辨枃鍚嶇О'
         }
       ],
-      SelectValue:"",
+      SelectValue:"id",
       SelectFInd:"",
       addFlag:false,
       // 琛ㄦ牸褰撳墠琛宨d
@@ -498,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' },
@@ -672,11 +684,7 @@
     }
   },
   watch:{
-    TreeFlagCode:{
-      handler(newval,oldval){
-        console.log('TreeFlagCode',newval)
-      }
-    }
+
   },
   //tab鏍忛粯璁ゆ槸琛ㄦ牸
   mounted() {
@@ -753,6 +761,8 @@
 
   },
   methods: {
+    // 鍏抽棴寮圭獥
+
     /** 瀵煎叆 */
     ImportExcel(){
       this.ThemeImportVisible=true;
@@ -774,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(){
@@ -787,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=""
       }
     },
     //缂栫爜瑙勫垯纭畾
@@ -846,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=""
       }
     },
     //鍏抽敭灞炴�ф帴鍙�
@@ -869,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(){
@@ -899,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(){
@@ -952,15 +952,11 @@
           '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="";
       }
     },
     //涓氬姟绫诲瀷澶氶��
@@ -1226,6 +1222,7 @@
       this.editTreeFLagCode = !data.parentId;
       this.nodeClickList = data;
       this.selectRow = 0;
+      this.crudArray=[]
       try {
         this.requestCount += 1;
         const [res1, res2, res3] = await Promise.all([
@@ -1345,7 +1342,7 @@
             message: "娣诲姞鎴愬姛!"
           });
           done(row)
-          this.CrudRend()
+          this.TemRefresh();
         }).catch(res => {
           this.$message({
             type: 'info',
@@ -1357,7 +1354,7 @@
     //妯℃澘绠$悊淇敼
     CrudRowUpdata(row,index,done) {
       editSave(row).then(() => {
-        this.CrudRend()
+        this.TemRefresh();
         this.$message({
           type: "success",
           message: "鎿嶄綔鎴愬姛!"
@@ -1370,13 +1367,20 @@
     //妯℃澘绠$悊鍒犻櫎
     CrudRowDel(row) {
       deleteData(row).then(()=> {
-        this.CrudRend()
+        this.TemRefresh();
       }).catch(res => {
         this.$message({
           type: 'info',
           message: res
         });
       })
+    },
+    //鍏嬮殕鍙栨秷
+    cloneClose(){
+      this.$refs.cloneTree.setCurrentKey(null)
+      this.ClonenodeClickList = {}
+      this.CloneFormlist=[]
+      this.CloneVisible=false;
     },
     //鍏嬮殕妯℃澘鏌ヨ
     CloneEnterFind(){
@@ -1426,29 +1430,32 @@
       }
     },
     //鍏嬮殕妯℃澘鍗曢�夋鏀瑰彉
-    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() {

--
Gitblit v1.9.3