From a56c7f5fbe4b171a82561dce3b3b0ff6c5c30386 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 22 一月 2024 17:30:58 +0800
Subject: [PATCH] 可用字符集,前后缀,应用,可以用字符集接口下拉和正则接口提交

---
 Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue |   53 +++++++++++++++++++++++++++++++----------------------
 1 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue b/Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
index d4a3eec..334cab8 100644
--- a/Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
+++ b/Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
@@ -60,7 +60,7 @@
           <el-checkbox
             v-if="item.type === 'checkbox'"
             v-model="row[item.prop]"
-            :disabled="row.allDisabled ? true :row[item.code]">
+            :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]">
           </el-checkbox>
         </template>
       </el-table-column>
@@ -172,6 +172,7 @@
                   roleData: authData.roleId,
                   classifyItem: this.classifyData.label,
                   index: index,
+                  authButton:{},
                   uuid: uuidv4(),//鐢熸垚鍞竴鐨刬d
                 }
                 //灏嗘寜閽缃繘鍘�
@@ -179,7 +180,7 @@
                   Vue.set(item, data, true);
                 });
                 this.classifyAuthData.push(item);
-                this.addIndex = this.classifyAuthData.length - 1; //娣诲姞琛屼笅鏍囩瓑浜巆lassifyAuthData鐨勯暱搴�-1
+                this.addIndex = this.classifyAuthData.length - 1; //娣诲姞琛屼笅鏍囩瓑浜巆lassifyAuthData鐨勯暱搴�-1              
                 this.roleHandlerMethods(authData.roleId, 'create', index)
               })
             }
@@ -209,26 +210,33 @@
           !res.data.data.some(x => x.id === item.id)
         );
         //鍜岃〃鏍煎垪杩涜瀵规瘮
-        this.classifyAuthHeader.forEach(item => {
-          const isMatched = filteredItems.some(x => x.id === item.prop);
+        this.classifyAuthHeader.forEach((item) => {
+          const isMatched = filteredItems.some((x) => x.id === item.prop);
           this.$nextTick(() => {
-            if (this.classifyAuthData[index] && item.prop in this.classifyAuthData[index]) {
+            if (this.classifyAuthData[index]) {
               if (isMatched) {
-                this.$set(this.classifyAuthData[index], item.code, this.classifyAuthData[index].classify_view);
+                Object.keys(this.classifyAuthData[index]).forEach((key) => {
+                  this.$set(this.classifyAuthData[index].authButton,item.code,true);
+                });
               } else {
-                this.$set(this.classifyAuthData[index], item.code, false);
+                Object.keys(this.classifyAuthData[index]).forEach((key) => {
+                  this.$set(this.classifyAuthData[index].authButton,item.code,false);
+                });
               }
             }
           });
         });
+
         //娣诲姞鈥樻煡鐪嬧�欑鐢�
-        this.classifyAuthData.forEach((classkey, classIndex) => {
-          if (classkey.classify_view) {
-            this.$set(this.classifyAuthData[classIndex], 'allDisabled', true);
-          } else {
-            this.$set(this.classifyAuthData[classIndex], 'allDisabled', false);
-          }
-        });
+        if (this.classifyAuthData.authButton) {
+          this.classifyAuthData.forEach((classkey, classIndex) => {
+            if (classkey.authButton.classify_view) {
+              this.$set(this.classifyAuthData[classIndex].authButton,"allDisabled",true);
+            } else {
+              this.classifyAuthData[classIndex].authButton.allDisabled = false;
+            }
+          });
+        }
         //寮哄埗鍒锋柊琛ㄦ牸
         this.itemKey = uuidv4();
       });
@@ -248,17 +256,17 @@
           this.$nextTick(() => {
             if (currentRow) {
               if (isMatched) {
-                Object.keys(currentRow).forEach(key => {
-                  currentRow[item.code] = item.prop === key ? false : true;
-                  if (!currentRow.classify_view) {
-                    currentRow.allDisabled = false;
+                Object.keys(currentRow).forEach((key) => {
+                  currentRow.authButton[item.code] = true;
+                  if (!currentRow.authButton.classify_view) {
+                    currentRow.authButton.allDisabled = false;
                   }
                 });
               } else {
-                Object.keys(currentRow).forEach(key => {
-                  currentRow[item.code] = item.prop === key ? true : false;
-                  if (!currentRow.classify_view) {
-                    currentRow.allDisabled = false;
+                Object.keys(currentRow).forEach((key) => {
+                  currentRow.authButton[item.code] = false;
+                  if (!currentRow.authButton.classify_view) {
+                    currentRow.authButton.allDisabled = false;
                   }
                 });
               }
@@ -280,6 +288,7 @@
       let item = {
         roleData: this.roleList[0].id,
         classifyItem: this.classifyData.label,
+        authButton:{},
         uuid: uuidv4(),//鐢熸垚鍞竴鐨刬d,
         index: this.addIndex,
       }

--
Gitblit v1.9.3