添加、创建相关api请求逻辑优化

This commit is contained in:
禺狨
2023-04-07 16:30:41 +08:00
parent 3fa0a50db8
commit 0339e6fcd3
8 changed files with 30 additions and 14 deletions

View File

@@ -24,7 +24,9 @@ export const DepartmentCreate: React.FC<PropInterface> = ({
const [parent_id, setParentId] = useState<number>(0);
useEffect(() => {
getParams();
if (open) {
getParams();
}
}, [open]);
useEffect(() => {

View File

@@ -27,7 +27,9 @@ export const DepartmentUpdate: React.FC<PropInterface> = ({
const [sort, setSort] = useState<number>(0);
useEffect(() => {
getParams();
if (open) {
getParams();
}
}, [open]);
const getParams = () => {