企业预案管理
parent
58da2bbb60
commit
3af4efd132
|
|
@ -66,3 +66,5 @@
|
|||
`/emergencyRescue/container/enterprise/planAndDrill/enterprisePlan/list`
|
||||
- 预案与演练/应急预案管理
|
||||
`/emergencyRescue/container/enterprise/planAndDrill/emergencyPlan/list`
|
||||
- 预案与演练/应急演练管理
|
||||
`/emergencyRescue/container/enterprise/planAndDrill/emergencyExercise/list`
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
export const emergencyExerciseList = declareRequest(
|
||||
"emergencyExerciseLoading",
|
||||
"Post > @/emergencyRescue/emergencyDrill/list",
|
||||
);
|
||||
export const emergencyExerciseInfo = declareRequest(
|
||||
"emergencyExerciseLoading",
|
||||
"Get > /emergencyRescue/emergencyDrill/{id}",
|
||||
);
|
||||
export const emergencyExerciseAdd = declareRequest(
|
||||
"emergencyExerciseLoading",
|
||||
"Post > @/emergencyRescue/emergencyDrill/save",
|
||||
);
|
||||
export const emergencyExerciseUpdate = declareRequest(
|
||||
"emergencyExerciseLoading",
|
||||
"Put > @/emergencyRescue/emergencyDrill/edit",
|
||||
);
|
||||
export const emergencyExerciseDelete = declareRequest(
|
||||
"emergencyExerciseLoading",
|
||||
"Delete > @/emergencyRescue/emergencyDrill/{id}",
|
||||
);
|
||||
export const emergencyExerciseDeleteBatch = declareRequest(
|
||||
"emergencyExerciseLoading",
|
||||
"Delete > @/emergencyRescue/emergencyDrill/ids?ids={ids}",
|
||||
);
|
||||
|
|
@ -25,3 +25,4 @@ export const NS_ENTERPRISE_EMERGENCY_PERSONNEL = defineNamespace("enterpriseEmer
|
|||
export const NS_EMERGENCY_RESCUE_TEAM = defineNamespace("emergencyRescueTeam");
|
||||
export const NS_ENTERPRISE_PLAN = defineNamespace("enterprisePlan");
|
||||
export const NS_EMERGENCY_PLAN = defineNamespace("emergencyPlan");
|
||||
export const NS_EMERGENCY_EXERCISE = defineNamespace("emergencyExercise");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,143 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, message, Modal, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
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 { NS_EMERGENCY_EXERCISE } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||
|
||||
const [form] = Search.useForm();
|
||||
|
||||
const { tableProps, getData } = useTable(props["emergencyExerciseList"], {
|
||||
form,
|
||||
transform: formData => ({
|
||||
drillStartTime: formData.drillTime?.[0],
|
||||
drillEndTime: formData.drillTime?.[1],
|
||||
}),
|
||||
});
|
||||
|
||||
const onDelete = (record) => {
|
||||
Modal.confirm({
|
||||
title: "删除确认",
|
||||
content: `确定要删除【${record.planName}】吗`,
|
||||
onOk: async () => {
|
||||
const { success } = await props["emergencyExerciseDelete"]({ id: record.id });
|
||||
if (success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const onDeleteBatch = () => {
|
||||
if (selectedRowKeys.length === 0) {
|
||||
message.warning("请选择要删除的记录");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "删除确认",
|
||||
content: "确认要删除吗?",
|
||||
onOk: async () => {
|
||||
const { success } = await props["emergencyExerciseDeleteBatch"]({ ids: selectedRowKeys });
|
||||
if (success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Page isShowAllAction={false}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "likeDrillName", label: "应急演练方案名称" },
|
||||
{ name: "drillTime", label: "演练时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
rowSelection={{
|
||||
preserveSelectedRowKeys: true,
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => {
|
||||
setSelectedRowKeys(selectedRowKeys);
|
||||
},
|
||||
}}
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={(<AddIcon />)}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
danger
|
||||
ghost
|
||||
icon={(<DeleteIcon />)}
|
||||
onClick={onDeleteBatch}
|
||||
>
|
||||
批量删除
|
||||
</Button>
|
||||
</Space>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "应急演练方案名称", dataIndex: "drillName" },
|
||||
{ title: "演练单位", dataIndex: "drillUnit" },
|
||||
{ title: "演练时间", dataIndex: "drillTime" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 150,
|
||||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./view?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
onClick={() => {
|
||||
onDelete(record);
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_EMERGENCY_EXERCISE], true)(List);
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
function EmergencyExercise(props) {
|
||||
return props.children;
|
||||
}
|
||||
|
||||
export default EmergencyExercise;
|
||||
|
|
@ -18,7 +18,7 @@ function GradeResponse(props) {
|
|||
},
|
||||
useStorageQueryCriteria: false,
|
||||
onSuccess: () => {
|
||||
props.setResponseLevelRefresh(true);
|
||||
props.mode !== "view" && props.setResponseLevelRefresh(true);
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -40,6 +40,8 @@ function GradeResponse(props) {
|
|||
<div>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
{props.mode !== "view" && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={(<AddIcon />)}
|
||||
|
|
@ -50,6 +52,8 @@ function GradeResponse(props) {
|
|||
新增
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "分级名称", dataIndex: "levelName" },
|
||||
{ title: "分级描述", dataIndex: "levelDescription" },
|
||||
|
|
@ -58,6 +62,7 @@ function GradeResponse(props) {
|
|||
title: "操作",
|
||||
width: 150,
|
||||
fixed: "right",
|
||||
hidden: props.mode === "view",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ function OrganizationStructure(props) {
|
|||
const getTreeList = async () => {
|
||||
const { data } = await props["enterprisePlanLevelOrganizationListTree"]({ planId: props.planId });
|
||||
setTreeList(data);
|
||||
props.setExecutingAgencyRefresh(true);
|
||||
props.mode !== "view" && props.setExecutingAgencyRefresh(true);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -82,6 +82,7 @@ function OrganizationStructure(props) {
|
|||
<div>
|
||||
<div style={{ display: "flex" }}>
|
||||
<div style={{ width: 500 }}>
|
||||
{props.mode !== "view" && (
|
||||
<Space style={{ marginBottom: 16 }}>
|
||||
<Button
|
||||
type="primary"
|
||||
|
|
@ -130,6 +131,7 @@ function OrganizationStructure(props) {
|
|||
删除
|
||||
</Button>
|
||||
</Space>
|
||||
)}
|
||||
<BasicLeftTree
|
||||
treeData={treeList}
|
||||
nameKey="orgName"
|
||||
|
|
@ -143,6 +145,8 @@ function OrganizationStructure(props) {
|
|||
<div style={{ flex: 1 }}>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
{props.mode !== "view" && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={(<AddIcon />)}
|
||||
|
|
@ -154,6 +158,8 @@ function OrganizationStructure(props) {
|
|||
新增人员
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
)}
|
||||
options={false}
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "userName" },
|
||||
|
|
@ -165,6 +171,7 @@ function OrganizationStructure(props) {
|
|||
title: "操作",
|
||||
width: 150,
|
||||
fixed: "right",
|
||||
hidden: props.mode === "view",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ function PlanAttachments(props) {
|
|||
<div>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
{props.mode !== "view" && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={(<AddIcon />)}
|
||||
|
|
@ -57,6 +59,8 @@ function PlanAttachments(props) {
|
|||
新增
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
)}
|
||||
options={false}
|
||||
columns={[
|
||||
{ title: "文件名称", dataIndex: "fileName" },
|
||||
|
|
@ -82,6 +86,7 @@ function PlanAttachments(props) {
|
|||
>
|
||||
下载
|
||||
</Button>
|
||||
{props.mode !== "view" && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
|
|
@ -91,6 +96,8 @@ function PlanAttachments(props) {
|
|||
>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
{props.mode !== "view" && (
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
|
|
@ -100,6 +107,7 @@ function PlanAttachments(props) {
|
|||
>
|
||||
删除
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ function PlanInstructions(props) {
|
|||
|
||||
return (
|
||||
<div style={{ display: "flex" }}>
|
||||
{
|
||||
props.mode !== "view" && (
|
||||
<div style={{ width: "50%" }}>
|
||||
<FormBuilder
|
||||
showActionButtons={false}
|
||||
|
|
@ -153,7 +155,9 @@ function PlanInstructions(props) {
|
|||
</Button>
|
||||
</Space>
|
||||
</div>
|
||||
<div style={{ width: "50%" }}>
|
||||
)
|
||||
}
|
||||
<div style={{ flex: 1 }}>
|
||||
<Divider orientation="left">指令列表</Divider>
|
||||
<Table
|
||||
options={false}
|
||||
|
|
@ -165,6 +169,7 @@ function PlanInstructions(props) {
|
|||
title: "操作",
|
||||
width: 150,
|
||||
fixed: "right",
|
||||
hidden: props.mode === "view",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ function GradeResponse(props) {
|
|||
<div>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
{props.mode !== "view" && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={(<AddIcon />)}
|
||||
|
|
@ -51,6 +53,8 @@ function GradeResponse(props) {
|
|||
新增
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "资源类型", dataIndex: "resourceType" },
|
||||
{ title: "资源名称", dataIndex: "resourceName" },
|
||||
|
|
@ -73,6 +77,7 @@ function GradeResponse(props) {
|
|||
>
|
||||
查看
|
||||
</Button>
|
||||
{props.mode !== "view" && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
|
|
@ -82,6 +87,8 @@ function GradeResponse(props) {
|
|||
>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
{props.mode !== "view" && (
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
|
|
@ -91,6 +98,7 @@ function GradeResponse(props) {
|
|||
>
|
||||
删除
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -24,10 +24,11 @@ function PlanText(props) {
|
|||
values={{
|
||||
planName: props.planName,
|
||||
}}
|
||||
span={24}
|
||||
submitButtonText="保存并下一步"
|
||||
options={[
|
||||
{ name: "planName", label: "预案名称", span: 24, componentProps: { disabled: true } },
|
||||
{ name: "planText", label: "预案文本", span: 24, render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
|
||||
{ name: "planName", label: "预案名称", componentProps: { disabled: true } },
|
||||
{ name: "planText", label: "预案文本", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={onSubmit}
|
||||
|
|
|
|||
|
|
@ -57,10 +57,6 @@ function Add(props) {
|
|||
planInstructions: "planText",
|
||||
};
|
||||
|
||||
if (urlState.currentStep === "planText") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (urlState.currentStep === "planAttachments") {
|
||||
setReviewPersonModalVisible(true);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ function List(props) {
|
|||
{
|
||||
title: "审核状态",
|
||||
dataIndex: "auditFlag",
|
||||
render: (_, record) => getLabelName({ list: ENTERPRISE_PLAN_AUDIT_STATUS_ENUM, status: record.auditFlag }) || "暂存",
|
||||
render: (_, record) => getLabelName({ list: ENTERPRISE_PLAN_AUDIT_STATUS_ENUM, status: record.auditFlag }) || "待完善",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
|
@ -72,7 +72,7 @@ function List(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./view?id=${record.id}`);
|
||||
props.history.push(`./view?id=${record.id}&planName=${record.planName}`);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Descriptions } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||
|
||||
function BasicInfo(props) {
|
||||
const [info, setInfo] = useState({});
|
||||
|
||||
const getData = async () => {
|
||||
const { data } = await props["enterprisePlanBasicInfoInfo"]({ id: props.planId });
|
||||
setInfo(data);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, [props.planId]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Descriptions
|
||||
bordered
|
||||
column={2}
|
||||
styles={{ label: { width: 200 } }}
|
||||
items={[
|
||||
{ label: "预案名称", children: info.planName },
|
||||
{ label: "预案类型", children: info.planTypeName },
|
||||
{ label: "预案编码", children: info.planCode },
|
||||
{ label: "预案等级", children: info.planLevelName },
|
||||
{ label: "事件类型", children: info.eventTypeName },
|
||||
{ label: "经度", children: info.longitude },
|
||||
{ label: "纬度", children: info.latitude },
|
||||
{ label: "预案概述", children: info.planOverview },
|
||||
{ label: "备注", children: info.remarks },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_ENTERPRISE_PLAN], true)(BasicInfo);
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import GradeResponsePage from "../../../Add/components/GradeResponse";
|
||||
|
||||
function GradeResponse(props) {
|
||||
return <GradeResponsePage mode="view" {...props} />;
|
||||
}
|
||||
|
||||
export default GradeResponse;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import OrganizationStructurePage from "../../../Add/components/OrganizationStructure";
|
||||
|
||||
function OrganizationStructure(props) {
|
||||
return <OrganizationStructurePage mode="view" {...props} />;
|
||||
}
|
||||
|
||||
export default OrganizationStructure;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import PlanAttachmentsPage from "../../../Add/components/PlanAttachments";
|
||||
|
||||
function PlanAttachments(props) {
|
||||
return <PlanAttachmentsPage mode="view" {...props} />;
|
||||
}
|
||||
|
||||
export default PlanAttachments;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import PlanInstructionsPage from "../../../Add/components/PlanInstructions";
|
||||
|
||||
function PlanInstructions(props) {
|
||||
return <PlanInstructionsPage mode="view" {...props} />;
|
||||
}
|
||||
|
||||
export default PlanInstructions;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import PlanResourcesPage from "../../../Add/components/PlanResources";
|
||||
|
||||
function PlanResources(props) {
|
||||
return <PlanResourcesPage mode="view" {...props} />;
|
||||
}
|
||||
|
||||
export default PlanResources;
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Descriptions } from "antd";
|
||||
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||
|
||||
function BasicInfo(props) {
|
||||
return (
|
||||
<div>
|
||||
<Descriptions
|
||||
bordered
|
||||
column={1}
|
||||
styles={{ label: { width: 200 } }}
|
||||
items={[
|
||||
{ label: "预案名称", children: props.planName },
|
||||
{ label: "预案文本", children: props.planText },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_ENTERPRISE_PLAN], true)(BasicInfo);
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
import useUrlState from "@ahooksjs/use-url-state";
|
||||
import { Tabs } from "antd";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import BasicInfo from "./components/BasicInfo";
|
||||
import GradeResponse from "./components/GradeResponse";
|
||||
import OrganizationStructure from "./components/OrganizationStructure";
|
||||
import PlanAttachments from "./components/PlanAttachments";
|
||||
import PlanInstructions from "./components/PlanInstructions";
|
||||
import PlanResources from "./components/PlanResources";
|
||||
import PlanText from "./components/PlanText";
|
||||
|
||||
function View() {
|
||||
const query = useGetUrlQuery();
|
||||
const [urlState, setUrlState] = useUrlState(
|
||||
{
|
||||
currentStep: "basicInfo",
|
||||
planId: query.id,
|
||||
planName: query.planName,
|
||||
},
|
||||
{ navigateMode: "replace" },
|
||||
);
|
||||
|
||||
return (
|
||||
<Page headerTitle="查看">
|
||||
<Tabs
|
||||
activeKey={urlState.currentStep}
|
||||
onChange={key => setUrlState({ currentStep: key })}
|
||||
items={[
|
||||
{
|
||||
key: "basicInfo",
|
||||
label: "基本信息",
|
||||
children: (<BasicInfo planId={query.id} />),
|
||||
},
|
||||
{
|
||||
key: "gradeResponse",
|
||||
label: "分级响应",
|
||||
children: (<GradeResponse planId={query.id} />),
|
||||
},
|
||||
{
|
||||
key: "organizationStructure",
|
||||
label: "组织结构",
|
||||
children: (<OrganizationStructure planId={query.id} />),
|
||||
},
|
||||
{
|
||||
key: "planResources",
|
||||
label: "预案资源",
|
||||
children: (<PlanResources planId={query.id} />),
|
||||
},
|
||||
{
|
||||
key: "planInstructions",
|
||||
label: "预案指令",
|
||||
children: (<PlanInstructions planId={query.id} />),
|
||||
},
|
||||
{
|
||||
key: "planText",
|
||||
label: "预案文案",
|
||||
children: (<PlanText planId={query.id} planName={urlState.planName} />),
|
||||
},
|
||||
{
|
||||
key: "planAttachments",
|
||||
label: "预案附件",
|
||||
children: (<PlanAttachments planId={query.id} />),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
export default View;
|
||||
Loading…
Reference in New Issue