mirror of
https://github.com/PlayEdu/backend
synced 2025-12-23 07:19:32 +08:00
管理人员角色删除功能优化
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user