feat
parent
d850e828a3
commit
1be6126075
|
|
@ -0,0 +1,43 @@
|
|||
import { Button, Upload } from "antd";
|
||||
import { useState } from "react";
|
||||
|
||||
/**
|
||||
* 上传按钮组件
|
||||
* @param {Object} props
|
||||
* @param {string} [props.action] - 上传地址,默认从环境变量获取
|
||||
* @param {function} [props.onSuccess] - 上传成功回调 (response) => void
|
||||
* @param {Object} [props.uploadProps] - 透传给 antd Upload 的其他属性
|
||||
* @param {string} [props.children] - 按钮文字,默认"上传"
|
||||
* @param {Object} [props.buttonProps] - 透传给 antd Button 的其他属性
|
||||
*/
|
||||
export default function UploadButton({
|
||||
action = `${window.process.env.app.API_HOST}/safetyEval/file/upload`,
|
||||
onSuccess,
|
||||
uploadProps,
|
||||
children = "上传",
|
||||
buttonProps,
|
||||
}) {
|
||||
const [uploading, setUploading] = useState(false);
|
||||
|
||||
return (
|
||||
<Upload
|
||||
showUploadList={false}
|
||||
action={action}
|
||||
onChange={(info) => {
|
||||
if (info.file.status === "uploading") {
|
||||
setUploading(true);
|
||||
} else if (info.file.status === "done") {
|
||||
setUploading(false);
|
||||
onSuccess?.(info.file.response?.data, info.file);
|
||||
} else if (info.file.status === "error") {
|
||||
setUploading(false);
|
||||
}
|
||||
}}
|
||||
{...uploadProps}
|
||||
>
|
||||
<Button type="link" size="small" loading={uploading} {...buttonProps}>
|
||||
{children}
|
||||
</Button>
|
||||
</Upload>
|
||||
);
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ function saveState(tabs, activeKey) {
|
|||
sessionStorage.setItem(ACTIVE_KEY, activeKey || "");
|
||||
}
|
||||
|
||||
export default function SimulatedLayout({ children }) {
|
||||
export default function SimulatedLayout({ children, history }) {
|
||||
const [collapsed, setCollapsed] = useState(false);
|
||||
const [state, setState] = useState(loadState);
|
||||
const currentPath = window.location.pathname;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from "react";
|
||||
import React from "react";
|
||||
import {
|
||||
DashboardOutlined,
|
||||
FileProtectOutlined,
|
||||
|
|
@ -29,6 +29,16 @@ const menuItems = [
|
|||
label: "监管端",
|
||||
icon: <DashboardOutlined />,
|
||||
children: [
|
||||
{
|
||||
key: "/safetyEval/container/Supervision/Dashboard",
|
||||
label: "机构端首页",
|
||||
icon: <DashboardOutlined />,
|
||||
},
|
||||
{
|
||||
key: "/safetyEval/container/Supervision/Cockpit",
|
||||
label: "监管端首页",
|
||||
icon: <PieChartOutlined />,
|
||||
},
|
||||
{
|
||||
key: "/safetyEval/container/Supervision/BasicInfo",
|
||||
label: "基础信息管理",
|
||||
|
|
|
|||
|
|
@ -82,7 +82,11 @@ export default function BasicInfoStep({ form, disabled }) {
|
|||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="fixedAssetAmount" label="固定资产总值(万元)">
|
||||
<Form.Item
|
||||
name="fixedAssetAmount"
|
||||
label="固定资产总值(万元)"
|
||||
rules={[{ required: !disabled, message: "请输入固定资产总值" }]}
|
||||
>
|
||||
<InputNumber style={{ width: "100%" }} min={0} placeholder="万元" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
|
@ -118,7 +122,11 @@ export default function BasicInfoStep({ form, disabled }) {
|
|||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<AttachmentUpload name="attachmentUrl" label="上传附件" disabled={disabled} />
|
||||
<AttachmentUpload
|
||||
name="attachmentUrl"
|
||||
label="上传附件"
|
||||
disabled={disabled}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Button, Image, Space, Table, Upload } from "antd";
|
||||
import { Button, Image, Space, Table } from "antd";
|
||||
import { useState } from "react";
|
||||
|
||||
import UploadButton from "~/components/UploadButton";
|
||||
import OrgEquipmentSelectModal from "./OrgEquipmentSelectModal";
|
||||
|
||||
export default function EquipmentStep({
|
||||
|
|
@ -55,20 +56,10 @@ export default function EquipmentStep({
|
|||
</Button>
|
||||
) : (
|
||||
!disabled && (
|
||||
<Upload
|
||||
showUploadList={false}
|
||||
action={`${window.process.env.app.API_HOST}/safetyEval/file/upload`}
|
||||
onChange={(info) => {
|
||||
if (info.file.status === "done") {
|
||||
const data = info.file.response?.data;
|
||||
if (data) {
|
||||
onUploadCalibration?.(record, data);
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button type="link" size="small">上传报告</Button>
|
||||
</Upload>
|
||||
<UploadButton
|
||||
onSuccess={(data) => onUploadCalibration?.(record, data)}
|
||||
buttonProps={{ children: "上传报告" }}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
</Space>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Button, Image, Space, Table, Tag, Upload } from "antd";
|
||||
import { Button, Image, Space, Table, Tag } from "antd";
|
||||
import { useState } from "react";
|
||||
import UploadButton from "~/components/UploadButton";
|
||||
|
||||
export default function MaterialStep({
|
||||
materials = [],
|
||||
|
|
@ -59,20 +60,9 @@ export default function MaterialStep({
|
|||
</Button>
|
||||
) : (
|
||||
!disabled && (
|
||||
<Upload
|
||||
showUploadList={false}
|
||||
action={`${window.process.env.app.API_HOST}/safetyEval/file/upload`}
|
||||
onChange={(info) => {
|
||||
if (info.file.status === "done") {
|
||||
const data = info.file.response?.data;
|
||||
if (data) {
|
||||
onUpload?.(record, data);
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button type="link" size="small">上传</Button>
|
||||
</Upload>
|
||||
<UploadButton
|
||||
onSuccess={(data) => onUpload?.(record, data)}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
</Space>
|
||||
|
|
|
|||
|
|
@ -357,21 +357,7 @@ function FilingFormPage(props) {
|
|||
title={MODE_TITLE[mode] || "资质备案表单"}
|
||||
history={props.history}
|
||||
previous
|
||||
extra={
|
||||
<Button
|
||||
onClick={() =>
|
||||
goFilingList(
|
||||
mode === FILING_FORM_MODE.FILED
|
||||
? "filed"
|
||||
: mode === FILING_FORM_MODE.CHANGE
|
||||
? "change"
|
||||
: "application",
|
||||
)
|
||||
}
|
||||
>
|
||||
返回列表
|
||||
</Button>
|
||||
}
|
||||
|
||||
>
|
||||
<Spin spinning={loading || submitting}>
|
||||
<Tabs
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
scrollbar-width: thin;
|
||||
}
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.micro-temp-layout-container .micro-temp-lay-container-bottom {
|
||||
|
|
|
|||
Loading…
Reference in New Issue