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