From 25ef4e85586c27433c865b69c67ccf5a380b93a7 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 05 十二月 2023 13:52:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

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

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index c016a95..72f90ae 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -3,26 +3,54 @@
   <el-container>
     <!--    宸︿晶鑿滃崟-->
     <el-aside>
-      <basic-container style="overflow:hidden;">
+      <basic-container>
         <div>
           <div>
             <div style="display: flex; flex-direction: column;">
-              <div style="display: flex;">
-                <el-button plain size="small" type="primary" @click="TreeAdd">娣诲姞</el-button>
-                <el-button plain size="small" type="primary" @click="TreeEdit">淇敼</el-button>
-                <el-button plain size="small" type="primary" @click="TreeDel">鍒犻櫎</el-button>
-                <el-button plain size="small" type="primary" @click="flushed">鍒锋柊</el-button>
+              <div style="display: flex;justify-content: space-around">
+                <el-button v-if="permissionList.TreeAddStatus" plain size="mini" type="primary" @click="TreeAdd">娣诲姞
+                </el-button>
+                <el-button v-if="permissionList.TreeEditStatus" plain size="mini" type="primary" @click="TreeEdit">淇敼
+                </el-button>
+                <el-button v-if="permissionList.TreeDelStatus" plain size="mini" type="primary" @click="TreeDel">鍒犻櫎
+                </el-button>
               </div>
-              <div style="display: flex; margin-top: 10px">
-                <el-button plain size="small" type="primary" @click="Enable">鍚敤</el-button>
-                <el-button plain size="small" type="primary" @click="Deactivate">鍋滅敤</el-button>
-                <el-button plain size="small" type="primary" @click.native="ImportExcel">瀵煎叆</el-button>
-                <el-button plain size="small" type="primary" @click="ExportExcel">瀵煎嚭</el-button>
+              <div style="display: flex; margin-top: 10px;justify-content: space-around">
+                <el-button v-if="permissionList.flushedStatus" plain size="mini" type="primary" @click="flushed">鍒锋柊
+                </el-button>
+                <el-button v-if="permissionList.EnableStatus" plain size="mini" type="primary" @click="Enable">鍚敤
+                </el-button>
+                <el-button v-if="permissionList.DeactivateStatus" plain size="mini" type="primary" @click="Deactivate">
+                  鍋滅敤
+                </el-button>
+              </div>
+              <div style="display: flex; margin-top: 10px;justify-content: space-around">
+                <el-button v-if="permissionList.ImportExcelStatus" plain size="mini" type="primary"
+                           @click.native="ImportExcel">瀵煎叆
+                </el-button>
+                <el-button v-if="permissionList.ExportExcelStatus" plain size="mini" type="primary"
+                           @click="ExportExcel">瀵煎嚭
+                </el-button>
+                <el-button v-if="permissionList.ExportExcelStatus" plain size="mini" type="primary"
+                           @click="testHandler">娴嬭瘯
+                </el-button>
               </div>
             </div>
             <div style="display: flex;justify-content: space-around;margin-top: 5px;margin-bottom: 5px">
             </div>
           </div>
+          <!--          宸︿晶鏍�-->
+          <div style="height: calc(100vh - 230px);overflow: auto;">
+            <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata"
+                       :defaultExpandAll="false"
+                       :option="Treeoption"
+                       class="classifyTree"
+                       style="height: calc(100vh - 280px);"
+                       @node-click="nodeClick"
+            >
+            </avue-tree>
+          </div>
+
           <!--        鏍戣妭鐐规坊鍔犲璇濇-->
           <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler"
                      :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :visible.sync="TreeAddFormVisible" append-to-body
@@ -51,6 +79,16 @@
                 <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px"
                           @focus="Keyfouce"></el-input>
               </el-form-item>
+              <el-form-item label="鏄惁鍙備笌鍏抽敭灞炴�ф牎楠岋細" label-width="170px">
+                <el-switch
+                  v-model="TreeAddform.codeKeyAttrValue"
+                  active-color="#13ce66"
+                  active-text="鏄�"
+                  inactive-color="#ff4949"
+                  inactive-text="鍚�"
+                  @change="switchChange">
+                </el-switch>
+              </el-form-item>
               <el-form-item label="鐩镐技鏌ヨ瑙勫垯锛�" label-width="150px">
                 <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px"
                           @focus="simFouce"></el-input>
@@ -63,19 +101,12 @@
           </el-dialog>
           <!--        淇敼瀵硅瘽妗�-->
           <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="淇敼鍒嗙被">
-            <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode" :flag="'edit'"
+            <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode"
+                              :flag="'edit'"
                               :loneTreeNewForm="TreeList" :nodeClickList="nodeClickList"
                               :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed"
                               @referTreeForm="referTreeForm"></classifyTreeform>
           </el-dialog>
-          <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata"
-                     :defaultExpandAll="false"
-                     :option="Treeoption"
-                     class="classifyTree"
-                     style="height: calc(100vh - 230px);"
-                     @node-click="nodeClick"
-          >
-          </avue-tree>
         </div>
       </basic-container>
     </el-aside>
@@ -102,9 +133,11 @@
                   </template>
 
             <template slot="menuLeft">
-              <el-button plain size="small" type="primary" @click="FindeHanler">鏌ヨ</el-button>
-              <el-button plain size="small" type="primary" @click="TemRefresh">鍒锋柊</el-button>
-              <el-button plain size="small" type="primary" @click="CloneBtn">浠庡叾瀹冩ā鏉垮厠闅�</el-button>
+              <el-button v-if="permissionList.FindStatus" plain size="small" type="primary"
+                         @click="FindeHanler">鏌ヨ</el-button>
+              <el-button v-if="permissionList.TemRefreshStatus" plain size="small" type="primary"
+                         @click="TemRefresh">鍒锋柊</el-button>
+              <el-button v-if="permissionList.CloneBtnStuatus" plain size="small" type="primary" @click="CloneBtn">浠庡叾瀹冩ā鏉垮厠闅�</el-button>
               <!--              鏌ヨ瀵硅瘽妗�-->
            <el-dialog :visible.sync="FindFormVisible" append-to-body title="楂樼骇鏌ヨ">
               <div>
@@ -141,7 +174,7 @@
                         <avue-tree ref="cloneTree" v-model="TreeAvueform" v-loading="loading" :data="Treedata"
                                    :defaultExpandAll="false"
                                    :option="Treeoption"
-                                   style="height: 50.5vh;margin-right: 10px"
+                                   style="height: 50.5vh;margin-right: 10px;width: 300px"
                                    @node-click="ClonenodeClick"
                         >
                         </avue-tree>
@@ -233,7 +266,8 @@
                        :rowIndex="this.selectRow"></templatePro>
         </span>
         <!--     缂栫爜瑙勫垯-->
-        <el-dialog :visible.sync="MasterdialogVisible" append-to-body title="涓恒�愮紪鐮佽鍒欍�戦�夊彇鍊�" :before-close="masterEscHandler">
+        <el-dialog :before-close="masterEscHandler" :visible.sync="MasterdialogVisible" append-to-body
+                   title="涓恒�愮紪鐮佽鍒欍�戦�夊彇鍊�">
           <template>
             <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
               <el-option
@@ -266,7 +300,7 @@
           </div>
         </el-dialog>
         <!--      鍏抽敭灞炴�ф煡璇㈣鍒�-->
-        <el-dialog :visible.sync="KeydialogVisible" append-to-body title="涓恒�愬叧閿睘鎬ф煡璇㈣鍒欍�戦�夊彇鍊�" :before-close="KeyEscHandler">
+        <el-dialog :before-close="KeyEscHandler" :visible.sync="KeydialogVisible" append-to-body title="涓恒�愬叧閿睘鎬ф煡璇㈣鍒欍�戦�夊彇鍊�">
           <template>
             <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
               <el-option
@@ -290,7 +324,9 @@
           <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 }}]
+              宸茶缃殑鍊间负:[{{
+                this.TreeAddform.codeKeyAttrRepeatOidName == '' ? '鏈缃��' : this.TreeAddform.codekeyattrrepeatoidName
+              }}]
             </div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
               <el-button size="small" type="primary" @click="KeyHandlerClick">纭畾</el-button>
@@ -299,7 +335,7 @@
           </div>
         </el-dialog>
         <!--      鐩镐技椤规煡璇㈣鍒�-->
-        <el-dialog :visible.sync="SimidialogVisible" append-to-body title="涓恒�愮浉浼奸」鏌ヨ瑙勫垯銆戦�夊彇鍊�" :before-close="simEscHandler">
+        <el-dialog :before-close="simEscHandler" :visible.sync="SimidialogVisible" append-to-body title="涓恒�愮浉浼奸」鏌ヨ瑙勫垯銆戦�夊彇鍊�">
           <template>
             <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px">
               <el-option
@@ -323,7 +359,9 @@
           <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 }}]
+              宸茶缃殑鍊间负:[{{
+                this.TreeAddform.codeResembleRuleOidName == '' ? '鏈缃��' : this.TreeAddform.codeResembleRuleOidName
+              }}]
             </div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
               <el-button size="small" type="primary" @click="simHandlerClick">纭畾</el-button>
@@ -332,7 +370,7 @@
           </div>
         </el-dialog>
         <!--        涓氬姟绫诲瀷-->
-        <el-dialog :visible.sync="BtmdialogVisible" append-to-body title="涓恒�愪笟鍔$被鍨嬭鍒欍�戦�夊彇鍊�" :before-close="BtmEscHandler">
+        <el-dialog :before-close="BtmEscHandler" :visible.sync="BtmdialogVisible" append-to-body title="涓恒�愪笟鍔$被鍨嬭鍒欍�戦�夊彇鍊�">
           <template>
             <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 135px !important;">
               <el-option
@@ -390,17 +428,15 @@
   upVersion,
   stopLose,
   startRelease,
-  exportClassify
+  exportClassify,
+  flowingDependencyGen
 } from "@/api/template/templateAttr";
 import {defaultReferDataGrid, referDataGrid} from '@/api/MasterData/master'
 import func from "@/util/func";
+import {mapGetters} from "vuex";
 
 export default {
   name: "classifyTrees.vue",
-  //浣跨敤inject鎺ユ敹鍙傛暟
-  //Treeoption宸︿晶鏍戞柊澧炶〃鍗曢」 Treedata宸︿晶鏍戣妭鐐� 閰嶇疆椤� crudTreeOption鍙充晶琛ㄦ牸閰嶇疆椤� crudTreeData鍙充晶琛ㄦ牸鏄剧ず鍐呭
-  //Treeform鍙充晶琛ㄥ崟閰嶇疆椤�
-  inject: ["crudTreeData"],
   data() {
     return {
       masterRow: null,
@@ -466,9 +502,10 @@
           }
         ]
       },
-      Option:{
+      Option: {
         addBtn: false,
         index: true,
+        columnBtn: false,
         border: true,
         menu: false,
         height: 380,
@@ -503,7 +540,7 @@
           label: '鑻辨枃鍚嶇О'
         }
       ],
-      masterSelectOption:[
+      masterSelectOption: [
         {
           value: 'id',
           label: '涓氬姟绫诲瀷缂栧彿'
@@ -579,7 +616,9 @@
         //缂栫爜瑙勫垯
         codeRuleOidName: "",
         //瀛樺偍鐨勪笟鍔$被鍨�
-        btmTypeName: ""
+        btmTypeName: "",
+        codeKeyAttrValue: true,
+        isParticipateCheck: 1
       },
       rules: {
         id: [
@@ -660,6 +699,7 @@
       CloneSelect: [],
       //鍏嬮殕妯℃澘option
       ClonecrudTreeOption: {
+        columnBtn: false,
         index: true,
         border: true,
         menu: false,
@@ -755,7 +795,6 @@
     }
   },
   watch: {},
-  //tab鏍忛粯璁ゆ槸琛ㄦ牸
   mounted() {
     this.type = this.tabOption.column[0];
     this.getAttr();
@@ -770,10 +809,27 @@
     }, true)
   },
   computed: {
+    ...mapGetters(["permission"]),
+    permissionList() {
+      return {
+        TreeAddStatus: this.vaildData(this.permission.classifyTree.tree_add, false),
+        TreeEditStatus: this.vaildData(this.permission.classifyTree.tree_edit, false),
+        TreeDelStatus: this.vaildData(this.permission.classifyTree.tree_delete, false),
+        flushedStatus: this.vaildData(this.permission.classifyTree.tree_break, false),
+        EnableStatus: this.vaildData(this.permission.classifyTree.tree_enable, false),
+        DeactivateStatus: this.vaildData(this.permission.classifyTree.tree_stop, false),
+        ImportExcelStatus: this.vaildData(this.permission.classifyTree.tree_import, false),
+        ExportExcelStatus: this.vaildData(this.permission.classifyTree.tree_export, false),
+        FindStatus: this.vaildData(this.permission.classifyTree.manage_search, false),
+        TemRefreshStatus: this.vaildData(this.permission.classifyTree.manage_break, false),
+        CloneBtnStuatus: this.vaildData(this.permission.classifyTree.manage_clone, false),
+      }
+    },
     crudTreeOption() {
       return {
         index: true,
         border: true,
+        columnBtn: false,
         height: 180,
         addBtn: this.Formlist.length <= 0 && this.nodeClickList != "",
         editBtn: false,
@@ -827,36 +883,52 @@
     }
   },
   created() {
-
   },
   methods: {
+    testHandler(){
+      if(this.nodeClickList.length <=0 ){
+        this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒')
+        return;
+      }
+      console.log(this.nodeClickList.oid)
+      flowingDependencyGen(this.nodeClickList.oid).then(res => {
+        this.$message.success('鎿嶄綔鎴愬姛')
+      }).catch(res => {
+        this.$message.error(res)
+      })
+    },
+    // switch
+    switchChange() {
+      this.TreeAddform.isParticipateCheck = this.TreeAddform.codeKeyAttrValue === true ? 1 : 0;
+      // console.log(this.TreeAddform.isParticipateCheck)
+    },
     //瀛樺偍鐨勪笟鍔$被鍨嬪叧闂�
-    BtmEscHandler(){
-      this.SelectFInd='';
-      this.SelectValue='id';
-      this.masterRow=null;
-      this.BtmdialogVisible=false;
+    BtmEscHandler() {
+      this.SelectFInd = '';
+      this.SelectValue = 'id';
+      this.masterRow = null;
+      this.BtmdialogVisible = false;
     },
     //鐩镐技椤瑰叧闂�
-    simEscHandler(){
-      this.SelectFInd='';
-      this.SelectValue='id';
-      this.masterRow=null;
-      this.SimidialogVisible=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;
+    KeyEscHandler() {
+      this.SelectFInd = '';
+      this.SelectValue = 'id';
+      this.masterRow = null;
+      this.KeydialogVisible = false;
     },
     //缂栫爜瑙勫垯鍏抽棴
-    masterEscHandler(){
-      this.SelectFInd='';
-      this.SelectValue='id';
-      this.masterRow=null;
-      this.MasterdialogVisible=false;
+    masterEscHandler() {
+      this.SelectFInd = '';
+      this.SelectValue = 'id';
+      this.masterRow = null;
+      this.MasterdialogVisible = false;
     },
     // 鍏抽棴寮圭獥
     /** 瀵煎叆 */
@@ -889,7 +961,7 @@
     //缂栫爜瑙勫垯鏌ヨ
     SelectFindeHandler() {
       const masterParameter = {};
-      masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`;
+      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
       this.MasterdefaultRend(masterParameter)
     },
     //缂栫爜瑙勫垯纭畾
@@ -904,6 +976,7 @@
         this.$set(this.TreeAddform, 'codeRuleOidName', this.masterName)
         this.$set(this.TreeAddform, 'codeRuleOid', this.masterOid)
         this.$emit('MasterHandler', this.loneTreeNewForm)
+        this.masterRow = null;
       }
     },
     //缂栫爜鎺ュ彛
@@ -912,6 +985,7 @@
         referType: 'coderule',
         isMuti: 'false',
         'conditionMap["lcstatus"]': 'Released',
+        'limit': '-1',
         ...masterParameter
       }).then(res => {
         this.masterData = res.data.records;
@@ -932,12 +1006,13 @@
         this.KeySelectLIst = []
         this.$set(this.TreeAddform, 'codeKeyAttrRepeatOidName', this.KeyName)
         this.$set(this.TreeAddform, 'codeKeyAttrRepeatOid', this.KeyOid)
+        this.masterRow = null;
       }
     },
     //鍏抽敭灞炴�ф煡璇�
     KeySelectFindeHandler() {
       const masterParameter = {};
-      masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`;
+      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
       this.KeydefaultRend(masterParameter)
     },
     //鍏抽敭灞炴�ф帴鍙�
@@ -946,6 +1021,7 @@
         referType: 'codekeyattrrepeat',
         isMuti: 'false',
         'conditionMap["lcstatus"]': 'Enabled',
+        'limit': '-1',
         ...masterParameter
       }).then(res => {
         this.KeyData = res.data.records;
@@ -975,12 +1051,13 @@
         this.$set(this.TreeAddform, 'codeResembleRuleOidName', this.simName)
         this.$set(this.TreeAddform, 'codeResembleRuleOid', this.simOid)
         this.$emit('MasterHandler', this.loneTreeNewForm)
+        this.masterRow = null;
       }
     },
     //鐩镐技椤规煡璇�
     SimSelectFindeHandler() {
       const masterParameter = {};
-      masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`;
+      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
       this.simdefaultRend(masterParameter)
     },
     //  鐩镐技椤瑰閫�
@@ -996,6 +1073,7 @@
         referType: 'coderesemblerule',
         isMuti: 'false',
         'conditionMap["lcstatus"]': 'Enabled',
+        'limit': '-1',
         ...masterParameter
       }).then(res => {
         this.simData = res.data.records;
@@ -1013,18 +1091,20 @@
       } else if (this.btmSelectList.length <= 0) {
         this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
       } else {
+        this.$refs.myForm.clearValidate();
         this.BtmdialogVisible = false;
         this.btmSelectList = []
         this.$set(this.TreeAddform, 'btmTypeName', this.btmName)
         this.$set(this.TreeAddform, 'btmTypeId', this.btmOid)
         this.$emit('MasterHandler', this.loneTreeNewForm)
+        this.masterRow = null;
       }
     },
     //涓氬姟绫诲瀷鏌ヨ
     BtmSelectFindeHandler() {
       const masterParameter = {};
-      masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`;
-        this.btmdefaultRend(masterParameter);
+      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
+      this.btmdefaultRend(masterParameter);
     },
     //涓氬姟绫诲瀷澶氶��
     btmSelect(row) {
@@ -1035,7 +1115,7 @@
     },
     //涓氬姟绫诲瀷鎺ュ彛
     btmdefaultRend(masterParameter) {
-      referDataGrid({valueField: 'id', isMuti: 'false', ...masterParameter}).then(res => {
+      referDataGrid({valueField: 'id', isMuti: 'false', 'limit': '-1', ...masterParameter}).then(res => {
         this.BtmData = res.data.data.records
       })
     },
@@ -1052,27 +1132,33 @@
     },
     //鍒嗙被鏍戞暟鎹鐞�
     getAttr() {
-      getAtrrList().then(res => {
-        this.Treedata = res.data;
-        this.CloneTreedata = res.data;
-        this.Treedata.forEach(() => {
-          for (let i = 0; i < this.Treedata.length; i++) {
-            this.Treedata[i].value = i;
-          }
-        })
-        //璋冪敤淇敼灞炴�у悕鏂规硶
-        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)
-
-      })
+      this.loading = true;
+      return new Promise((resolve, reject) => {
+        getAtrrList()
+          .then(res => {
+            this.Treedata = res.data;
+            this.CloneTreedata = res.data;
+            this.Treedata.forEach(() => {
+              for (let i = 0; i < this.Treedata.length; i++) {
+                this.Treedata[i].value = i;
+              }
+            })
+            //璋冪敤淇敼灞炴�у悕鏂规硶
+            this.ModifyProperties(this.CloneTreedata, 'name', 'label');
+            this.CloneTreedata = this.CloneTreedata.map(item => {
+              if (item.attributes.lcStatus === "Disabled") {
+                item.label += '銆愬仠鐢ㄣ��';
+              }
+              return item;
+            });
+            this.loading = false;
+            resolve(); // 瀹屾垚璇锋眰锛岃皟鐢╮esolve鏂规硶
+          })
+          .catch(error => {
+            this.$message.error(error)
+            reject(error); // 璇锋眰鍑洪敊锛岃皟鐢╮eject鏂规硶
+          });
+      });
     },
     //瀹氫箟涓�涓慨鏀规暟鎹睘鎬у悕鐨勬柟娉�
     ModifyProperties(obj, oldName, newName) {
@@ -1107,40 +1193,43 @@
     },
     //鏍戣妭鐐瑰彇娑堜簨浠�
     TreeEscHandler() {
-      this.TreeAddform = {};
+      for (let key in this.TreeAddform) {
+        if (key !== 'codeKeyAttrValue' && key !== 'isParticipateCheck') {
+          this.TreeAddform[key] = "";
+        }
+      }
+      this.TreeAddform.codeKeyAttrValue = true;
+      this.TreeAddform.isParticipateCheck = 1;
       this.TreeAddFormVisible = false;
       // 鍏抽棴寮圭獥娓呯┖鏍¢獙
       this.$refs.myForm.clearValidate();
     },
     //鏍戣妭鐐规坊鍔犱簨浠�
-    TreeAddHandler() {
+    async TreeAddHandler() {
       if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) {
         this.$message.warning('璇疯緭鍏ュ唴瀹癸紒');
-      } else {
+        return;
+      }
+      try {
         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,
-            });
-          });
+        await TreeSave(data)
+        this.$message.success("娣诲姞鎴愬姛!");
+        Object.keys(this.TreeAddform).forEach(key => {
+          this.TreeAddform[key] = "";
+        });
+        this.TreeAddform.codeKeyAttrValue = true;
+        this.TreeAddform.isParticipateCheck = 1;
+        this.getAttr();
+        this.TreeAddFormVisible = false;
+        //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
+        this.ProData = [];
+        this.Formlist = [];
+      } catch (res) {
+        this.$message({
+          type: "warning",
+          message: res,
+        });
       }
     },
     //鏍戣妭鐐瑰垹闄ゆ寜閽�
@@ -1211,85 +1300,100 @@
       }
     },
     //鏍戝埛鏂�
-    flushed() {
-      this.loading = true
-      this.getAttr()
-      setTimeout(() => {
-        this.loading = false;
-        this.nodeClickList = ""
-      }, 600);
+    async flushed() {
+        await this.getAttr()
+        this.$refs.tree.setCurrentKey(null);
+        this.nodeClickList = {}
+        this.TreeList = []
+        this.TreeFlagCode = true;
     },
     //鍚敤鍜屽仠鐢ㄩ兘鍏堝垽鏂姸鎬�
     //鍚敤
-    Enable() {
+    async Enable() {
       if (Object.keys(this.nodeClickList).length < 1) {
-        this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�')
-      } else {
-        if (this.FlagObj.lcStatus == "Enabled") {
-          this.$message({
-            type: 'warning',
-            message: '褰撳墠鍒嗙被涓嶆槸鍋滅敤鐘舵��'
-          });
-        } else {
-          this.$confirm('鏄惁灏嗗瓙鍒嗙被涓�骞跺惎鐢紵', '鎻愮ず', {
-            confirmButtonText: '鏄�',
-            cancelButtonText: '鍙栨秷',
-            type: 'warning'
-          }).then(() => {
-            TreeEnable(this.nodeClickList).then(() => {
-              this.$message({
-                type: 'success',
-                message: '鍚敤鎴愬姛!'
-              });
-              this.getAttr()
-            })
-          }).catch(() => {
+        this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�');
+        return;
+      }
+      if (this.FlagObj.lcStatus == "Enabled") {
+        this.$message({
+          type: 'warning',
+          message: '褰撳墠鍒嗙被涓嶆槸鍋滅敤鐘舵��'
+        });
+        return;
+      }
+      this.loading = true;
+      try {
+        const confirmResult = await this.$confirm('鏄惁灏嗗瓙鍒嗙被涓�骞跺惎鐢紵', '鎻愮ず', {
+          confirmButtonText: '鏄�',
+          cancelButtonText: '鍙栨秷',
+          type: 'warning'
+        });
+        if (confirmResult) {
+          await TreeEnable(this.nodeClickList).then(res => {
             this.$message({
-              type: 'info',
-              message: '宸插彇娑堝惎鐢�'
+              type: 'success',
+              message: '鍚敤鎴愬姛!'
             });
+          })
+          await this.getAttr();
+
+        } else {
+          this.$message({
+            type: 'info',
+            message: '宸插彇娑堝惎鐢�'
           });
         }
+      } catch (error) {
+        console.error(error);
+      } finally {
+        this.loading = false;
       }
-
     },
-    //鍋滅敤
-    Deactivate() {
+
+    async Deactivate() {
       if (Object.keys(this.nodeClickList).length < 1) {
-        this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�')
-      } else {
-        if (this.FlagObj.lcStatus === "Disabled") {
-          this.$message({
-            type: 'warning',
-            message: '褰撳墠鍒嗙被涓嶆槸鍚敤鐘舵��!'
-          });
-        } else {
-          this.$confirm('鏄惁鍋滅敤褰撳墠鍒嗙被锛屽仠鐢ㄥ悗锛屽瓙鍒嗙被涔熷皢涓嶈兘琚娇鐢紝鏄惁缁х画锛�', '鎻愮ず', {
-            confirmButtonText: '纭畾',
-            cancelButtonText: '鍙栨秷',
-            type: 'warning'
-          }).then(() => {
-            TreeDeactivate(this.nodeClickList).then(() => {
-              this.$message({
-                type: 'success',
-                message: '鍋滅敤鎴愬姛!'
-              });
-              this.nodeClickList['flag'] = true;
-              this.getAttr()
-            })
-          }).catch(() => {
-            this.$message({
-              type: 'info',
-              message: '宸插彇娑堝仠鐢�'
-            });
-          });
-        }
+        this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�');
+        return;
       }
 
+      if (this.FlagObj.lcStatus === "Disabled") {
+        this.$message({
+          type: 'warning',
+          message: '褰撳墠鍒嗙被涓嶆槸鍚敤鐘舵��!'
+        });
+        return;
+      }
+
+      this.loading = true;
+      try {
+        const confirmResult = await this.$confirm('鏄惁鍋滅敤褰撳墠鍒嗙被锛屽仠鐢ㄥ悗锛屽瓙鍒嗙被涔熷皢涓嶈兘琚娇鐢紝鏄惁缁х画锛�', '鎻愮ず', {
+          confirmButtonText: '纭畾',
+          cancelButtonText: '鍙栨秷',
+          type: 'warning'
+        });
+        if (confirmResult) {
+          await TreeDeactivate(this.nodeClickList).then(res => {
+            this.$message({
+              type: 'success',
+              message: '鍋滅敤鎴愬姛!'
+            });
+          })
+          this.nodeClickList['flag'] = true;
+          await this.getAttr();
+        } else {
+          this.$message({
+            type: 'info',
+            message: '宸插彇娑堝仠鐢�'
+          });
+        }
+      } catch (error) {
+        console.error(error);
+      } finally {
+        this.loading = false;
+      }
     },
     //鏍戠偣鍑讳簨浠�
     async nodeClick(data) {
-      console.log(data);
       //鎿嶄綔鏂板鍜屼慨鏀圭殑涓氬姟绫诲瀷闅愯棌
       this.TreeFlagCode = !data;
       this.editTreeFLagCode = !data.parentId;
@@ -1320,6 +1424,10 @@
           this.crudOid = ''
         }
         this.TreeList = res3.data.data;
+        if (this.TreeList.isParticipateCheck === null || this.TreeList.isParticipateCheck === undefined || this.TreeList.isParticipateCheck === "") {
+          this.$set(this.TreeList, "isParticipateCheck", 1)
+          return
+        }
       } catch (error) {
         this.$message.error(error);
       }
@@ -1511,9 +1619,6 @@
       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) {
@@ -1608,7 +1713,7 @@
 }
 
 .el-aside {
-  height: calc(100% - 30px);
+  //height: calc(100% - 30px);
 }
 
 .el-main {
@@ -1634,6 +1739,3 @@
 }
 
 </style>
-/sa[pr
-[
-syulep

--
Gitblit v1.9.3