From 4123ea005ce58731881c4b85d350b27e9f138760 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期四, 27 七月 2023 19:44:30 +0800
Subject: [PATCH] 主题库按钮权限

---
 Source/UBCS-WEB/src/components/Tree/attrCrud.vue |  170 +++++++++++++++++++++++++-------------------------------
 1 files changed, 76 insertions(+), 94 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
index 1dd85a5..5cfb2a4 100644
--- a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
+++ b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
@@ -3,33 +3,33 @@
     <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app">
       <el-button-group>
       <!--鏂板-->
-      <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && (!checkStatus || crudLCStatus=='Editing')" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">娣诲姞 {{ msg }}</el-button>
+      <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag &&  (!checkStatus || crudLCStatus=='Editing' )" size="small" type="primary" icon="el-icon-plus" plain @click="busineHandle">娣诲姞 {{ msg }}</el-button>
       <!--        鍏ㄥ睆缂栬緫-->
-      <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false && (!checkStatus || crudLCStatus=='Editing')" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">鍏ㄥ睆缂栬緫</el-button>
+      <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">鍏ㄥ睆缂栬緫</el-button>
       <!--        楠岃瘉瑙勫垯-->
-      <el-button v-if="!checkStatus || crudLCStatus=='Editing'" icon="el-icon-info" size="small" @click="ruleAddHandler">楠岃瘉瑙勫垯</el-button>
+      <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" @click="ruleAddHandler">楠岃瘉瑙勫垯</el-button>
       <!--        灞炴�у垎缁�-->
-      <el-button v-if="!checkStatus || crudLCStatus=='Editing'" icon="el-icon-menu" size="small" @click="attrVisibleHandle">灞炴�у垎缁�</el-button>
+      <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" @click="attrVisibleHandle">灞炴�у垎缁�</el-button>
       </el-button-group>
       <el-button-group>
         <!--鏂板-->
       <!--        鍒嗙被娉ㄥ叆-->
-      <el-button v-if="!checkStatus || crudLCStatus=='Editing'" icon="el-icon-magic-stick" size="small" @click="injectBtn">鍒嗙被娉ㄥ叆</el-button>
+      <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag"  icon="el-icon-magic-stick" size="small" @click="injectBtn">鍒嗙被娉ㄥ叆</el-button>
         <!--    缁勫悎瑙勫垯-->
-        <el-button v-if="!checkStatus || crudLCStatus=='Editing'" icon="el-icon-film" size="small" @click="isShowHandler">缁勫悎瑙勫垯</el-button>
+        <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-film" size="small" @click="isShowHandler">缁勫悎瑙勫垯</el-button>
       <!--        鏋氫妇娉ㄥ叆-->
-      <el-button v-if="!checkStatus || crudLCStatus=='Editing'" icon="el-icon-c-scale-to-original" size="small" @click="enmuVisHandle">鏋氫妇娉ㄥ叆</el-button>
+      <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-c-scale-to-original" size="small" @click="enmuVisHandle">鏋氫妇娉ㄥ叆</el-button>
       <!--    绾ц仈灞炴��-->
-      <el-button v-if="!checkStatus|| crudLCStatus=='Editing'" icon="el-icon-coin" size="small" @click="CascadeHandle">绾ц仈灞炴��</el-button>
+      <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" @click="CascadeHandle">绾ц仈灞炴��</el-button>
       </el-button-group>
       <el-button-group>
       <!--    棰勮鎺掑簭-->
         <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">棰勮鎺掑簭</el-button>
         <!--鏂板-->
       <!--    淇濆瓨-->
-      <el-button v-if="!checkStatus|| crudLCStatus=='Editing'" size="small" @click="addsHandler" icon="el-icon-check">淇濆瓨</el-button>
+      <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" @click="addsHandler" icon="el-icon-check">淇濆瓨</el-button>
       <!--    鍒犻櫎-->
-      <el-button v-if="!checkStatus || crudLCStatus=='Editing'" size="small" @click="CrudRemove" icon="el-icon-delete">鍒犻櫎</el-button>
+      <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" @click="CrudRemove" icon="el-icon-delete">鍒犻櫎</el-button>
       <!--    閲嶇疆-->
       <el-button size="small" @click="reset" icon="el-icon-refresh-right">閲嶇疆</el-button>
       </el-button-group>
@@ -41,8 +41,12 @@
       <el-button-group>
       <!--    缂栫爜鐢宠棰勮-->
       <el-button size="small" icon="el-icon-view" @click="applicationHandle" style="">缂栫爜鐢宠棰勮</el-button>
+
       </el-button-group>
-      <!--        楠岃瘉瑙勫垯-->
+      <!-- 鏄惁寮�鍚紪杈�     -->
+    <el-button-group>
+      <el-button size="small" plain  icon="el-icon-view"  v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag" @click="editOpen" >寮�鍚紪杈�</el-button>
+    </el-button-group>
     </div>
 <!--    寮圭獥-->
     <div>
@@ -285,7 +289,7 @@
             </el-option>
           </el-select>
           <el-switch
-            v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true"
+            v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" :disabled="!editOpenFlag"
             inactive-value="false">
           </el-switch>
           <span v-else>{{ row[item.prop] }}</span>
@@ -323,6 +327,10 @@
       default: ''
     },
     checkStatus:{
+      type: Boolean,
+      default: false
+    },
+    editOpenFlag:{
       type: Boolean,
       default: false
     },
@@ -372,36 +380,11 @@
       }
       return '';
     },
-    // ProData: {
-    //       handler(newVal, oldVal) {
-    //         if(this.initializing){
-    //           this.ProData = newVal.map((item) => {
-    //             if (item.classifyInvokeAttr !=='') { // 妫�鏌lassifyInvokeText灞炴�ф槸鍚﹀瓨鍦�
-    //               item = {
-    //                 ...item,
-    //                 classifyInvokeText: {
-    //                 classifyInvokeText: {
-    //                   "娉ㄥ叆绫诲瀷": item.classifyInvokeAttr,
-    //                   "娉ㄥ叆绫诲瀷鍚嶇О": item.classifyInvokeAttrName,
-    //                   "灞傜骇璁剧疆": item.classifyInvokeLevel,
-    //                   "鏄惁鍙慨鏀�": item.classifyInvokeEditFlag
-    //                 }
-    //               }
-    //             }
-    //             }
-    //             return item;
-    //           });
-    //         }
-    //         this.initializing = false;
-    //         console.log('ProData',this.ProData)
-    //         console.log('newVal',newVal)
-    //       },
-    //       deep: true,
-    //       immediate:true
-    //   },
+
   },
   data() {
     return {
+      //鏄惁寮�鍚紪杈�
       initializing:false,
       loading:false,
       referConfigText:"",
@@ -1609,50 +1592,52 @@
 
     //琛ㄦ牸琛岀紪杈�
     handleCellClicks(row, column) {
-        this.editingRows = row;
-        this.editShows = column.property;
-        this.rowOid = row.oid;
-      this.CurrentCell=row;
-      if(column.property == 'referConfig' ){
-        this.referConfigVisble= true;
-        this.referConfigOption = {
-          referConfig: this.referConfigText || '',
-        }
-        if(this.CurrentCell.referConfig == ''){
-          this.referConfigOption = {
-            referConfig:'',
-          }
-        }
-        console.log('--',this.referConfigOption)
-        // this.$refs.referConfigFormDialog.onloadAttrData();
-      }else if(column.property == 'classifyInvokeText'){
-        this.injectVisible=true;
-      }else if(column.property == 'componentRule'){
-        if(this.CurrentCell){
-          this.CurrentCell.componentRule=this.componentRuleText;
-        }
-        this.isShowformulaEdit = true;
-      }else if(column.property == 'enumString'){
-        this.enumVisible=true;
-        if(this.attrSelectList[0].enumString != ""){
-          this.tableData=JSON.parse(this.attrSelectList[0].enumString)
-          return
-        }
-      }else if(column.property == 'parentCode'){
-        gridCodeClassifyTemplateAttr({
-          'conditionMap[classifyTemplateOid]': this.Formlist[0].oid,
-          'conditionMap[oid_notequal]': this.CurrentCell.oid
-        }).then(res => {
-          console.log(res)
-          this.CascadeData = res.data.data;
-        })
-        this.CascadeVisible=true;
-      }else if(column.property == 'verifyRule'){
-        this.RulesForm.expressionTextt=this.CurrentCell.verifyRule;
-        this.rulesVisible=true;
-        console.log(this.CurrentCell.verifyRule)
-        console.log(this.RulesForm.expressionText)
-      }
+       if(this.editOpenFlag){
+         this.editingRows = row;
+         this.editShows = column.property;
+         this.rowOid = row.oid;
+         this.CurrentCell=row;
+         if(column.property == 'referConfig' ){
+           this.referConfigVisble= true;
+           this.referConfigOption = {
+             referConfig: this.referConfigText || '',
+           }
+           if(this.CurrentCell.referConfig == ''){
+             this.referConfigOption = {
+               referConfig:'',
+             }
+           }
+           console.log('--',this.referConfigOption)
+           // this.$refs.referConfigFormDialog.onloadAttrData();
+         }else if(column.property == 'classifyInvokeText'){
+           this.injectVisible=true;
+         }else if(column.property == 'componentRule'){
+           if(this.CurrentCell){
+             this.CurrentCell.componentRule=this.componentRuleText;
+           }
+           this.isShowformulaEdit = true;
+         }else if(column.property == 'enumString'){
+           this.enumVisible=true;
+           if(this.attrSelectList[0].enumString != ""){
+             this.tableData=JSON.parse(this.attrSelectList[0].enumString)
+             return
+           }
+         }else if(column.property == 'parentCode'){
+           gridCodeClassifyTemplateAttr({
+             'conditionMap[classifyTemplateOid]': this.Formlist[0].oid,
+             'conditionMap[oid_notequal]': this.CurrentCell.oid
+           }).then(res => {
+             console.log(res)
+             this.CascadeData = res.data.data;
+           })
+           this.CascadeVisible=true;
+         }else if(column.property == 'verifyRule'){
+           this.RulesForm.expressionTextt=this.CurrentCell.verifyRule;
+           this.rulesVisible=true;
+           console.log(this.CurrentCell.verifyRule)
+           console.log(this.RulesForm.expressionText)
+         }
+       }
     },
     saveRows() {
       this.editingRows = null;
@@ -1801,7 +1786,7 @@
         this.CurrentCell.classifyInvokeEditFlag=this.injectOption.classifyInvokeEditFlag,
         this.$set(this.CurrentCell, "classifyInvokeText", data);
         this.injectHandleReset()
-      }else {
+      }else {add
         //鍕鹃�夋搷浣�
         for (const key in this.injectOption) {
           this.attrSelectList[0][key] = this.injectOption[key];
@@ -1818,6 +1803,7 @@
       }else  {
         this.injectOption.classifyNumber=0;
       }
+      this.editOpenFlag=true
       this.injectVisible = false;
 
     },
@@ -1911,16 +1897,12 @@
     // 鎺掑簭
     sortChange(val) {
       console.log(val)
-      // switch (val.order) {
-      //   // case "ascending":
-      //   //   this.data = this.data.sort((a,b) => { return b['name'].localeCompare(a['name']) })
-      //   //   this.data = this.data.sort((a,b) => { return b['id'].localeCompare(a['id']) })
-      //   //   break;
-      //   // case "descending":
-      //   //   this.data = this.data.sort((a,b) => { return a['name'].localeCompare(b['name']) })
-      //   //   this.data = this.data.sort((a,b) => { return a['id'].localeCompare(b['id']) })
-      //   //   break;
-      // }
+    },
+    editOpen(){
+      this.editOpenFlag=true;
+      console.log('涓嶇瓑浜�',this.checkStatus)
+      console.log('绛変簬',this.editOpenFlag)
+      console.log('绛変簬',this.crudLCStatus)
     }
   }
 }

--
Gitblit v1.9.3