diff --git a/jjb.config.js b/jjb.config.js index be646be..8c58ad4 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -10,7 +10,7 @@ module.exports = { javaGitBranch: "dev", // 本地联调 safetyEval-service(context-path: /safetyEval,默认端口 8095) // 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095 - API_HOST: "http://127.0.0.1", + API_HOST: "http://192.168.0.152", }, production: { // 应用后端分支名称,部署上线需要 diff --git a/src/components/AttachmentUpload/index.js b/src/components/AttachmentUpload/index.js index ba0c2dc..a3da783 100644 --- a/src/components/AttachmentUpload/index.js +++ b/src/components/AttachmentUpload/index.js @@ -1,10 +1,10 @@ -import { Form, Image, Upload } from "antd"; +import { Form, Image, Upload, message } from "antd"; import { useState } from "react"; import { PlusOutlined } from "@ant-design/icons"; const isImage = (url) => /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(url || ""); -export default function AttachmentUpload({ name, label, disabled = false, maxCount, accept }) { +export default function AttachmentUpload({ name, label, disabled = false, maxCount, accept, extra }) { const [previewImage, setPreviewImage] = useState(""); return ( @@ -12,6 +12,7 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou { if (Array.isArray(value)) { @@ -56,6 +57,16 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou maxCount={maxCount} accept={accept} action={`${window.process.env.app.API_HOST}/safetyEval/file/upload`} + beforeUpload={(file) => { + if (!accept) return true; + const exts = accept.split(",").map((e) => e.trim().toLowerCase()); + const ext = "." + file.name.split(".").pop().toLowerCase(); + if (!exts.includes(ext)) { + message.error(`仅支持 ${accept} 格式文件`); + return Upload.LIST_IGNORE; + } + return true; + }} onPreview={(file) => { if (isImage(file.url || file.thumbUrl)) { setPreviewImage(file.url || file.thumbUrl); diff --git a/src/pages/Container/QualApplication/FilingForm/components/BasicInfoStep.jsx b/src/pages/Container/QualApplication/FilingForm/components/BasicInfoStep.jsx index 00ffa23..e6be10a 100644 --- a/src/pages/Container/QualApplication/FilingForm/components/BasicInfoStep.jsx +++ b/src/pages/Container/QualApplication/FilingForm/components/BasicInfoStep.jsx @@ -130,6 +130,8 @@ export default function BasicInfoStep({ form, disabled }) { name="attachmentUrl" label="上传附件" disabled={disabled} + maxCount={12} + accept=".pdf,.doc,.docx" /> diff --git a/src/pages/Container/QualApplication/FilingForm/components/CommitmentStep.jsx b/src/pages/Container/QualApplication/FilingForm/components/CommitmentStep.jsx index 58a224d..7f74fe6 100644 --- a/src/pages/Container/QualApplication/FilingForm/components/CommitmentStep.jsx +++ b/src/pages/Container/QualApplication/FilingForm/components/CommitmentStep.jsx @@ -121,6 +121,7 @@ export default function CommitmentStep({