|
|
|
@ -29,14 +29,14 @@ |
|
|
|
@click="handleDelete" |
|
|
|
@click="handleDelete" |
|
|
|
>删 除 |
|
|
|
>删 除 |
|
|
|
</el-button> --> |
|
|
|
</el-button> --> |
|
|
|
<el-button |
|
|
|
<!-- <el-button |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
icon="el-icon-setting" |
|
|
|
icon="el-icon-setting" |
|
|
|
@click="handleRole" |
|
|
|
@click="handleRole" |
|
|
|
v-if="userInfo.role_name.includes('admin')" |
|
|
|
v-if="userInfo.role_name.includes('admin')" |
|
|
|
plain |
|
|
|
plain |
|
|
|
>权限设置 |
|
|
|
>权限设置 |
|
|
|
</el-button> |
|
|
|
</el-button> --> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template slot-scope="{ row }" slot="menu"> |
|
|
|
<template slot-scope="{ row }" slot="menu"> |
|
|
|
<el-button |
|
|
|
<el-button |
|
|
|
@ -126,6 +126,7 @@ export default { |
|
|
|
label: "title", |
|
|
|
label: "title", |
|
|
|
value: "key", |
|
|
|
value: "key", |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
currentRoleId: null, //当前点击的角色ID |
|
|
|
menuGrantList: [], |
|
|
|
menuGrantList: [], |
|
|
|
dataScopeGrantList: [], |
|
|
|
dataScopeGrantList: [], |
|
|
|
apiScopeGrantList: [], |
|
|
|
apiScopeGrantList: [], |
|
|
|
@ -334,8 +335,11 @@ export default { |
|
|
|
const menuList = this.$refs.treeMenu ? this.$refs.treeMenu.getCheckedKeys() : []; |
|
|
|
const menuList = this.$refs.treeMenu ? this.$refs.treeMenu.getCheckedKeys() : []; |
|
|
|
const dataScopeList = this.$refs.treeDataScope ? this.$refs.treeDataScope.getCheckedKeys() : []; |
|
|
|
const dataScopeList = this.$refs.treeDataScope ? this.$refs.treeDataScope.getCheckedKeys() : []; |
|
|
|
const apiScopeList = this.$refs.treeApiScope ? this.$refs.treeApiScope.getCheckedKeys() : []; |
|
|
|
const apiScopeList = this.$refs.treeApiScope ? this.$refs.treeApiScope.getCheckedKeys() : []; |
|
|
|
|
|
|
|
console.log(this.idsArray, "this.idsArray") |
|
|
|
|
|
|
|
console.log(this.selectionList, "this.idsArray") |
|
|
|
|
|
|
|
|
|
|
|
grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => { |
|
|
|
// 直接用当前角色ID提交,而不是数组 |
|
|
|
|
|
|
|
grant([this.currentRoleId], menuList, dataScopeList, apiScopeList).then(() => { |
|
|
|
this.box = false; |
|
|
|
this.box = false; |
|
|
|
this.$message({ |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
type: "success", |
|
|
|
@ -444,6 +448,7 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRowRole(row) { |
|
|
|
handleRowRole(row) { |
|
|
|
|
|
|
|
this.currentRoleId = row.id; // 保存当前行角色ID |
|
|
|
this.menuTreeObj = []; |
|
|
|
this.menuTreeObj = []; |
|
|
|
this.dataScopeTreeObj = []; |
|
|
|
this.dataScopeTreeObj = []; |
|
|
|
this.apiScopeTreeObj = []; |
|
|
|
this.apiScopeTreeObj = []; |
|
|
|
|