From df81835dd02eee62527997adf5a4ea2039b51fa4 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 31 一月 2024 12:14:55 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue | 37 +++++++++++++++++++++---------------- 1 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue index 5a8e927..073e047 100644 --- a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue +++ b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue @@ -118,7 +118,7 @@ return { // 瀵硅瘽妗嗘樉绀烘帶鍒� isShowDialog: this.visible, - isLoading: false, + isLoading: true, tableHeight: "calc(100vh - 550px)", classifyAuthData: [], //鍒楀ご @@ -136,7 +136,9 @@ }, computed: {}, mounted() {}, - created() {}, + created() { + this.addIndex = this.classifyAuthData.length <= 0 ? 0 :this.classifyAuthData.length -1; + }, watch: { // 鐩戝惉鐖剁粍浠朵紶鐨勭獥鍙f樉绀洪殣钘忕殑鍊� visible() { @@ -165,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(); }); @@ -238,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, @@ -253,6 +256,7 @@ }); this.classifyAuthData.push(item); this.roleHandlerMethods(this.roleList[0].id, "add", this.addIndex); + this.addIndex++; //鑷畾涔夌敓鎴愭坊鍔犺涓嬫爣 }, // 鍒犻櫎琛� subClassifyAuth() { @@ -305,7 +309,7 @@ this.$message.warning("瑙掕壊鍜屽垎绫诲凡缁忓瓨鍦紝璇烽噸鏂伴厤缃紒"); return; } - + let flag = false; this.classifyAuthData.forEach((item) => { let itemButtonList = []; @@ -370,6 +374,7 @@ // 鍔犺浇鎺堟潈鍒楄〃 loadAuthPage() { return new Promise((resolve, reject) => { + this.isLoading = true; getButtonByParentCode({ code: "classifyTree" }) .then((res) => { // 璁板綍鎸夐挳鏁版嵁 @@ -432,12 +437,12 @@ 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) }); } }); + this.isLoading = false; }); }, }, -- Gitblit v1.9.3