管理人员角色删除功能优化

This commit is contained in:
禺狨
2023-04-04 14:49:28 +08:00
parent 81e925794b
commit 64511b9cba
2 changed files with 14 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ interface Option {
interface PropInterface {
refresh: boolean;
roleDelSuccess: boolean;
type: string;
text: string;
onUpdate: (keys: any, title: any) => void;
@@ -20,6 +21,10 @@ export const TreeAdminroles = (props: PropInterface) => {
const [loading, setLoading] = useState<boolean>(true);
const [selectKey, setSelectKey] = useState<any>([]);
useEffect(() => {
onSelect([], "");
}, [props.roleDelSuccess]);
useEffect(() => {
adminRole.adminRoleList().then((res: any) => {
let adminrole = res.data;
@@ -34,9 +39,9 @@ export const TreeAdminroles = (props: PropInterface) => {
}
setTreeData(new_arr);
}
onSelect([], "");
});
}, [props.refresh]);
const onSelect = (selectedKeys: any, info: any) => {
let label = "全部" + props.text;
if (info) {