fix: 角色API、菜单、字段授权选择只返回叶子节点
避免记录父节点后,当前父节点下新增了叶子节点时,打开授权界面会显示全选叶子节点的情况,而实际新增的叶子节点没有授权
This commit is contained in:
parent
be614cc0bb
commit
f52c855e7b
@ -134,7 +134,7 @@ const cancel = () => {
|
||||
|
||||
// 授权角色接口资源
|
||||
const submit = async () => {
|
||||
state.ownApiList = treeRef.value?.getCheckedKeys() as Array<string>;
|
||||
state.ownApiList = treeRef.value?.getCheckedKeys(true) as Array<string>;
|
||||
await getAPI(SysRoleApi).apiSysRoleGrantApiPost({ id: state.roleId, apiList: state.ownApiList });
|
||||
cancel();
|
||||
};
|
||||
|
||||
@ -97,7 +97,7 @@ const cancel = () => {
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
state.menuIdList = treeRef.value?.getCheckedKeys() as Array<number>; //.concat(treeRef.value?.getHalfCheckedKeys());
|
||||
state.menuIdList = treeRef.value?.getCheckedKeys(true) as Array<number>; //.concat(treeRef.value?.getHalfCheckedKeys());
|
||||
await getAPI(SysRoleApi).apiSysRoleGrantMenuPost({ id: state.roleId, menuIdList: state.menuIdList });
|
||||
cancel();
|
||||
};
|
||||
|
||||
@ -87,7 +87,7 @@ const cancel = () => {
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
state.tableColumnList = treeRef.value?.getCheckedKeys() as Array<number>; //.concat(treeRef.value?.getHalfCheckedKeys());
|
||||
state.tableColumnList = treeRef.value?.getCheckedKeys(true) as Array<number>; //.concat(treeRef.value?.getHalfCheckedKeys());
|
||||
await getAPI(SysRoleApi).apiSysRoleGrantRoleTablePost({ id: state.roleId, tableColumnList: state.tableColumnList });
|
||||
cancel();
|
||||
};
|
||||
|
||||
@ -91,7 +91,7 @@ const cancel = () => {
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
state.ruleForm.menuIdList = treeRef.value?.getCheckedKeys() as Array<number>;
|
||||
state.ruleForm.menuIdList = treeRef.value?.getCheckedKeys(true) as Array<number>;
|
||||
await getAPI(SysTenantApi).apiSysTenantGrantMenuPost(state.ruleForm);
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user