From 5d24626495787fbff5974a7e7bd7048dfe0b0ea3 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 26 一月 2024 15:45:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue | 44 ++++++++++++++++++++++++++------------------
1 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
index 9a32e26..9ee7e77 100644
--- a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
@@ -99,6 +99,7 @@
export default {
name: "classifyAuthDialog.vue",
props: {
+ // 褰撳墠鐐瑰嚮鑺傜偣鐨勯《灞傝妭鐐�
classifyData: {
type: "Object",
default: "",
@@ -108,6 +109,10 @@
type: "Boolean",
default: false,
},
+ // 褰撳墠鐐瑰嚮鐨勮妭鐐�
+ TreeNode:{
+ type:Object
+ }
},
data() {
return {
@@ -131,7 +136,9 @@
},
computed: {},
mounted() {},
- created() {},
+ created() {
+ this.addIndex = this.classifyAuthData.length <= 0 ? 0 :this.classifyAuthData.length -1;
+ },
watch: {
// 鐩戝惉鐖剁粍浠朵紶鐨勭獥鍙f樉绀洪殣钘忕殑鍊�
visible() {
@@ -160,24 +167,26 @@
Object.keys(this.classifyAuthData[index]).forEach((key) => {
this.$set(this.classifyAuthData[index].authButton,item.code,true);
});
+
+ //娣诲姞 鈥滄煡鐪嬪叏閮ㄧ鐢ㄦ潯浠垛��
+ if (item.code === "classify_view") {
+ this.$set(this.classifyAuthData[index].authButton, "allDisabled", true);
+ console.log(this.classifyAuthData[index].authButton.allDisabled)
+ }
+
} else {
Object.keys(this.classifyAuthData[index]).forEach((key) => {
this.$set(this.classifyAuthData[index].authButton,item.code,false);
});
+
+ if(item.code === "classify_view"){
+ this.classifyAuthData[index].authButton.allDisabled = false;
+ }
}
}
});
});
- //娣诲姞 鈥滄煡鐪嬪叏閮ㄧ鐢ㄦ潯浠垛��
- if (this.classifyAuthData) {
- 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();
});
@@ -233,8 +242,7 @@
this.$message.warning("褰撳墠绉熸埛涓嶅瓨鍦ㄨ鑹蹭俊鎭紒");
return;
}
- // console.log('this.roleList', this.roleList)
- this.addIndex++; //鑷畾涔夌敓鎴愭坊鍔犺涓嬫爣
+
let item = {
roleData: this.roleList[0].id,
classifyItem: this.classifyData.label,
@@ -248,6 +256,7 @@
});
this.classifyAuthData.push(item);
this.roleHandlerMethods(this.roleList[0].id, "add", this.addIndex);
+ this.addIndex++; //鑷畾涔夌敓鎴愭坊鍔犺涓嬫爣
},
// 鍒犻櫎琛�
subClassifyAuth() {
@@ -278,7 +287,7 @@
let form = {
classifyAuthList: [],
isCLear: false, //榛樿鏄竻绌�
- classifyId: this.classifyData.oid,
+ classifyId: this.TreeNode.oid,
};
let isRepeat = false;
if(this.classifyAuthData.length > 0){
@@ -300,7 +309,7 @@
this.$message.warning("瑙掕壊鍜屽垎绫诲凡缁忓瓨鍦紝璇烽噸鏂伴厤缃紒");
return;
}
-
+
let flag = false;
this.classifyAuthData.forEach((item) => {
let itemButtonList = [];
@@ -319,7 +328,7 @@
let data = {
oid: item.oid,
roleId: item.roleData,
- classifyId: this.classifyData.oid,
+ classifyId: this.TreeNode.oid,
buttonIds: itemButtonList.join(","),
authType: "classify_auth",
};
@@ -407,7 +416,7 @@
});
// 鑾峰彇璇ュ垎绫讳笅宸叉巿鏉冪殑鍒嗙被鎺堟潈淇℃伅
getClassifyAuthList({
- classifyId: this.classifyData.oid,
+ classifyId: this.TreeNode.oid,
authType: "classify_auth",
}).then((res) => {
//console.log(res.data.data);
@@ -427,7 +436,6 @@
Vue.set(item, data, true);
});
this.classifyAuthData.push(item);
- this.addIndex = this.classifyAuthData.length - 1; //娣诲姞琛屼笅鏍囩瓑浜巆lassifyAuthData鐨勯暱搴�-1
this.roleHandlerMethods(authData.roleId, "create", index);
// console.log('index', index)
});
--
Gitblit v1.9.3