From e358d69fc18870584dd2d9f531910b7838ea27d9 Mon Sep 17 00:00:00 2001 From: wangting <wangting@vci-tech.com> Date: 星期四, 02 一月 2025 09:58:53 +0800 Subject: [PATCH] 调整行点击后的回调 --- Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue | 115 ++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 69 insertions(+), 46 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue index 49865da..0b7cd81 100644 --- a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue +++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue @@ -405,53 +405,9 @@ departmentQueryController({queryAllLevel: true}).then(res => { const data = res.data.treeData; this.departData = this.departDtaFormAtter(data); - }).catch(err => { - this.$message.error(err); }) }, watch: { - selectRow:{ - handler(val,oldval) { - this.authData=[]; - if(val && val.rules){ - this.form=JSON.parse(JSON.stringify(val.rules)); - //this.getTemp(true); - //this.getTemp(false) - //鏋勫缓鎺堟潈涓讳綋鏁版嵁 - if(val.rules.users){ - val.rules.users.split(',').forEach((item,i)=>{ - if(item){ - this.authData.push({ - name:'{'+item+', '+item+', user}' - }) - } - }) - } - if(val.rules.roles){ - val.rules.roles.split(',').forEach((item,i)=>{ - if(item){ - this.authData.push({ - name:'{'+item+', '+item+', role}' - }) - } - }) - } - if(val.rules.userGroups){ - val.rules.userGroups.split(',').forEach((item,i)=>{ - if(item){ - this.authData.push({ - name:'{'+item+', '+item+', userGroup}' - }) - } - }) - } - }else { - this.form={}; - } - }, - immediate: true, - deep: true - }, actionMap:{ handler(val) { this.actionDic=[]; @@ -463,6 +419,67 @@ }) } }; + }, + immediate: true, + deep: true + }, + selectRow:{ + handler(val,oldval) { + this.authData=[]; + if(val && val.rules &&val.rules.length>0) { + this.form = JSON.parse(JSON.stringify(val.rules[0])); + //this.getTemp(true); + //this.getTemp(false) + //鏋勫缓鎺堟潈涓讳綋鏁版嵁 + if (val.rules[0].users) { + val.rules[0].users.split(',').forEach((item, i) => { + if (item) { + this.authData.push({ + name: '{' + item + ', ' + item + ', user}' + }) + } + }) + } + if (val.rules[0].roles) { + val.rules[0].roles.split(',').forEach((item, i) => { + if (item) { + this.authData.push({ + name: '{' + item + ', ' + item + ', role}' + }) + } + }) + } + if (val.rules[0].userGroups) { + val.rules[0].userGroups.split(',').forEach((item, i) => { + if (item) { + this.authData.push({ + name: '{' + item + ', ' + item + ', userGroup}' + }) + } + }) + } + //瑙f瀽鎿嶄綔鎸夐挳閫変腑鍊� + if (this.actionDic.length > 0) { + let actionDicStr = JSON.stringify(this.actionDic); + val.rules.forEach(item => { + if (item.isGrand == 49) { + let identifier = item.identifier.replace(this.btmNode.attributes.name + '_', '') + if (actionDicStr.indexOf('"value":"'+identifier+'"}') != -1) { + this.actionForm.push(identifier) + } else { + this.linkactionForm.push(identifier); + } + } + }) + } + }else { + this.form={ + ruleName:'', + ruleType:'0' + }; + this.actionForm=[]; + this.linkactionForm=[]; + } }, immediate: true, deep: true @@ -544,8 +561,12 @@ row, this.$refs.departCrud, this.lastIndex, - (newIndex) => { this.lastIndex = newIndex; }, - () => { this.departCurrenRows = [row]; } + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.departCurrenRows = [row]; + } ); }, // 閫夋嫨閮ㄩ棬 纭畾 @@ -753,6 +774,7 @@ ::v-deep { .el-radio ,.el-checkbox{ margin-right: 30px; + margin-bottom: 10px; } } div{ @@ -762,5 +784,6 @@ padding: 10px 6px; margin: 0; border: 1px solid #EBEEF5; + overflow: auto; } </style> -- Gitblit v1.9.3