改成单行进行权限控制

master
wangmeng 3 months ago
parent ef71e3c027
commit 1cf46a7dba
  1. 11
      src/views/authority/role.vue

@ -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 = [];

Loading…
Cancel
Save