tree组件拖动编辑优化

This commit is contained in:
禺狨 2023-03-21 11:22:49 +08:00
parent c84ceee624
commit f7c11d2cf4
2 changed files with 8 additions and 14 deletions

View File

@ -30,13 +30,6 @@ export const DepartmentUpdate: React.FC<PropInterface> = ({
getParams(); getParams();
}, [open]); }, [open]);
useEffect(() => {
if (id === 0) {
return;
}
getDetail();
}, [id]);
const getParams = () => { const getParams = () => {
department.createDepartment().then((res: any) => { department.createDepartment().then((res: any) => {
const departments = res.data.departments; const departments = res.data.departments;
@ -48,6 +41,10 @@ export const DepartmentUpdate: React.FC<PropInterface> = ({
}); });
setDepartments(new_arr); setDepartments(new_arr);
} }
if (id === 0) {
return;
}
getDetail();
}); });
}; };

View File

@ -30,13 +30,6 @@ export const ResourceCategoryUpdate: React.FC<PropInterface> = ({
getParams(); getParams();
}, [open]); }, [open]);
useEffect(() => {
if (id === 0) {
return;
}
getDetail();
}, [id]);
const getParams = () => { const getParams = () => {
resourceCategory.createResourceCategory().then((res: any) => { resourceCategory.createResourceCategory().then((res: any) => {
const categories = res.data.categories; const categories = res.data.categories;
@ -48,6 +41,10 @@ export const ResourceCategoryUpdate: React.FC<PropInterface> = ({
}); });
setCategories(new_arr); setCategories(new_arr);
} }
if (id === 0) {
return;
}
getDetail();
}); });
}; };