|
|
@ -5,13 +5,13 @@
|
|
|
|
:visible.sync="isShow"
|
|
|
|
:visible.sync="isShow"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
width="470px"
|
|
|
|
width="470px"
|
|
|
|
@close="handleclose"
|
|
|
|
@close="hide"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="treeBoxList" v-loading="treeLoading">
|
|
|
|
<div class="treeBoxList" v-loading="treeLoading">
|
|
|
|
<el-checkbox-group v-model="checkedMenu">
|
|
|
|
<el-checkbox-group v-model="checkedMenu">
|
|
|
|
<el-checkbox
|
|
|
|
<el-checkbox
|
|
|
|
v-for="item in menuCheckOption"
|
|
|
|
v-for="item in menuCheckOption"
|
|
|
|
:label="item"
|
|
|
|
:label="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
>{{ item.desc }}</el-checkbox
|
|
|
|
>{{ item.desc }}</el-checkbox
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -38,8 +38,8 @@ export default {
|
|
|
|
treeLoading: false,
|
|
|
|
treeLoading: false,
|
|
|
|
rowData: "",
|
|
|
|
rowData: "",
|
|
|
|
menuList: [],
|
|
|
|
menuList: [],
|
|
|
|
checkedMenu: [],
|
|
|
|
checkedMenu: [], //选中的checkbox
|
|
|
|
menuCheckOption: [],
|
|
|
|
menuCheckOption: [], //checkbox列表
|
|
|
|
checkedIds: [], //权限返回的内容id
|
|
|
|
checkedIds: [], //权限返回的内容id
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -48,7 +48,9 @@ export default {
|
|
|
|
getdataform(val) {
|
|
|
|
getdataform(val) {
|
|
|
|
this.rowData = JSON.parse(JSON.stringify(val));
|
|
|
|
this.rowData = JSON.parse(JSON.stringify(val));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
//获取所有的菜单列表
|
|
|
|
getMenuList() {
|
|
|
|
getMenuList() {
|
|
|
|
|
|
|
|
this.treeLoading = true;
|
|
|
|
getMenuListApi()
|
|
|
|
getMenuListApi()
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
if (res.code == 200) {
|
|
|
|
if (res.code == 200) {
|
|
|
@ -61,6 +63,7 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((err) => {});
|
|
|
|
.catch((err) => {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
//获取角色的菜单权限
|
|
|
|
getRolePermission() {
|
|
|
|
getRolePermission() {
|
|
|
|
console.log(this.rowData);
|
|
|
|
console.log(this.rowData);
|
|
|
|
getRolePermissionApi({ id: this.rowData.id })
|
|
|
|
getRolePermissionApi({ id: this.rowData.id })
|
|
|
@ -69,6 +72,9 @@ export default {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
this.checkedIds = res.data;
|
|
|
|
this.checkedIds = res.data;
|
|
|
|
console.log(this.checkedIds);
|
|
|
|
console.log(this.checkedIds);
|
|
|
|
|
|
|
|
this.checkedMenu = this.checkedIds.map((obj) => obj.resourceId);
|
|
|
|
|
|
|
|
console.log("我时查询到的选中的值", this.checkedMenu);
|
|
|
|
|
|
|
|
this.treeLoading = false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -79,9 +85,10 @@ export default {
|
|
|
|
submitForm() {
|
|
|
|
submitForm() {
|
|
|
|
console.log(this.checkedMenu);
|
|
|
|
console.log(this.checkedMenu);
|
|
|
|
let paramsList = [];
|
|
|
|
let paramsList = [];
|
|
|
|
this.checkedMenu.forEach((node) => {
|
|
|
|
this.checkedMenu.map((id) => {
|
|
|
|
paramsList.push({ resourceId: node.id });
|
|
|
|
paramsList.push({ resourceId: id });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
//设置权限
|
|
|
|
getRolechangePermissionApi({
|
|
|
|
getRolechangePermissionApi({
|
|
|
|
list: paramsList,
|
|
|
|
list: paramsList,
|
|
|
|
roleId: this.rowData.id,
|
|
|
|
roleId: this.rowData.id,
|
|
|
@ -109,8 +116,8 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hide() {
|
|
|
|
hide() {
|
|
|
|
this.isShow = false;
|
|
|
|
this.isShow = false;
|
|
|
|
|
|
|
|
this.checkedMenu = [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleclose() {},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {},
|
|
|
|
mounted() {},
|
|
|
|
};
|
|
|
|
};
|
|
|
|