Compare commits

..

3 Commits

Author SHA1 Message Date
tangjie e23f937749 Merge branch 'dev' of http://47.92.113.182:3000/cq_anquan/safety-eval-service-frontend into dev 2026-07-10 09:46:47 +08:00
tangjie ffd0d68cce fix 2026-07-10 09:46:46 +08:00
tangjie 7b697b099b fix 2026-07-10 09:28:43 +08:00
4 changed files with 25 additions and 10 deletions

View File

@ -10,7 +10,7 @@ module.exports = {
javaGitBranch: "dev",
// 本地联调 safetyEval-servicecontext-path: /safetyEval默认端口 8095
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
API_HOST: "http://192.168.0.152",
API_HOST: "http://192.168.0.103",
},
production: {
// 应用后端分支名称,部署上线需要

View File

@ -59,9 +59,17 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou
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 rules = accept.split(",").map((e) => e.trim().toLowerCase());
const ext = "." + file.name.split(".").pop().toLowerCase();
if (!exts.includes(ext)) {
const matchExt = rules.includes(ext);
const matchMime = rules.some((r) => {
if (r.endsWith("/*")) {
const prefix = r.slice(0, -1);
return file.type && file.type.toLowerCase().startsWith(prefix);
}
return false;
});
if (!matchExt && !matchMime) {
message.error(`仅支持 ${accept} 格式文件`);
return Upload.LIST_IGNORE;
}

View File

@ -116,6 +116,7 @@ function EquipInfoPage(props) {
label="设备名称"
placeholder="请输入"
allowClear
maxLength={30}
/>
</Form.Item>,
<Form.Item key="instrumentType" name="instrumentType">
@ -161,7 +162,7 @@ function EquipInfoPage(props) {
width: 200,
ellipsis: true,
},
{ title: "设备型号", dataIndex: "deviceModel" },
{ title: "设备型号", dataIndex: "deviceModel", ellipsis: true, },
{ title: "仪器类型", dataIndex: "instrumentTypeName" },
{ title: "设备类型", dataIndex: "deviceTypeName" },
{
@ -353,7 +354,7 @@ function EquipFormModal({
label="设备名称"
rules={[{ required: true, message: "请输入设备名称" }]}
>
<Input placeholder="请输入设备名称" />
<Input placeholder="请输入设备名称" maxLength={30} showCount />
</Form.Item>
</Col>
<Col span={12}>
@ -362,7 +363,7 @@ function EquipFormModal({
label="型号"
rules={[{ required: true, message: "请输入型号" }]}
>
<Input placeholder="请输入型号" />
<Input placeholder="请输入型号" maxLength={50} showCount />
</Form.Item>
</Col>
<Col span={12}>
@ -397,12 +398,12 @@ function EquipFormModal({
label="厂家"
rules={[{ required: true, message: "请输入厂家" }]}
>
<Input placeholder="请输入厂家" />
<Input placeholder="请输入厂家" maxLength={50} showCount />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="flowDesc" label="设备流量说明">
<Input placeholder="请输入设备流量说明" />
<Input placeholder="请输入设备流量说明" maxLength={100} showCount />
</Form.Item>
</Col>
<Col span={12}>
@ -431,7 +432,7 @@ function EquipFormModal({
</Col>
<Col span={12}>
<Form.Item name="calibrationUnit" label="校准单位">
<Input placeholder="请输入校准单位" />
<Input placeholder="请输入校准单位" maxLength={30} showCount />
</Form.Item>
</Col>
<Col span={12}>

View File

@ -349,7 +349,13 @@ const ExperManage = (props) => {
>
<Input placeholder="请输入" allowClear maxLength={20} />
</Form.Item>
<AttachmentUpload name="certificate" maxCount={1} label="证书" />
<AttachmentUpload
name="certificate"
label="证书"
maxCount={10}
accept="image/*,.pdf"
extra="支持上传图片和PDF文件最多10个"
/>
</Form>
</Modal>
</PageLayout>