From 6b520f6994dd96a811e19dd31fa8725f32ac3459 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 08 八月 2023 14:53:26 +0800
Subject: [PATCH] 主题库分类添加修改 bug整改

---
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue |  218 +++++++++++++++++++++++++------------------
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue    |   37 ++++++
 2 files changed, 162 insertions(+), 93 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue
index 3f70218..aaf7255 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue
@@ -6,7 +6,7 @@
     </avue-form>
     <div>
 <!--     缂栫爜瑙勫垯-->
-      <el-dialog  :visible.sync="MasterdialogVisible"   title="涓恒�愮紪鐮佽鍒欍�戦�夊彇鍊�" append-to-body>
+      <el-dialog  :visible.sync="MasterdialogVisible"   title="涓恒�愮紪鐮佽鍒欍�戦�夊彇鍊�" append-to-body :before-close="masterEscHandler">
         <template>
           <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
             <el-option
@@ -20,17 +20,22 @@
           <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="Option" @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.loneTreeNewForm.coderuleoidName}}]</div>
           <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
             <el-button type="primary" size="small" @click="MasterHandlerClick">纭畾</el-button>
-            <el-button  size="small" @click="MasterdialogVisible=false">鍙栨秷</el-button>
+            <el-button  size="small" @click="masterEscHandler">鍙栨秷</el-button>
           </div>
         </div>
       </el-dialog>
 <!--      鍏抽敭灞炴�ф煡璇㈣鍒�-->
-      <el-dialog  :visible.sync="KeydialogVisible"   title="涓恒�愬叧閿睘鎬ф煡璇㈣鍒欍�戦�夊彇鍊�" append-to-body>
+      <el-dialog  :visible.sync="KeydialogVisible"   title="涓恒�愬叧閿睘鎬ф煡璇㈣鍒欍�戦�夊彇鍊�" append-to-body :before-close="KeyEscHandler">
         <template>
           <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
             <el-option
@@ -44,17 +49,22 @@
           <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="Option" @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 #eee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.loneTreeNewForm.codekeyattrrepeatoidName}}]</div>
           <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
             <el-button type="primary" size="small" @click="KeyHandlerClick">纭畾</el-button>
-            <el-button  size="small" @click="KeydialogVisible=false">鍙栨秷</el-button>
+            <el-button  size="small" @click="KeyEscHandler">鍙栨秷</el-button>
           </div>
         </div>
       </el-dialog>
       <!--      鐩镐技椤规煡璇㈣鍒�-->
-      <el-dialog  :visible.sync="SimidialogVisible"   title="涓恒�愮浉浼奸」鏌ヨ瑙勫垯銆戦�夊彇鍊�" append-to-body>
+      <el-dialog  :visible.sync="SimidialogVisible"   title="涓恒�愮浉浼奸」鏌ヨ瑙勫垯銆戦�夊彇鍊�" append-to-body :before-close="simEscHandler">
         <template>
           <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
             <el-option
@@ -68,21 +78,26 @@
           <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="Option"@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.loneTreeNewForm.codeResembleRuleOidName}}]</div>
           <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
             <el-button type="primary" size="small" @click="simHandlerClick">纭畾</el-button>
-            <el-button  size="small" @click="SimidialogVisible=false">鍙栨秷</el-button>
+            <el-button  size="small" @click="simEscHandler">鍙栨秷</el-button>
           </div>
         </div>
       </el-dialog>
 <!--      瀛樺偍鐨勪笟鍔$被鍨�-->
-      <el-dialog  :visible.sync="BtmdialogVisible"   title="涓恒�愪笟鍔$被鍨嬨�戦�夊彇鍊�" append-to-body>
+      <el-dialog  :visible.sync="BtmdialogVisible"   title="涓恒�愪笟鍔$被鍨嬨�戦�夊彇鍊�" append-to-body :before-close="BtmEscHandler">
         <template>
           <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px !important;">
             <el-option
-              v-for="item in SelectOption"
+              v-for="item in masterSelectOption"
               :key="item.value"
               :label="item.label"
               :value="item.value"
@@ -94,14 +109,15 @@
         </template>
         <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>
+            <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.loneTreeNewForm.btmTypeName}}]</div>
           <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
             <el-button type="primary" size="small" @click="btmHandlerClick">纭畾</el-button>
-            <el-button  size="small" @click="BtmdialogVisible=false">鍙栨秷</el-button>
+            <el-button  size="small" @click="BtmEscHandler">鍙栨秷</el-button>
           </div>
         </div>
       </el-dialog>
@@ -117,7 +133,7 @@
   props: ['loneTreeNewForm','flag','Editclose','TreeFlag','nodeClickList'],
   data() {
     return {
-      masterRow:0,
+      masterRow:null,
       SelectFInd:"",
       masterName:"",
       masterOid:"",
@@ -144,7 +160,17 @@
           label: '鑻辨枃鍚嶇О'
         }
       ],
-      SelectValue:"",
+      masterSelectOption:[
+        {
+          value: 'id',
+          label: '涓氬姟绫诲瀷缂栧彿'
+        },
+        {
+          value: 'name',
+          label: '涓氬姟绫诲瀷鍚嶇О'
+        },
+      ],
+      SelectValue:'id',
       btmOption:{
         addBtn:false,
         index:true,
@@ -167,6 +193,33 @@
           }
         ]
       },
+      Option:{
+        addBtn:false,
+        index:true,
+        border:true,
+        menu:false,
+        height:380,
+        column:[
+          {
+            label: '',
+            prop: 'radio',
+            width: 60,
+            display: false
+          },
+          {
+            label:'鑻辨枃缂栧彿',
+            prop:'id'
+          },
+          {
+            label:'涓枃鍚嶇О',
+            prop:'name'
+          },
+          {
+            label:'鎻忚堪',
+            prop:'description'
+          }
+        ]
+      },
       masterOption:{
         addBtn:false,
         index:true,
@@ -181,11 +234,11 @@
             display: false
           },
           {
-            label:'鑻辨枃鍚嶇О',
+            label:'涓氬姟绫诲瀷缂栧彿',
             prop:'id'
           },
           {
-            label:'涓枃鍚嶇О',
+            label:'涓氬姟绫诲瀷鍚嶇О',
             prop:'name'
           },
           {
@@ -377,23 +430,39 @@
     error(err) {
       this.$message.success(err);
     },
+    //缂栫爜瑙勫垯鍏抽棴
+    masterEscHandler(){
+      this.SelectFInd='';
+      this.SelectValue='id';
+      this.masterRow=null;
+      this.MasterdialogVisible=false;
+    },
+    //鍏抽敭灞炴�у叧闂�
+    KeyEscHandler(){
+      this.SelectFInd='';
+      this.SelectValue='id';
+      this.masterRow=null;
+      this.KeydialogVisible=false;
+    },
+    //鐩镐技椤瑰叧闂�
+    simEscHandler(){
+      this.SelectFInd='';
+      this.SelectValue='id';
+      this.masterRow=null;
+      this.SimidialogVisible=false;
+    },
+    //瀛樺偍涓氬姟绫诲瀷鍏抽棴
+    BtmEscHandler(){
+      this.SelectFInd='';
+      this.SelectValue='id';
+      this.masterRow=null;
+      this.BtmdialogVisible=false;
+    },
     //缂栫爜瑙勫垯鏌ヨ
     SelectFindeHandler(){
-      if(this.SelectValue == 'id'){
-        const masterParameter={
-          '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=""
-      }
+      const masterParameter = {};
+      masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`;
+      this.MasterdefaultRend(masterParameter)
     },
     //缂栫爜瑙勫垯澶辩劍
     CodeFoucus(){
@@ -416,9 +485,10 @@
     },
     //缂栫爜澶氶��
     masterSelect(row){
-      this.masterSelectList=row;
-      this.masterName=row[0].name;
-      this.masterOid=row[0].oid;
+      this.masterRow = row.$index;
+      this.masterSelectList = row;
+      this.masterName = row.name;
+      this.masterOid = row.oid;
     },
     //缂栫爜鎺ュ彛
     MasterdefaultRend(masterParameter){
@@ -452,37 +522,27 @@
     },
     //鍏抽敭灞炴�ф煡璇�
     KeySelectFindeHandler(){
-      if(this.SelectValue == 'id'){
-        const masterParameter={
-          '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="";
-      }
+      const masterParameter = {};
+      masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`;
+      this.KeydefaultRend(masterParameter)
     },
     //鍏抽敭灞炴�ф帴鍙�
-    KeydefaultRend(){
+    KeydefaultRend(masterParameter){
       defaultReferDataGrid({
         referType:'codekeyattrrepeat',
         isMuti:'false',
-        'conditionMap["lcstatus"]':'Enabled'
+        'conditionMap["lcstatus"]':'Enabled',
+        ...masterParameter
       }).then(res=>{
         this.KeyData=res.data.records;
       })
     },
     //鍏抽敭澶氶��
     KeySelect(row){
-      this.KeySelectLIst=row;
-      this.KeyName=row[0].name;
-      this.KeyOid=row[0].oid;
+      this.masterRow = row.$index;
+      this.KeySelectLIst = row;
+      this.KeyName = row.name;
+      this.KeyOid = row.oid;
     },
     //鐩镐技椤瑰け鐒�
     simFouce(){
@@ -505,34 +565,24 @@
     },
     //鐩镐技椤规煡璇�
     SimSelectFindeHandler(){
-      if(this.SelectValue == 'id'){
-        const masterParameter={
-          '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=""
-      }
+      const masterParameter = {};
+      masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`;
+      this.simdefaultRend(masterParameter)
     },
     //鐩镐技椤瑰閫�
     simSelect(row){
-      this.simSelectList=row;
-      this.simName=row[0].name;
-      this.simOid=row[0].oid;
+      this.masterRow = row.$index;
+      this.simSelectList = row;
+      this.simName = row.name;
+      this.simOid = row.oid;
     },
     //鐩镐技椤归」鎺ュ彛
-    simdefaultRend(){
+    simdefaultRend(masterParameter){
       defaultReferDataGrid({
         referType:'coderesemblerule',
         isMuti:'false',
-        'conditionMap["lcstatus"]':'Enabled'
+        'conditionMap["lcstatus"]':'Enabled',
+        ...masterParameter
       }).then(res=>{
         this.simData=res.data.records;
       })
@@ -558,21 +608,9 @@
     },
     //涓氬姟绫诲瀷鏌ヨ
     BtmSelectFindeHandler(){
-      if(this.SelectValue == 'id'){
-        const masterParameter={
-          '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=""
-      }
+      const masterParameter = {};
+      masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`;
+      this.btmdefaultRend(masterParameter);
     },
     //涓氬姟绫诲瀷澶氶��
     btmSelect(row){
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index 4030c0d..c016a95 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -248,7 +248,7 @@
             <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SelectFindeHandler">鏌ヨ
             </el-button>
           </template>
-          <avue-crud :data="masterData" :option="masterOption" @row-click="masterSelect">
+          <avue-crud :data="masterData" :option="Option" @row-click="masterSelect">
             <template slot="radio" slot-scope="{row}">
               <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
               </el-radio>
@@ -281,7 +281,7 @@
             <el-button plain size="small" style="margin-left: 20px" type="primary" @click="KeySelectFindeHandler">鏌ヨ
             </el-button>
           </template>
-          <avue-crud :data="KeyData" :option="masterOption" @row-click="KeySelect">
+          <avue-crud :data="KeyData" :option="Option" @row-click="KeySelect">
             <template slot="radio" slot-scope="{row}">
               <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
               </el-radio>
@@ -314,7 +314,7 @@
             <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SimSelectFindeHandler">鏌ヨ
             </el-button>
           </template>
-          <avue-crud :data="simData" :option="masterOption" @row-click="simSelect">
+          <avue-crud :data="simData" :option="Option" @row-click="simSelect">
             <template slot="radio" slot-scope="{row}">
               <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
               </el-radio>
@@ -458,6 +458,33 @@
           },
           {
             label: '涓氬姟绫诲瀷鍚嶇О',
+            prop: 'name'
+          },
+          {
+            label: '鎻忚堪',
+            prop: 'description'
+          }
+        ]
+      },
+      Option:{
+        addBtn: false,
+        index: true,
+        border: true,
+        menu: false,
+        height: 380,
+        column: [
+          {
+            label: '',
+            prop: 'radio',
+            width: 60,
+            display: false
+          },
+          {
+            label: '鑻辨枃鍚嶇О',
+            prop: 'id'
+          },
+          {
+            label: '涓枃鍚嶇О',
             prop: 'name'
           },
           {
@@ -807,24 +834,28 @@
     BtmEscHandler(){
       this.SelectFInd='';
       this.SelectValue='id';
+      this.masterRow=null;
       this.BtmdialogVisible=false;
     },
     //鐩镐技椤瑰叧闂�
     simEscHandler(){
       this.SelectFInd='';
       this.SelectValue='id';
+      this.masterRow=null;
       this.SimidialogVisible=false;
     },
     //鍏抽敭灞炴�у叧闂�
     KeyEscHandler(){
       this.SelectFInd='';
       this.SelectValue='id';
+      this.masterRow=null;
       this.KeydialogVisible=false;
     },
     //缂栫爜瑙勫垯鍏抽棴
     masterEscHandler(){
       this.SelectFInd='';
       this.SelectValue='id';
+      this.masterRow=null;
       this.MasterdialogVisible=false;
     },
     // 鍏抽棴寮圭獥

--
Gitblit v1.9.3