From 8199d1738e8b75ccad7f3465dfd88aac2bb1a160 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 04 八月 2023 14:56:11 +0800
Subject: [PATCH] 主题库切换树模板流程和阶段显示bug

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

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index 3710c01..3e6f995 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -24,7 +24,7 @@
           </div>
         </div>
         <!--        鏍戣妭鐐规坊鍔犲璇濇-->
-        <el-dialog :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :visible.sync="TreeAddFormVisible"  v-loading="AddLoading" 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-item :label="this.TreeFlag ? '鍒嗙被缂栧彿锛�' :'涓婚搴撶紪鍙凤細'" label-width="150px" style="display: inline-block" prop="id">
@@ -52,7 +52,7 @@
             </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>
@@ -303,7 +303,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,9 +354,10 @@
   inject: ["crudTreeData"],
   data() {
     return {
+      masterRow:null,
       AddLoading:false,
       // 瀹氫箟涓�涓彉閲忔潵淇濆瓨鏍戣姹傜殑鏁伴噺
-      requestCount:0,
+      requestCount:null,
       //瀵煎叆鐘舵�佹
       ThemeImportVisible:false,
       selectRow:'',
@@ -389,10 +394,15 @@
         addBtn:false,
         index:true,
         border:true,
-        selection:true,
         menu:false,
         height:380,
         column:[
+          {
+            label: '',
+            prop: 'radio',
+            width: 60,
+            display: false
+          },
           {
             label:'鑻辨枃鍚嶇О',
             prop:'id'
@@ -417,7 +427,7 @@
           label: '鑻辨枃鍚嶇О'
         }
       ],
-      SelectValue:"",
+      SelectValue:"id",
       SelectFInd:"",
       addFlag:false,
       // 琛ㄦ牸褰撳墠琛宨d
@@ -488,10 +498,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' },
@@ -662,11 +672,7 @@
     }
   },
   watch:{
-    TreeFlagCode:{
-      handler(newval,oldval){
-        console.log('TreeFlagCode',newval)
-      }
-    }
+
   },
   //tab鏍忛粯璁ゆ槸琛ㄦ牸
   mounted() {
@@ -743,6 +749,8 @@
 
   },
   methods: {
+    // 鍏抽棴寮圭獥
+
     /** 瀵煎叆 */
     ImportExcel(){
       this.ThemeImportVisible=true;
@@ -777,15 +785,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=""
       }
     },
     //缂栫爜瑙勫垯纭畾
@@ -836,15 +840,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=""
       }
     },
     //鍏抽敭灞炴�ф帴鍙�
@@ -889,15 +889,11 @@
           '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=""
       }
     },
     //  鐩镐技椤瑰閫�
@@ -942,22 +938,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){
@@ -1031,6 +1024,11 @@
         loading.close();
       }
     },
+    //鏍戣妭鐐瑰彇娑堜簨浠�
+    TreeEscHandler(){
+      this.TreeAddform={};
+      this.TreeAddFormVisible=false
+    },
     //鏍戣妭鐐规坊鍔犱簨浠�
     TreeAddHandler() {
       const data = this.TreeAddform;
@@ -1047,6 +1045,9 @@
           });
           this.getAttr();
           this.TreeAddFormVisible = false;
+          //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
+          this.ProData=[];
+          this.Formlist=[];
         })
         .catch((res) => {
           this.$message({
@@ -1207,6 +1208,7 @@
       this.editTreeFLagCode = !data.parentId;
       this.nodeClickList = data;
       this.selectRow = 0;
+      this.crudArray=[]
       try {
         this.requestCount += 1;
         const [res1, res2, res3] = await Promise.all([
@@ -1326,7 +1328,7 @@
             message: "娣诲姞鎴愬姛!"
           });
           done(row)
-          this.CrudRend()
+          this.TemRefresh();
         }).catch(res => {
           this.$message({
             type: 'info',
@@ -1338,7 +1340,7 @@
     //妯℃澘绠$悊淇敼
     CrudRowUpdata(row,index,done) {
       editSave(row).then(() => {
-        this.CrudRend()
+        this.TemRefresh();
         this.$message({
           type: "success",
           message: "鎿嶄綔鎴愬姛!"
@@ -1351,7 +1353,7 @@
     //妯℃澘绠$悊鍒犻櫎
     CrudRowDel(row) {
       deleteData(row).then(()=> {
-        this.CrudRend()
+        this.TemRefresh();
       }).catch(res => {
         this.$message({
           type: 'info',
@@ -1407,29 +1409,27 @@
       }
     },
     //鍏嬮殕妯℃澘鍗曢�夋鏀瑰彉
-    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) {
+      Object.assign(this.CloneModel, row[0]);
+      this.CloneSelect = [row[0]];
+      this.CloneSelect[0].codeclassifyoid = this.nodeClickList.oid;
     },
     //鍏嬮殕琛ㄥ崟鎻愪氦
-    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);
+      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