From 1de239fd89d33d074d0031f2d1363a211dce98f4 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期四, 05 十二月 2024 18:04:07 +0800 Subject: [PATCH] 表单增加参数,数据授权 --- Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue | 105 ++++++++++++++++++++++++++++++---------------------- 1 files changed, 61 insertions(+), 44 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..8a08f85 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=[]; @@ -467,6 +423,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 + }, }, methods: { //閫変腑鐢ㄦ埛 -- Gitblit v1.9.3