提交 4e4abe41 作者: ZhangLingKun

功能:后台账号判断数据是否加载完成

上级 ef15c51d
...@@ -70,13 +70,16 @@ const AddEditModal: React.FC<propType> = (props) => { ...@@ -70,13 +70,16 @@ const AddEditModal: React.FC<propType> = (props) => {
useEffect(() => { useEffect(() => {
if (!open) return; if (!open) return;
getCompanyList().then(); getCompanyList().then();
// console.log('data --->', data);
}, [open]);
// 判断数据是否加载完成
useEffect(() => {
if (!data) return; if (!data) return;
form.setFieldsValue({ form.setFieldsValue({
...data, ...data,
companyId: companyList.find((i) => i.label === data.companyName)?.value || 1, companyId: companyList.find((i) => i.label === data.companyName)?.value || undefined,
}); });
// console.log('data --->', data); }, [companyList]);
}, [open]);
return ( return (
<Modal <Modal
open={open} open={open}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论