From edd0231f6f9d69df75c52439c104e5126820ac4a Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 30 一月 2024 16:40:34 +0800 Subject: [PATCH] 分类授权数据授权,界面修改;业务类型修改表字段信息接口提示信息修改 --- Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue | 48 +++++++++++++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue index 9a32e26..073e047 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,12 +109,16 @@ type: "Boolean", default: false, }, + // 褰撳墠鐐瑰嚮鐨勮妭鐐� + TreeNode:{ + type:Object + } }, data() { return { // 瀵硅瘽妗嗘樉绀烘帶鍒� isShowDialog: this.visible, - isLoading: false, + isLoading: true, tableHeight: "calc(100vh - 550px)", classifyAuthData: [], //鍒楀ご @@ -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", }; @@ -365,6 +374,7 @@ // 鍔犺浇鎺堟潈鍒楄〃 loadAuthPage() { return new Promise((resolve, reject) => { + this.isLoading = true; getButtonByParentCode({ code: "classifyTree" }) .then((res) => { // 璁板綍鎸夐挳鏁版嵁 @@ -407,7 +417,7 @@ }); // 鑾峰彇璇ュ垎绫讳笅宸叉巿鏉冪殑鍒嗙被鎺堟潈淇℃伅 getClassifyAuthList({ - classifyId: this.classifyData.oid, + classifyId: this.TreeNode.oid, authType: "classify_auth", }).then((res) => { //console.log(res.data.data); @@ -427,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