fix: 角色API、菜单、字段授权选择只返回叶子节点

避免记录父节点后,当前父节点下新增了叶子节点时,打开授权界面会显示全选叶子节点的情况,而实际新增的叶子节点没有授权
This commit is contained in:
写意 2025-04-09 22:36:29 +08:00
parent be614cc0bb
commit f52c855e7b
4 changed files with 4 additions and 4 deletions

View File

@ -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();
};

View File

@ -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();
};

View File

@ -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();
};

View File

@ -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;
};