From 296f034c06ca8542b39878f860ffa5b909914338 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 18 一月 2024 22:29:53 +0800 Subject: [PATCH] 数据授权查询接口更改 --- Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue | 49 ++++++++++++++++++++++++++++++++++--------------- 1 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue index 902cabf..d161011 100644 --- a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue +++ b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue @@ -113,6 +113,11 @@ currentRow: {} }; }, + computed: {}, + mounted() { + }, + created() { + }, watch: { // 鐩戝惉鐖剁粍浠朵紶鐨勭獥鍙f樉绀洪殣钘忕殑鍊� visible() { @@ -176,19 +181,14 @@ }); this.classifyAuthData.push(item); this.addIndex = this.classifyAuthData.length - 1; //娣诲姞琛屼笅鏍囩瓑浜巆lassifyAuthData鐨勯暱搴�-1 - this.roleHandlerMethods(authData.roleId, 'create', this.addIndex) + this.roleHandlerMethods(authData.roleId, 'create', index) + // console.log('index', index) }) } }); - console.log('created', this.classifyAuthData) }); } }, - }, - computed: {}, - mounted() { - }, - created() { }, methods: { roleHandlerMethods(id, type, index) { @@ -201,16 +201,33 @@ const filteredItems = this.classifyAuthButton.filter(item => { return !res.data.data.find(x => x.id === item.id); }); - + // console.log('绂佺敤鎸夐挳',filteredItems) + // console.log('涓嶇鐢ㄦ寜閽�',res.data.data) //鎷胯〃鏍煎垪澶村惊鐜拰娌℃湁瀵瑰簲鐨勫睘鎬ц繘琛屾瘮杈� this.classifyAuthHeader.forEach((item) => { - if (filteredItems.some(x => x.id === item.prop)) { + const isMatched = filteredItems.some(x => x.id === item.prop); + if (isMatched) { this.$nextTick(() => { - if (this.classifyAuthData[index] !== undefined && this.classifyAuthData[index] !== null) { + if (this.classifyAuthData[index]) { + Object.keys(this.classifyAuthData[index]).forEach((key) => { + + if (this.classifyAuthData[index].classify_view) { + this.$set(this.classifyAuthData[index], item.code, true); + } else { + this.classifyAuthData[index][item.code] = false; + } + // console.log(item.code) + // this.$set(this.classifyAuthData[index], item.code, true); + + }); + } + }) + } else { + this.$nextTick(() => { + if (this.classifyAuthData[index]) { Object.keys(this.classifyAuthData[index]).forEach((key) => { if (item.prop === key) { - // this.classifyAuthData[index] = Object.assign({}, this.classifyAuthData[index], {[key]: undefined}); - this.$set(this.classifyAuthData[index], item.code, true); + this.$set(this.classifyAuthData[index], item.code, false); } }); } @@ -222,9 +239,11 @@ this.classifyAuthData.forEach((classkey, classIndex) => { if (classkey.classify_view) { this.$set(this.classifyAuthData[classIndex], 'allDisabled', true) + } else { + this.classifyAuthData[classIndex].allDisabled = false; } }); - + // console.log('classifyAuthData',this.classifyAuthData) //寮哄埗鍒锋柊琛ㄦ牸 this.itemKey = uuidv4(); }) @@ -276,7 +295,7 @@ this.$message.warning("褰撳墠绉熸埛涓嶅瓨鍦ㄨ鑹蹭俊鎭紒"); return; } - console.log('this.roleList', this.roleList) + // console.log('this.roleList', this.roleList) this.addIndex++; //鑷畾涔夌敓鎴愭坊鍔犺涓嬫爣 let item = { roleData: this.roleList[0].id, @@ -288,7 +307,6 @@ this.classifyAuthButton.forEach(data => { Vue.set(item, data.id, false); }) - //console.log(item) this.classifyAuthData.push(item); this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex) }, @@ -359,6 +377,7 @@ roleId: item.roleData, classifyId: this.classifyData.oid, buttonIds: itemButtonList.join(","), + authType: "classify_auth", } form.push(data); }); -- Gitblit v1.9.3