|
|
|
@ -148,7 +148,7 @@ export default { |
|
|
|
|
getPer(){ |
|
|
|
|
if(!this.permissions.length){ |
|
|
|
|
this.$get(`${this.api.queryAllMenus}?platformId=${Setting.platformId}`).then(res => { |
|
|
|
|
this.permissions = res.children[0].children |
|
|
|
|
this.permissions = res.children |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -166,7 +166,7 @@ export default { |
|
|
|
|
permissions.map(e => { |
|
|
|
|
if(result.includes(e.id) && e.children.length){ |
|
|
|
|
// 如果该权限下的子权限不是每个都勾选了,就把该权限的id从已勾选的id集合里去除,因为如果不去除的话,这个权限就会勾选,同时会把该权限下的所有子权限都一起勾选 |
|
|
|
|
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id),1) |
|
|
|
|
e.children.every(n => result.includes(n.id)) || result.splice(result.indexOf(e.id),1) |
|
|
|
|
} |
|
|
|
|
e.children.length && this.handleRolePer(data,e.children) |
|
|
|
|
}) |
|
|
|
@ -175,11 +175,13 @@ export default { |
|
|
|
|
}, |
|
|
|
|
async getDetail(row){ |
|
|
|
|
this.getPer() |
|
|
|
|
this.$get(`${this.api.getRole}?id=${row.id}`).then(res => { |
|
|
|
|
this.form = res.role |
|
|
|
|
this.checkedIds = this.handleRolePer(res.permissionList,this.permissions) |
|
|
|
|
this.$refs.per.setCheckedNodes(this.checkedIds) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.$get(`${this.api.getRole}?id=${row.id}`).then(res => { |
|
|
|
|
this.form = res.role |
|
|
|
|
this.checkedIds = this.handleRolePer(res.permissionList,this.permissions) |
|
|
|
|
this.$refs.per.setCheckedNodes(this.checkedIds) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, 100) |
|
|
|
|
}, |
|
|
|
|
showRole(row){ |
|
|
|
|
this.isDetail = true |
|
|
|
|