dev_1.0.1
tangjie 2026-06-30 17:43:05 +08:00
parent 60b375f998
commit 9d40688f4e
4 changed files with 107 additions and 28 deletions

View File

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

View File

@ -4,6 +4,7 @@ import {
Col,
DatePicker,
Form,
Image,
Input,
InputNumber,
message,
@ -12,6 +13,8 @@ import {
Space,
Upload,
} from "antd";
import { PlusOutlined } from "@ant-design/icons";
import dayjs from "dayjs";
import { useEffect, useState } from "react";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
@ -41,6 +44,7 @@ function OrgInfoPage(props) {
const [editing, setEditing] = useState(true);
const [submitting, setSubmitting] = useState(false);
const [detail, setDetail] = useState({});
const [previewImage, setPreviewImage] = useState("");
/** 是否已存在机构数据(有 id 视为已入库,只能修改) */
const [hasExistingData, setHasExistingData] = useState(false);
@ -59,7 +63,6 @@ function OrgInfoPage(props) {
productionDate: res.data.productionDate
? dayjs(res.data.productionDate)
: undefined,
});
setHasExistingData(true);
setEditing(false);
@ -145,24 +148,22 @@ function OrgInfoPage(props) {
}
};
const subTitleText =
"新成立或首次使用系统的安全评价机构,可通过系统提供的引导页面,详细填写机构的基本信息。";
return (
<PageLayout
title="机构信息管理"
extra={
hasExistingData &&
!editing && (
<Button type="primary" loading={orgInfoLoading} onClick={() => setEditing(true)}>
<Button
type="primary"
loading={orgInfoLoading}
onClick={() => setEditing(true)}
>
修改
</Button>
)
}
>
<p style={{ margin: 0, marginBottom: 24, color: "rgba(0, 0, 0, 0.45)" }}>
{subTitleText}
</p>
<Form form={form} labelCol={{ span: 10 }} disabled={!editing}>
<Row gutter={[16, 16]}>
<Col span={12}>
@ -200,7 +201,11 @@ function OrgInfoPage(props) {
label="属地"
rules={[{ required: true, message: "请选择属地" }]}
>
<Select options={selectDistrictOptions} placeholder="请选择属地" allowClear />
<Select
options={selectDistrictOptions}
placeholder="请选择属地"
allowClear
/>
</Form.Item>
</Col>
<Col span={12}>
@ -325,7 +330,10 @@ function OrgInfoPage(props) {
label="安全管理部门负责人联系电话"
rules={[phoneRule("安全管理部门负责人联系电话", false)]}
>
<Input placeholder="请输入安全管理部门负责人联系电话" allowClear />
<Input
placeholder="请输入安全管理部门负责人联系电话"
allowClear
/>
</Form.Item>
</Col>
<Col span={12}>
@ -344,7 +352,10 @@ function OrgInfoPage(props) {
</Col>
<Col span={12}>
<Form.Item name="productionDate" label="投产日期">
<DatePicker style={{ width: "100%" }} placeholder="请选择投产日期" />
<DatePicker
style={{ width: "100%" }}
placeholder="请选择投产日期"
/>
</Form.Item>
</Col>
<Col span={12}>
@ -367,7 +378,12 @@ function OrgInfoPage(props) {
label="工作场所建筑面积"
rules={[positiveNumberRule("工作场所建筑面积", false)]}
>
<InputNumber style={{ width: "100%" }} min={0} precision={2} placeholder="请输入工作场所建筑面积" />
<InputNumber
style={{ width: "100%" }}
min={0}
precision={2}
placeholder="请输入工作场所建筑面积"
/>
</Form.Item>
</Col>
<Col span={12}>
@ -376,7 +392,12 @@ function OrgInfoPage(props) {
label="档案室面积"
rules={[positiveNumberRule("档案室面积", false)]}
>
<InputNumber style={{ width: "100%" }} min={0} precision={2} placeholder="请输入档案室面积" />
<InputNumber
style={{ width: "100%" }}
min={0}
precision={2}
placeholder="请输入档案室面积"
/>
</Form.Item>
</Col>
<Col span={12}>
@ -385,7 +406,12 @@ function OrgInfoPage(props) {
label="专职安全评价师数量"
rules={[nonNegativeIntegerRule("专职安全评价师数量", false)]}
>
<InputNumber style={{ width: "100%" }} min={0} precision={0} placeholder="请输入专职安全评价师数量" />
<InputNumber
style={{ width: "100%" }}
min={0}
precision={0}
placeholder="请输入专职安全评价师数量"
/>
</Form.Item>
</Col>
<Col span={12}>
@ -394,27 +420,48 @@ function OrgInfoPage(props) {
label="注册安全工程师数量"
rules={[nonNegativeIntegerRule("注册安全工程师数量", false)]}
>
<InputNumber style={{ width: "100%" }} min={0} precision={0} placeholder="请输入注册安全工程师数量" />
<InputNumber
style={{ width: "100%" }}
min={0}
precision={0}
placeholder="请输入注册安全工程师数量"
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="enterpriseStatus" label="企业状态">
<Select options={ENTERPRISE_STATUS_OPTIONS} placeholder="请选择企业状态" allowClear />
<Select
options={ENTERPRISE_STATUS_OPTIONS}
placeholder="请选择企业状态"
allowClear
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="enterpriseScale" label="企业规模">
<Select options={ENTERPRISE_SCALE_OPTIONS} placeholder="请选择企业规模" allowClear />
<Select
options={ENTERPRISE_SCALE_OPTIONS}
placeholder="请选择企业规模"
allowClear
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="filingType" label="备案类型">
<Select options={FILING_TYPE_OPTIONS} placeholder="请选择备案类型" allowClear />
<Select
options={FILING_TYPE_OPTIONS}
placeholder="请选择备案类型"
allowClear
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="filingRecordStatus" label="备案状态">
<Select options={FILING_RECORD_STATUS_OPTIONS} placeholder="请选择备案状态" allowClear />
<Select
options={FILING_RECORD_STATUS_OPTIONS}
placeholder="请选择备案状态"
allowClear
/>
</Form.Item>
</Col>
<Col span={12}>
@ -422,9 +469,35 @@ function OrgInfoPage(props) {
name="attachments"
label="上传附件"
valuePropName="fileList"
getValueFromEvent={({ fileList }) => {
return (
fileList?.map((file) => {
return {
url: file.response?.data.url || file.url,
uid: file.uid,
name: file.name,
};
}) || []
);
}}
>
<Upload maxCount={5} listType="picture-card">
<Button>上传附件</Button>
<Upload
maxCount={5}
onPreview={(file) => {
const isImage = /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(file.name || file.url || "");
if (isImage) {
setPreviewImage(file.url || file.thumbUrl);
} else {
window.open(file.url || file.thumbUrl);
}
}}
listType="picture-card"
action={`${window.process.env.app.API_HOST}/safety-eval/file/upload`}
>
<button style={{ border: 0, background: "none" }} type="button">
<PlusOutlined />
<div style={{ marginTop: 8 }}>上传附件</div>
</button>
</Upload>
</Form.Item>
</Col>
@ -449,6 +522,16 @@ function OrgInfoPage(props) {
</Space>
</div>
)}
<Image
style={{ display: "none" }}
preview={{
visible: !!previewImage,
src: previewImage,
onVisibleChange: (visible) => {
if (!visible) setPreviewImage("");
},
}}
/>
</PageLayout>
);
}

View File

@ -1,8 +1,6 @@
function PersonnelInfo(props) {
return (
<div>
{props.children}
</div>
props.children
);
}

View File

@ -2,8 +2,6 @@ import React from "react";
export default (props)=>{
return (
<div style={{height: "100%"}}>
{props.children}
</div>
props.children
)
}