diff --git a/src/pages/Container/Notice/Add/index.js b/src/pages/Container/Notice/Add/index.js index cb1fec4..27db8c7 100644 --- a/src/pages/Container/Notice/Add/index.js +++ b/src/pages/Container/Notice/Add/index.js @@ -29,7 +29,8 @@ function Add(props) { // 监听分子公司选择变化,处理"全部"选项逻辑 const publishCorpinfoIdsValue = Form.useWatch("publishCorpinfoIds", form); useEffect(() => { - if (!publishCorpinfoIdsValue || publishCorpinfoIdsValue.length === 0) return; + if (!publishCorpinfoIdsValue || publishCorpinfoIdsValue.length === 0) + return; const hasAll = publishCorpinfoIdsValue.includes("ALL"); const hasOther = publishCorpinfoIdsValue.some(id => id !== "ALL"); @@ -60,7 +61,6 @@ function Add(props) { }, []); useEffect(() => { - console.log(props); props["corpInfoListAll"]({ inType: "0,1,6", eqUseFlag: 1 }).then((res) => { if (res.data) { console.log(res.data); @@ -77,13 +77,12 @@ function Add(props) { const onSubmit = async () => { // 防止重复提交 - if (submitting) return; setSubmitting(true); try { await form.validateFields(); // 触发表单校验 - } catch { - setSubmitting(false); + } + catch { return; // 阻止后续逻辑 } const values = await form.validateFields(); @@ -100,7 +99,8 @@ function Add(props) { .filter(item => item.bianma !== "ALL") .map(item => item.bianma); values.publishCorpinfoIds = allIds.join(","); - } else { + } + else { values.publishCorpinfoIds = values.publishCorpinfoIds.join(","); } } @@ -115,7 +115,8 @@ function Add(props) { }).finally(() => { setSubmitting(false); }); - } else { + } + else { props["noticeAdd"](values).then((res) => { if (res.success) { message.success("新增成功!"); @@ -205,4 +206,4 @@ function Add(props) { ); } -export default Connect([NS_NOTICE, NS_CORPINFO], true)(Add); \ No newline at end of file +export default Connect([NS_NOTICE, NS_CORPINFO], true)(Add);