提交 b586bc38 作者: ZhangLingKun

Merge remote-tracking branch 'origin/develop' into develop

...@@ -57,10 +57,10 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({ ...@@ -57,10 +57,10 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
const [hasPid, setHasPid] = useState(false); //是否有上级目录 const [hasPid, setHasPid] = useState(false); //是否有上级目录
const [submitLoading, setSubmitLoading] = useState(false); //提交按钮的loading const [submitLoading, setSubmitLoading] = useState(false); //提交按钮的loading
const [directoryOptions, setDirectoryOptions] = useState([]); //目录options const [directoryOptions, setDirectoryOptions] = useState([]); //目录options
const id = editData?.id;
useEffect(() => { useEffect(() => {
if (isModalVisible) { if (isModalVisible) {
if (editData) {
form.setFieldValue('type', editData.type); form.setFieldValue('type', editData.type);
form.setFieldValue('pid', editData.pid); form.setFieldValue('pid', editData.pid);
form.setFieldValue('directoryName', editData.directoryName); form.setFieldValue('directoryName', editData.directoryName);
...@@ -72,6 +72,7 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({ ...@@ -72,6 +72,7 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
setHasPid(false); setHasPid(false);
} }
} }
}
}, [isModalVisible]); }, [isModalVisible]);
const onChangeType = (value) => { const onChangeType = (value) => {
...@@ -90,7 +91,7 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({ ...@@ -90,7 +91,7 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
try { try {
const res = await CategoryManageAPI.addOrEditDirectory({ const res = await CategoryManageAPI.addOrEditDirectory({
...values, ...values,
id, id: editData?.id,
pid: hasPid ? values.pid : null, pid: hasPid ? values.pid : null,
}); });
res.code == '200' && message.success('新增成功'); res.code == '200' && message.success('新增成功');
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论