feat
parent
19e4771369
commit
0c9e2d62d3
|
|
@ -1,54 +1,33 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
import {
|
||||
fromEquipForm,
|
||||
fromPageResponse,
|
||||
fromSingleResponse,
|
||||
mapEquipEnableFlag,
|
||||
toEquipForm,
|
||||
toPageQuery,
|
||||
} from "../enterpriseInfo/adapter";
|
||||
import { apiGet, apiPost, apiPostDelete, safeAction, safePageResult } from "../enterpriseInfo/http";
|
||||
|
||||
export const equipInfoList = declareRequest("equipInfoLoading", safePageResult(async (params) => {
|
||||
const query = toPageQuery(params, {
|
||||
likeDeviceName: "deviceName",
|
||||
instrumentType: "instrumentType",
|
||||
deviceType: "deviceType",
|
||||
enableStatus: "enableFlag",
|
||||
});
|
||||
if (query.enableFlag !== undefined && query.enableFlag !== "") {
|
||||
query.enableFlag = mapEquipEnableFlag(query.enableFlag);
|
||||
}
|
||||
const res = await apiGet("/safetyEval/org-equipment/page", query);
|
||||
return fromPageResponse(res, toEquipForm);
|
||||
}));
|
||||
export const equipInfoList = declareRequest(
|
||||
"equipInfoLoading",
|
||||
"Get > /safetyEval/org-equipment/page",
|
||||
"equipInfoList: [] | res.data || [] & equipInfoTotal: 0 | res.data?.total || 0",
|
||||
);
|
||||
|
||||
export const equipInfoGet = declareRequest("equipInfoLoading", safeAction(async (params) => {
|
||||
const res = await apiGet("/safetyEval/org-equipment/get", { id: params.id });
|
||||
return fromSingleResponse(res, toEquipForm);
|
||||
}));
|
||||
export const equipInfoGet = declareRequest(
|
||||
"equipInfoLoading",
|
||||
"Get > /safetyEval/org-equipment/get",
|
||||
"equipInfoDetail: {} | res.data || {}",
|
||||
);
|
||||
|
||||
export const equipInfoAdd = declareRequest("equipInfoLoading", safeAction(async (values) => {
|
||||
const res = await apiPost("/safetyEval/org-equipment/save", fromEquipForm(values));
|
||||
return fromSingleResponse(res, toEquipForm);
|
||||
}));
|
||||
export const equipInfoAdd = declareRequest(
|
||||
"equipInfoLoading",
|
||||
"Post > @/safetyEval/org-equipment/save",
|
||||
);
|
||||
|
||||
export const equipInfoEdit = declareRequest("equipInfoLoading", safeAction(async (values) => {
|
||||
const res = await apiPost("/safetyEval/org-equipment/modify", fromEquipForm(values));
|
||||
return fromSingleResponse(res, toEquipForm);
|
||||
}));
|
||||
export const equipInfoEdit = declareRequest(
|
||||
"equipInfoLoading",
|
||||
"Post > @/safetyEval/org-equipment/modify",
|
||||
);
|
||||
|
||||
export const equipInfoRemove = declareRequest("equipInfoLoading", safeAction(async ({ id }) => {
|
||||
return apiPostDelete("/safetyEval/org-equipment/delete", id);
|
||||
}));
|
||||
export const equipInfoRemove = declareRequest(
|
||||
"equipInfoLoading",
|
||||
"Post > @/safetyEval/org-equipment/delete",
|
||||
);
|
||||
|
||||
export const equipInfoToggleStatus = declareRequest("equipInfoLoading", safeAction(async ({ id }) => {
|
||||
const res = await apiGet("/safetyEval/org-equipment/get", { id });
|
||||
const data = res?.data || {};
|
||||
const nextFlag = Number(data.enableFlag) === 1 ? 2 : 1;
|
||||
return apiPost("/safetyEval/org-equipment/modify", {
|
||||
...data,
|
||||
id,
|
||||
enableFlag: nextFlag,
|
||||
});
|
||||
}));
|
||||
export const equipInfoToggleStatus = declareRequest(
|
||||
"equipInfoLoading",
|
||||
"Get > /safetyEval/org-equipment/modify",
|
||||
);
|
||||
|
|
@ -70,7 +70,7 @@ export default function FilePreviewModal({
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title={title}
|
||||
width={width}
|
||||
cancelText="关闭"
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ function DepartmentPositionPage(props) {
|
|||
{positionModalOpen && (
|
||||
<Modal
|
||||
open={positionModalOpen}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title={currentId ? "编辑岗位" : "添加岗位"}
|
||||
width={560}
|
||||
onCancel={closePositionModal}
|
||||
|
|
@ -444,7 +444,7 @@ function DeptFormModal({
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title={currentId ? "编辑部门" : "添加部门"}
|
||||
width={560}
|
||||
loading={detailLoading}
|
||||
|
|
|
|||
|
|
@ -1,29 +1,35 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, Input, InputNumber, message, Modal, Row, Col, Select, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Button, Descriptions, Form, Input, InputNumber, message, Modal, Row, Col, Table, Tag, Select, Space } from "antd";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
||||
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
|
||||
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { NS_EQUIP_INFO } from "~/enumerate/namespace";
|
||||
import { isEquipEnabled } from "~/api/enterpriseInfo/adapter";
|
||||
import { safeListRequest, safeRequest } from "~/utils";
|
||||
import { positiveNumberRule } from "~/utils/validators";
|
||||
|
||||
const DUAL_CHANNEL = { 1: "是", 0: "否" };
|
||||
const { router } = tools;
|
||||
const DUAL_CHANNEL_MAP = { 1: "是", 0: "否" };
|
||||
|
||||
function EquipInfoPage(props) {
|
||||
const [formModalOpen, setFormModalOpen] = useState(false);
|
||||
const [viewModalOpen, setViewModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [searchForm] = Form.useForm();
|
||||
const { equipInfo } = props;
|
||||
const { equipInfoList: dataSource, equipInfoTotal: total, equipInfoLoading: loading } = equipInfo || {};
|
||||
|
||||
const { tableProps, getData } = useTable(safeListRequest(props.equipInfoList), { form: searchForm });
|
||||
const handleSearch = () => {
|
||||
props.equipInfoList({
|
||||
...router.query,
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
searchForm.setFieldsValue(router.query);
|
||||
handleSearch();
|
||||
}, []);
|
||||
|
||||
const onDelete = (id) => {
|
||||
|
|
@ -36,26 +42,26 @@ function EquipInfoPage(props) {
|
|||
const res = await props.equipInfoRemove({ id });
|
||||
if (res?.success !== false) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
handleSearch();
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const onToggleStatus = (id, record) => {
|
||||
const enabled = isEquipEnabled(record);
|
||||
const enabled = record.enableFlag === 1;
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: enabled ? "是否停用" : "是否启用",
|
||||
okText: "是",
|
||||
cancelText: "否",
|
||||
onOk: async () => {
|
||||
const res = await props.equipInfoToggleStatus({ id });
|
||||
const nextFlag = enabled ? 2 : 1;
|
||||
const res = await props.equipInfoToggleStatus({ id, enableFlag: nextFlag });
|
||||
if (res?.success !== false) {
|
||||
message.success("操作成功");
|
||||
await getData();
|
||||
}
|
||||
else {
|
||||
handleSearch();
|
||||
} else {
|
||||
message.error(res?.message || "操作失败");
|
||||
}
|
||||
},
|
||||
|
|
@ -63,98 +69,110 @@ function EquipInfoPage(props) {
|
|||
};
|
||||
|
||||
return (
|
||||
<PageLayout
|
||||
title={
|
||||
<div>
|
||||
<span>装备信息管理</span>
|
||||
<div className="pageLayout-extra">
|
||||
实现对评价机构内装备信息的维护管理。
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Search
|
||||
<PageLayout title="装备信息管理">
|
||||
<SearchForm
|
||||
style={{ marginBottom: 24 }}
|
||||
form={searchForm}
|
||||
options={[
|
||||
{ name: "likeDeviceName", label: "设备名称", placeholder: "请输入设备名称" },
|
||||
{ name: "instrumentType", label: "仪器类型" },
|
||||
{ name: "deviceType", label: "设备类型" },
|
||||
{
|
||||
name: "enableStatus",
|
||||
label: "设备状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
options: [{ label: "启用", value: 1 }, { label: "禁用", value: 0 }],
|
||||
},
|
||||
loading={loading}
|
||||
formLine={[
|
||||
<Form.Item key="likeDeviceName" name="likeDeviceName">
|
||||
<ControlWrapper.Input label="设备名称" placeholder="请输入" allowClear />
|
||||
</Form.Item>,
|
||||
<Form.Item key="instrumentType" name="instrumentType">
|
||||
<ControlWrapper.Input label="仪器类型" placeholder="请输入" allowClear />
|
||||
</Form.Item>,
|
||||
<Form.Item key="deviceType" name="deviceType">
|
||||
<ControlWrapper.Input label="设备类型" placeholder="请输入" allowClear />
|
||||
</Form.Item>,
|
||||
<Form.Item key="enableFlag" name="enableFlag">
|
||||
<ControlWrapper.Select label="设备状态" placeholder="请选择" allowClear style={{ width: "100%" }}>
|
||||
<Select.Option value={1}>启用</Select.Option>
|
||||
<Select.Option value={2}>禁用</Select.Option>
|
||||
</ControlWrapper.Select>
|
||||
</Form.Item>,
|
||||
]}
|
||||
onFinish={getData}
|
||||
onReset={() => {
|
||||
router.query = { ...router.query, current: 1, size: 10 };
|
||||
handleSearch();
|
||||
}}
|
||||
onFinish={() => {
|
||||
router.query = { ...router.query, current: 1, size: 10 };
|
||||
handleSearch();
|
||||
}}
|
||||
/>
|
||||
<Table
|
||||
{...tableProps}
|
||||
toolBarRender={() => (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setCurrentId("");
|
||||
setFormModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增装备
|
||||
</Button>
|
||||
)}
|
||||
rowKey="id"
|
||||
columns={[
|
||||
{ title: "设备名称", dataIndex: "deviceName" },
|
||||
{ title: "设备型号", dataIndex: "model" },
|
||||
{ title: "设备名称", dataIndex: "deviceName", width: 200, ellipsis: true },
|
||||
{ title: "设备型号", dataIndex: "deviceModel" },
|
||||
{ title: "仪器类型", dataIndex: "instrumentType" },
|
||||
{ title: "设备类型", dataIndex: "deviceType" },
|
||||
{ title: "厂家", dataIndex: "manufacturer" },
|
||||
{ title: "厂家", dataIndex: "manufacturer", ellipsis: true, width: 180 },
|
||||
{ title: "校准单位", dataIndex: "calibrationUnit" },
|
||||
{ title: "校准初值", dataIndex: "calibrationInitialValue" },
|
||||
{ title: "校准初值", dataIndex: "calibrationInitValue", width: 100, },
|
||||
{
|
||||
title: "设备状态",
|
||||
width: 90,
|
||||
render: (_, record) => (isEquipEnabled(record) ? "启用" : "禁用"),
|
||||
render: (_, record) => {
|
||||
const enabled = record.enableFlag === 1;
|
||||
return <Tag color={enabled ? "green" : "red"}>{enabled ? "启用" : "禁用"}</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 260,
|
||||
width: 180,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => { setCurrentId(record.id); setViewModalOpen(true); }}>
|
||||
<TableAction>
|
||||
<Button type="link" size="small" onClick={() => { setCurrentId(record.id); setViewModalOpen(true); }}>
|
||||
查看
|
||||
</Button>
|
||||
<Button type="link" onClick={() => { setCurrentId(record.id); setFormModalOpen(true); }}>
|
||||
<Button type="link" size="small" onClick={() => { setCurrentId(record.id); setFormModalOpen(true); }}>
|
||||
编辑
|
||||
</Button>
|
||||
<Button type="link" onClick={() => onToggleStatus(record.id, record)}>
|
||||
{isEquipEnabled(record) ? "禁用" : "启用"}
|
||||
<Button type="link" size="small" onClick={() => onToggleStatus(record.id, record)}>
|
||||
{record.enableFlag === 1 ? "禁用" : "启用"}
|
||||
</Button>
|
||||
<Button danger type="link" onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
<Button danger type="link" size="small" onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</TableAction>
|
||||
),
|
||||
},
|
||||
]}
|
||||
dataSource={dataSource}
|
||||
scroll={{ y: props.scrollY }}
|
||||
loading={loading}
|
||||
pagination={{
|
||||
total,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
showTotal: (t) => `共 ${t} 条`,
|
||||
current: router.query.current || 1,
|
||||
pageSize: router.query.size || 10,
|
||||
onChange: (page, pageSize) => {
|
||||
router.query = { ...router.query, current: page, size: pageSize };
|
||||
handleSearch();
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
{formModalOpen && (
|
||||
<EquipFormModal
|
||||
open={formModalOpen}
|
||||
currentId={currentId}
|
||||
requestAdd={props.equipInfoAdd}
|
||||
requestEdit={props.equipInfoEdit}
|
||||
requestDetails={props.equipInfoGet}
|
||||
equipInfoGet={props.equipInfoGet}
|
||||
equipInfoAdd={props.equipInfoAdd}
|
||||
equipInfoEdit={props.equipInfoEdit}
|
||||
onCancel={() => {
|
||||
setFormModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
onSuccess={getData}
|
||||
onSuccess={handleSearch}
|
||||
/>
|
||||
)}
|
||||
{viewModalOpen && (
|
||||
<EquipViewModal
|
||||
open={viewModalOpen}
|
||||
currentId={currentId}
|
||||
requestDetails={props.equipInfoGet}
|
||||
equipInfoGet={props.equipInfoGet}
|
||||
onCancel={() => {
|
||||
setViewModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -166,34 +184,28 @@ function EquipInfoPage(props) {
|
|||
}
|
||||
|
||||
function EquipFormModal({
|
||||
open, currentId, requestAdd, requestEdit, requestDetails, onCancel, onSuccess,
|
||||
open, currentId, equipInfoGet, equipInfoAdd, equipInfoEdit, onCancel, onSuccess,
|
||||
}) {
|
||||
const [form] = Form.useForm();
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [detailLoading, setDetailLoading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) {
|
||||
return;
|
||||
}
|
||||
if (!open) return;
|
||||
if (!currentId) {
|
||||
form.resetFields();
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
setDetailLoading(true);
|
||||
safeRequest(requestDetails, { id: currentId }).then((res) => {
|
||||
if (!cancelled && res?.data) {
|
||||
form.setFieldsValue(res.data);
|
||||
}
|
||||
equipInfoGet({ id: currentId }).then((res) => {
|
||||
if (cancelled) return;
|
||||
const data = res?.data || {};
|
||||
form.setFieldsValue(data);
|
||||
}).finally(() => {
|
||||
if (!cancelled) {
|
||||
setDetailLoading(false);
|
||||
}
|
||||
if (!cancelled) setDetailLoading(false);
|
||||
});
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
return () => { cancelled = true; };
|
||||
}, [open, currentId]);
|
||||
|
||||
const handleCancel = () => {
|
||||
|
|
@ -204,21 +216,16 @@ function EquipFormModal({
|
|||
const handleSubmit = async (values) => {
|
||||
try {
|
||||
setSubmitting(true);
|
||||
const request = currentId ? requestEdit : requestAdd;
|
||||
if (currentId) {
|
||||
values.id = currentId;
|
||||
}
|
||||
const res = await request(values);
|
||||
if (currentId) values.id = currentId;
|
||||
const res = await (currentId ? equipInfoEdit(values) : equipInfoAdd(values));
|
||||
if (res?.success !== false) {
|
||||
message.success(currentId ? "编辑成功" : "添加成功");
|
||||
handleCancel();
|
||||
onSuccess();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
message.error(res?.message || "操作失败");
|
||||
}
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
|
@ -226,7 +233,7 @@ function EquipFormModal({
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title={currentId ? "编辑设备" : "添加设备"}
|
||||
width={900}
|
||||
loading={detailLoading}
|
||||
|
|
@ -237,7 +244,17 @@ function EquipFormModal({
|
|||
<Form form={form} layout="vertical" onFinish={handleSubmit}>
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Form.Item name="instrumentCategory" label="仪器分类" rules={[{ required: true, message: "请选择仪器分类" }]}>
|
||||
<Form.Item name="deviceName" label="设备名称" rules={[{ required: true, message: "请输入设备名称" }]}>
|
||||
<Input placeholder="请输入设备名称" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="deviceModel" label="型号" rules={[{ required: true, message: "请输入型号" }]}>
|
||||
<Input placeholder="请输入型号" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="instrumentType" label="仪器分类" rules={[{ required: true, message: "请选择仪器分类" }]}>
|
||||
<Input placeholder="请输入仪器分类" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
|
@ -247,13 +264,8 @@ function EquipFormModal({
|
|||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="deviceName" label="设备名称" rules={[{ required: true, message: "请输入设备名称" }]}>
|
||||
<Input placeholder="请输入设备名称" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="model" label="型号" rules={[{ required: true, message: "请输入型号" }]}>
|
||||
<Input placeholder="请输入型号" />
|
||||
<Form.Item name="manufacturer" label="厂家" rules={[{ required: true, message: "请输入厂家" }]}>
|
||||
<Input placeholder="请输入厂家" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -261,11 +273,6 @@ function EquipFormModal({
|
|||
<Input placeholder="请输入设备流量说明" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="manufacturer" label="厂家" rules={[{ required: true, message: "请输入厂家" }]}>
|
||||
<Input placeholder="请输入厂家" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="minFlow" label="最小流量" rules={[positiveNumberRule("最小流量", false)]}>
|
||||
<InputNumber style={{ width: "100%" }} placeholder="请输入最小流量" />
|
||||
|
|
@ -282,17 +289,17 @@ function EquipFormModal({
|
|||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="calibrationInitialValue" label="校准初始值" rules={[positiveNumberRule("校准初始值", false)]}>
|
||||
<Form.Item name="calibrationInitValue" label="校准初始值" rules={[positiveNumberRule("校准初始值", false)]}>
|
||||
<InputNumber style={{ width: "100%" }} placeholder="请输入校准初始值" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="onSiteCalibrationType" label="现场校验类型">
|
||||
<Form.Item name="fieldCalibrationType" label="现场校验类型">
|
||||
<Input placeholder="请输入现场校验类型" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="isDualChannel" label="是否双路">
|
||||
<Form.Item name="dualChannelFlag" label="是否双路">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="请选择"
|
||||
|
|
@ -306,7 +313,7 @@ function EquipFormModal({
|
|||
);
|
||||
}
|
||||
|
||||
function EquipViewModal({ open, currentId, requestDetails, onCancel }) {
|
||||
function EquipViewModal({ open, currentId, equipInfoGet, onCancel }) {
|
||||
const [info, setInfo] = useState({});
|
||||
const [detailLoading, setDetailLoading] = useState(false);
|
||||
|
||||
|
|
@ -317,24 +324,18 @@ function EquipViewModal({ open, currentId, requestDetails, onCancel }) {
|
|||
}
|
||||
let cancelled = false;
|
||||
setDetailLoading(true);
|
||||
safeRequest(requestDetails, { id: currentId }).then((res) => {
|
||||
if (!cancelled) {
|
||||
setInfo(res?.data || {});
|
||||
}
|
||||
equipInfoGet({ id: currentId }).then((res) => {
|
||||
if (!cancelled) setInfo(res?.data || {});
|
||||
}).finally(() => {
|
||||
if (!cancelled) {
|
||||
setDetailLoading(false);
|
||||
}
|
||||
if (!cancelled) setDetailLoading(false);
|
||||
});
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
return () => { cancelled = true; };
|
||||
}, [open, currentId]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="查看设备"
|
||||
width={900}
|
||||
loading={detailLoading}
|
||||
|
|
@ -343,21 +344,21 @@ function EquipViewModal({ open, currentId, requestDetails, onCancel }) {
|
|||
onCancel={onCancel}
|
||||
>
|
||||
<Descriptions bordered column={2} labelStyle={{ width: 120 }}>
|
||||
<Descriptions.Item label="仪器分类">{info.instrumentCategory || info.instrumentType}</Descriptions.Item>
|
||||
<Descriptions.Item label="设备类型">{info.deviceType}</Descriptions.Item>
|
||||
<Descriptions.Item label="设备名称">{info.deviceName}</Descriptions.Item>
|
||||
<Descriptions.Item label="型号">{info.model}</Descriptions.Item>
|
||||
<Descriptions.Item label="设备流量说明" span={2}>{info.flowDesc}</Descriptions.Item>
|
||||
<Descriptions.Item label="设备型号">{info.deviceModel}</Descriptions.Item>
|
||||
<Descriptions.Item label="仪器分类">{info.instrumentType}</Descriptions.Item>
|
||||
<Descriptions.Item label="设备类型">{info.deviceType}</Descriptions.Item>
|
||||
<Descriptions.Item label="厂家">{info.manufacturer}</Descriptions.Item>
|
||||
<Descriptions.Item label="现场校验类型">{info.onSiteCalibrationType}</Descriptions.Item>
|
||||
<Descriptions.Item label="设备流量说明" span={2}>{info.flowDesc}</Descriptions.Item>
|
||||
<Descriptions.Item label="最小流量">{info.minFlow}</Descriptions.Item>
|
||||
<Descriptions.Item label="最大流量">{info.maxFlow}</Descriptions.Item>
|
||||
<Descriptions.Item label="校准单位">{info.calibrationUnit}</Descriptions.Item>
|
||||
<Descriptions.Item label="校准初始值">{info.calibrationInitialValue}</Descriptions.Item>
|
||||
<Descriptions.Item label="是否双路">{DUAL_CHANNEL[info.isDualChannel] ?? "-"}</Descriptions.Item>
|
||||
<Descriptions.Item label="校准初始值">{info.calibrationInitValue}</Descriptions.Item>
|
||||
<Descriptions.Item label="现场校验类型">{info.fieldCalibrationType}</Descriptions.Item>
|
||||
<Descriptions.Item label="是否双路">{DUAL_CHANNEL_MAP[info.dualChannelFlag] ?? "-"}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_EQUIP_INFO], true)(EquipInfoPage);
|
||||
export default Connect([NS_EQUIP_INFO], true)(AntdTableFuncControl(EquipInfoPage));
|
||||
|
|
@ -228,7 +228,7 @@ function PersonnelChangePage(props) {
|
|||
|
||||
<Modal
|
||||
open={auditModalOpen}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="审核离职申请"
|
||||
width={720}
|
||||
footer={(
|
||||
|
|
@ -254,7 +254,7 @@ function PersonnelChangePage(props) {
|
|||
|
||||
<Modal
|
||||
open={viewResignOpen}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="查看离职申请"
|
||||
width={720}
|
||||
cancelText="返回"
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ function CertModal({
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title={currentId ? "编辑证书" : "添加证书"}
|
||||
width={800}
|
||||
loading={detailLoading}
|
||||
|
|
@ -317,7 +317,7 @@ function ViewModal({ open, currentId, requestDetails, onCancel }) {
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="证书详情"
|
||||
width={800}
|
||||
loading={detailLoading}
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ function StaffFormModal({
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title={currentId ? "编辑人员" : "添加人员"}
|
||||
width={900}
|
||||
loading={detailLoading}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ export default function StaffViewModal({
|
|||
<>
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="查看"
|
||||
width={900}
|
||||
loading={detailLoading}
|
||||
|
|
@ -191,7 +191,7 @@ export default function StaffViewModal({
|
|||
|
||||
<Modal
|
||||
open={!!certPreview}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="证书预览"
|
||||
width={720}
|
||||
loading={certPreviewLoading}
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ function CertFormModal({
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
maskClosable={false}
|
||||
title={currentId ? "编辑证书" : "添加证书"}
|
||||
width={800}
|
||||
|
|
@ -505,7 +505,7 @@ function CertViewModal({ open, currentId, requestDetails, onCancel }) {
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
maskClosable={false}
|
||||
title="证书详情"
|
||||
width={800}
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ function AddModal({ open, staffOptions, requestAdd, onCancel, onSuccess }) {
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="添加离职申请"
|
||||
width={720}
|
||||
confirmLoading={submitting}
|
||||
|
|
@ -279,7 +279,7 @@ function ViewModal({ open, currentId, requestDetails, onCancel }) {
|
|||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="查看离职申请"
|
||||
width={720}
|
||||
loading={detailLoading}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export default function ChangeHistoryModal({ open, originFilingId, onCancel }) {
|
|||
open={open}
|
||||
title="备案变更记录"
|
||||
width={560}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
cancelText="关闭"
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
onCancel={onCancel}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ function OrgEquipmentSelectModalInner(props) {
|
|||
open={open}
|
||||
title="添加备案装备"
|
||||
width={800}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
onCancel={onCancel}
|
||||
onOk={handleOk}
|
||||
okText="确认添加"
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ function OrgPersonnelSelectModalInner(props) {
|
|||
open={open}
|
||||
title="添加备案人员"
|
||||
width={800}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
onCancel={onCancel}
|
||||
onOk={handleOk}
|
||||
okText="确认添加"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export default function PrerequisiteVerifyModal({
|
|||
open={open}
|
||||
title="资质申请前置条件核验结果"
|
||||
width={560}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
onCancel={onCancel}
|
||||
onOk={allPassed ? onConfirm : undefined}
|
||||
okText="确定"
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ function EnterprisePortraitPage() {
|
|||
|
||||
<Modal
|
||||
open={viewOpen}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="企业安全能力画像"
|
||||
width={800}
|
||||
loading={detailLoading}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ function EvaluatorInfoPage() {
|
|||
|
||||
<Modal
|
||||
open={viewOpen}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="评价师详细信息"
|
||||
width={900}
|
||||
loading={detailLoading}
|
||||
|
|
@ -188,7 +188,7 @@ function EvaluatorInfoPage() {
|
|||
|
||||
<Modal
|
||||
open={!!certPreview}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="证书预览"
|
||||
width={520}
|
||||
cancelText="关闭"
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ function OrgAccountPage(props) {
|
|||
|
||||
<Modal
|
||||
open={viewOpen}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="机构信息查看"
|
||||
width={760}
|
||||
loading={detailLoading}
|
||||
|
|
@ -259,7 +259,7 @@ function OrgAccountPage(props) {
|
|||
|
||||
<Modal
|
||||
open={editOpen}
|
||||
destroyOnClose
|
||||
destroyOnHidden
|
||||
title="编辑机构信息"
|
||||
width={760}
|
||||
confirmLoading={editLoading}
|
||||
|
|
|
|||
Loading…
Reference in New Issue