{
+ setSelectedRowKeys(selectedRowKeys);
+ },
+ }}
+ toolBarRender={() => (
+
+ )}
+ onClick={() => {
+ props.history.push("./add");
+ }}
+ >
+ 新增
+
+ )}
+ onClick={onDeleteBatch}
+ >
+ 批量删除
+
+
+ )}
+ columns={[
+ { title: "应急预案名称", dataIndex: "planName" },
+ { title: "预案类别", dataIndex: "planCategoryName" },
+ { title: "预案级别", dataIndex: "planTypeName" },
+ { title: "备案状态", dataIndex: "recordStatusName" },
+ {
+ title: "操作",
+ width: 150,
+ fixed: "right",
+ render: (_, record) => (
+
+
+
+
+
+ ),
+ },
+ ]}
+ {...tableProps}
+ />
+
+ );
+}
+
+export default Connect([NS_EMERGENCY_PLAN], true)(List);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EmergencyPlan/View/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EmergencyPlan/View/index.js
new file mode 100644
index 0000000..f19024c
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EmergencyPlan/View/index.js
@@ -0,0 +1,86 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Descriptions, Spin } from "antd";
+import { useEffect, useState } from "react";
+import Page from "zy-react-library/components/Page";
+import PreviewImg from "zy-react-library/components/PreviewImg";
+import PreviewPdf from "zy-react-library/components/PreviewPdf";
+import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
+import useGetFile from "zy-react-library/hooks/useGetFile";
+import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
+import { getFileSuffix } from "zy-react-library/utils";
+import { NS_EMERGENCY_PLAN } from "~/enumerate/namespace";
+
+function View(props) {
+ const query = useGetUrlQuery();
+ const { loading: getFileLoading, getFile } = useGetFile();
+
+ const [info, setInfo] = useState({});
+
+ const getData = async () => {
+ const { data } = await props["emergencyPlanInfo"]({ id: query.id });
+ const files = [];
+ if (data.fileId) {
+ const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[703], eqForeignKey: data.fileId });
+ files.push(...fileItems);
+ }
+ setInfo({
+ ...data,
+ files,
+ });
+ };
+
+ useEffect(() => {
+ getData();
+ }, []);
+
+ const previewFile = (files = []) => {
+ const pdfFile = [];
+ const imgFile = [];
+ for (let i = 0; i < files.length; i++) {
+ const file = files[i];
+ if (getFileSuffix(file.fileName) === "pdf")
+ pdfFile.push(file);
+ else
+ imgFile.push(file);
+ }
+ return (
+ <>
+
+
+ >
+ );
+ };
+
+ return (
+
+
+
+
+
+ );
+}
+
+export default Connect([NS_EMERGENCY_PLAN], true)(View);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EmergencyPlan/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EmergencyPlan/index.js
new file mode 100644
index 0000000..dd22dfb
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EmergencyPlan/index.js
@@ -0,0 +1,5 @@
+function EmergencyPlan(props) {
+ return props.children;
+}
+
+export default EmergencyPlan;
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/BasicInfo/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/BasicInfo/index.js
new file mode 100644
index 0000000..7f1a9a3
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/BasicInfo/index.js
@@ -0,0 +1,128 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { message } from "antd";
+import { useEffect, useState } from "react";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import Map from "zy-react-library/components/Map";
+import DictionarySelect from "zy-react-library/components/Select/Dictionary";
+import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
+import useDictionary from "zy-react-library/hooks/useDictionary";
+import { getLabelName } from "zy-react-library/utils";
+import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
+
+function BasicInfo(props) {
+ const [form] = FormBuilder.useForm();
+
+ const { getDictionary } = useDictionary();
+
+ const [enterprisePlanEventType, setEnterprisePlanEventType] = useState([]);
+
+ const getData = async () => {
+ if (!props.planId)
+ return;
+
+ const { data } = await props["enterprisePlanBasicInfoInfo"]({ id: props.planId });
+ form.setFieldsValue({
+ ...data,
+ eventType: data.eventType ? data.eventType.split(",") : [],
+ eventTypeName: data.eventTypeName ? data.eventTypeName.split(",") : [],
+ });
+ };
+
+ const getEnterprisePlanEventType = async () => {
+ const dictionaryItems = await getDictionary({ dictValue: "enterprisePlanEventType" });
+ setEnterprisePlanEventType(dictionaryItems);
+ };
+
+ useEffect(() => {
+ getData();
+ }, [props.planId]);
+
+ useEffect(() => {
+ getEnterprisePlanEventType();
+ }, []);
+
+ const onSubmit = async (values) => {
+ const { success, data } = await props[!props.planId ? "enterprisePlanBasicInfoAdd" : "enterprisePlanBasicInfoUpdate"]({
+ ...values,
+ eventType: values.eventType.join(","),
+ eventTypeName: values.eventTypeName.join(","),
+ });
+ if (success) {
+ message.success("保存成功");
+ props.setUrlState({
+ planId: data?.id || props.planId,
+ planName: values.planName,
+ currentStep: "gradeResponse",
+ });
+ }
+ };
+
+ return (
+
+ {
+ form.setFieldValue("planTypeName", label);
+ }}
+ />
+ ),
+ },
+ { name: "planTypeName", label: "预案类型名称", onlyForLabel: true },
+ { name: "planCode", label: "预案编码" },
+ {
+ name: "planLevel",
+ label: "预案等级",
+ render: (
+ {
+ form.setFieldValue("planLevelName", label);
+ }}
+ />
+ ),
+ },
+ { name: "planLevelName", label: "预案等级名称", onlyForLabel: true },
+ {
+ name: "eventType",
+ label: "事件类型",
+ span: 24,
+ render: FORM_ITEM_RENDER_ENUM.CHECKBOX,
+ items: enterprisePlanEventType,
+ itemsField: { valueKey: "dictValue", labelKey: "dictLabel" },
+ componentProps: {
+ onChange: (value) => {
+ const eventTypeName = [];
+ for (let i = 0; i < value.length; i++) {
+ eventTypeName.push(getLabelName({
+ list: enterprisePlanEventType,
+ status: value[i],
+ nameKey: "dictLabel",
+ idKey: "dictValue",
+ }));
+ }
+ form.setFieldValue("eventTypeName", eventTypeName);
+ },
+ },
+ },
+ { name: "eventTypeName", label: "事件类型名称", onlyForLabel: true },
+ { key: "map", customizeRender: true, span: 24, render: () },
+ { name: "planOverview", label: "预案概述", span: 24, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
+ { name: "remarks", label: "备注", span: 24, render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
+ ]}
+ form={form}
+ onFinish={onSubmit}
+ />
+
+ );
+}
+
+export default Connect([NS_ENTERPRISE_PLAN], true)(BasicInfo);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/GradeResponse/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/GradeResponse/index.js
new file mode 100644
index 0000000..a859f9c
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/GradeResponse/index.js
@@ -0,0 +1,161 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, message, Modal, Space } from "antd";
+import { useEffect, useState } from "react";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import AddIcon from "zy-react-library/components/Icon/AddIcon";
+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_ENTERPRISE_PLAN } from "~/enumerate/namespace";
+
+function GradeResponse(props) {
+ const [addModalVisible, setAddModalVisible] = useState(false);
+ const [currentId, setCurrentId] = useState("");
+
+ const { tableProps, getData } = useTable(props["enterprisePlanLevelResponseList"], {
+ params: {
+ likePlanId: props.planId,
+ },
+ useStorageQueryCriteria: false,
+ onSuccess: () => {
+ props.setResponseLevelRefresh(true);
+ },
+ });
+
+ const onDelete = (id) => {
+ Modal.confirm({
+ title: "删除确认",
+ content: "确定要删除吗?",
+ onOk: async () => {
+ const { success } = await props["enterprisePlanLevelResponseDelete"]({ id });
+ if (success) {
+ message.success("删除成功");
+ getData();
+ }
+ },
+ });
+ };
+
+ return (
+
+
(
+ )}
+ onClick={() => {
+ setAddModalVisible(true);
+ }}
+ >
+ 新增
+
+ )}
+ columns={[
+ { title: "分级名称", dataIndex: "levelName" },
+ { title: "分级描述", dataIndex: "levelDescription" },
+ { title: "备注信息", dataIndex: "remarks" },
+ {
+ title: "操作",
+ width: 150,
+ fixed: "right",
+ render: (_, record) => (
+
+
+
+
+ ),
+ },
+ ]}
+ options={false}
+ {...tableProps}
+ />
+ {
+ addModalVisible && (
+ {
+ setAddModalVisible(false);
+ setCurrentId("");
+ }}
+ id={currentId}
+ planId={props.planId}
+ getData={getData}
+ />
+ )
+ }
+
+ );
+}
+
+const AddModalComponent = (props) => {
+ const [form] = FormBuilder.useForm();
+
+ const getData = async () => {
+ if (!props.id)
+ return;
+
+ const { data } = await props["enterprisePlanLevelResponseInfo"]({ id: props.id });
+ form.setFieldsValue(data);
+ };
+
+ useEffect(() => {
+ getData();
+ }, []);
+
+ const onSubmit = async (values) => {
+ const { success } = await props[!props.id ? "enterprisePlanLevelResponseAdd" : "enterprisePlanLevelResponseUpdate"]({
+ ...values,
+ id: props.id,
+ planId: props.planId,
+ });
+ if (success) {
+ message.success("操作成功");
+ props.onCancel();
+ props.getData();
+ }
+ };
+
+ return (
+
+
+
+ );
+};
+
+const AddModal = Connect([NS_ENTERPRISE_PLAN], true)(AddModalComponent);
+export default Connect([NS_ENTERPRISE_PLAN], true)(GradeResponse);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/OrganizationStructure/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/OrganizationStructure/index.js
new file mode 100644
index 0000000..0e1f44a
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/OrganizationStructure/index.js
@@ -0,0 +1,366 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, message, Modal, Space, Tag } from "antd";
+import { useEffect, useState } from "react";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import AddIcon from "zy-react-library/components/Icon/AddIcon";
+import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
+import EditIcon from "zy-react-library/components/Icon/EditIcon";
+import BasicLeftTree from "zy-react-library/components/LeftTree/Basic";
+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 { PHONE } from "zy-react-library/regular";
+import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
+
+const defaultParentId = 0;
+const defaultParentName = "(无)此项为顶级分组";
+const addModalTypeNames = {
+ add: "新增",
+ update: "编辑",
+ addChild: "添加下级",
+};
+
+function OrganizationStructure(props) {
+ const [treeList, setTreeList] = useState([]);
+
+ const [parentId, setParentId] = useState(defaultParentId);
+ const [parentName, setParentName] = useState(defaultParentName);
+ const [currentOrganization, setCurrentOrganization] = useState({});
+ const [currentOrganizationId, setCurrentOrganizationId] = useState("");
+ const [addOrganizationModalVisible, setAddOrganizationModalVisible] = useState(false);
+ const [addOrganizationModalType, setAddOrganizationModalType] = useState("");
+
+ const [currentOrganizationPersonnelId, setCurrentOrganizationPersonnelId] = useState("");
+ const [addOrganizationPersonnelModalVisible, setAddOrganizationPersonnelModalVisible] = useState(false);
+
+ const { tableProps, getData } = useTable(props["enterprisePlanOrganizationPersonnelList"], {
+ params: { planId: props.planId, organizationId: currentOrganization.id },
+ useStorageQueryCriteria: false,
+ manual: true,
+ });
+
+ const getTreeList = async () => {
+ const { data } = await props["enterprisePlanLevelOrganizationListTree"]({ planId: props.planId });
+ setTreeList(data);
+ props.setExecutingAgencyRefresh(true);
+ };
+
+ useEffect(() => {
+ getTreeList();
+ }, []);
+
+ const onDeleteOrganization = () => {
+ Modal.confirm({
+ title: "删除确认",
+ content: "确定要删除该组织吗?",
+ onOk: async () => {
+ const { success } = await props["enterprisePlanLevelOrganizationDelete"]({ id: currentOrganization.id });
+ if (success) {
+ message.success("删除成功");
+ getTreeList();
+ setCurrentOrganization({});
+ }
+ },
+ });
+ };
+
+ const onDeleteOrganizationPersonnel = (id) => {
+ Modal.confirm({
+ title: "删除确认",
+ content: "确定要删除该人员吗?",
+ onOk: async () => {
+ const { success } = await props["enterprisePlanOrganizationPersonnelDelete"]({ id });
+ if (success) {
+ message.success("删除成功");
+ getData();
+ }
+ },
+ });
+ };
+
+ return (
+
+
+
+
+ )}
+ onClick={() => {
+ setAddOrganizationModalVisible(true);
+ setAddOrganizationModalType("add");
+ }}
+ >
+ 新增一级
+
+ )}
+ disabled={Object.keys(currentOrganization).length === 0}
+ onClick={() => {
+ setAddOrganizationModalVisible(true);
+ setAddOrganizationModalType("addChild");
+ setParentId(currentOrganization.id);
+ setParentName(currentOrganization.orgName);
+ }}
+ >
+ 新增下级
+
+ )}
+ disabled={Object.keys(currentOrganization).length === 0}
+ onClick={() => {
+ setAddOrganizationModalVisible(true);
+ setAddOrganizationModalType("update");
+ setParentId(currentOrganization.parentId);
+ setParentName(currentOrganization.parentName);
+ setCurrentOrganizationId(currentOrganization.id);
+ }}
+ >
+ 编辑
+
+ )}
+ disabled={Object.keys(currentOrganization).length === 0 || currentOrganization.children || tableProps.dataSource.length > 0}
+ onClick={onDeleteOrganization}
+ >
+ 删除
+
+
+ {
+ const currentNode = nodes.at(-1);
+ setCurrentOrganization(currentNode);
+ getData();
+ }}
+ />
+
+
+
(
+ )}
+ disabled={Object.keys(currentOrganization).length === 0}
+ onClick={() => {
+ setAddOrganizationPersonnelModalVisible(true);
+ }}
+ >
+ 新增人员
+
+ )}
+ options={false}
+ columns={[
+ { title: "姓名", dataIndex: "userName" },
+ { title: "职务", dataIndex: "position" },
+ { title: "组内岗位", dataIndex: "groupPost" },
+ { title: "联系电话", dataIndex: "contactPhone" },
+ { title: "紧急联系电话", dataIndex: "emergencyContactPhone" },
+ {
+ title: "操作",
+ width: 150,
+ fixed: "right",
+ render: (_, record) => (
+
+
+
+
+ ),
+ },
+ ]}
+ {...tableProps}
+ />
+
+
+ {
+ addOrganizationModalVisible && (
+ {
+ setAddOrganizationModalVisible(false);
+ setParentId(defaultParentId);
+ setParentName(defaultParentName);
+ setCurrentOrganizationId("");
+ setAddOrganizationModalType("");
+ }}
+ id={currentOrganizationId}
+ planId={props.planId}
+ getData={getTreeList}
+ parentId={parentId}
+ parentName={parentName}
+ addModalType={addOrganizationModalType}
+ />
+ )
+ }
+ {
+ addOrganizationPersonnelModalVisible && (
+ {
+ setAddOrganizationPersonnelModalVisible(false);
+ setCurrentOrganizationPersonnelId("");
+ }}
+ id={currentOrganizationPersonnelId}
+ organizationId={currentOrganization.id}
+ organizationName={currentOrganization.orgName}
+ planId={props.planId}
+ getData={getData}
+ />
+ )
+ }
+
+ );
+}
+
+const AddOrganizationModalComponent = (props) => {
+ const [form] = FormBuilder.useForm();
+
+ const getData = async () => {
+ if (!props.id)
+ return;
+
+ const { data } = await props["enterprisePlanLevelOrganizationInfo"]({ id: props.id });
+ form.setFieldsValue(data);
+ };
+
+ useEffect(() => {
+ getData();
+ }, []);
+
+ const onSubmit = async (values) => {
+ const { success } = await props[!props.id ? "enterprisePlanLevelOrganizationAdd" : "enterprisePlanLevelOrganizationUpdate"]({
+ ...values,
+ id: props.id,
+ planId: props.planId,
+ parentId: props.parentId,
+ parentName: props.parentName,
+ });
+ if (success) {
+ message.success(`${addModalTypeNames[props.addModalType]}成功`);
+ props.onCancel();
+ props.getData();
+ }
+ };
+
+ return (
+
+ {props.addModalType === "add" ? defaultParentName : props.parentName}),
+ },
+ { name: "orgName", label: "名称" },
+ { name: "orgNameEn", label: "英文名称" },
+ { name: "orgCode", label: "编码" },
+ { name: "leaderName", label: "负责人" },
+ { name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
+ { name: "departmentFunction", label: "部门职能", required: false },
+ { name: "address", label: "地址", required: false },
+ { name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
+ ]}
+ form={form}
+ onFinish={onSubmit}
+ />
+
+ );
+};
+
+const AddOrganizationPersonnelModalComponent = (props) => {
+ const [form] = FormBuilder.useForm();
+
+ const getData = async () => {
+ if (!props.id)
+ return;
+
+ const { data } = await props["enterprisePlanOrganizationPersonnelInfo"]({ id: props.id });
+ form.setFieldsValue(data);
+ };
+
+ useEffect(() => {
+ getData();
+ }, []);
+
+ const onSubmit = async (values) => {
+ const { success } = await props[!props.id ? "enterprisePlanOrganizationPersonnelAdd" : "enterprisePlanOrganizationPersonnelUpdate"]({
+ ...values,
+ id: props.id,
+ planId: props.planId,
+ organizationId: props.organizationId,
+ });
+ if (success) {
+ message.success(`${props.id ? "编辑" : "添加"}成功`);
+ props.onCancel();
+ props.getData();
+ }
+ };
+
+ return (
+
+ {props.organizationName}),
+ },
+ { name: "userName", label: "姓名" },
+ { name: "position", label: "职务" },
+ { name: "groupPost", label: "组内岗位", required: false },
+ { name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
+ { name: "emergencyContactPhone", label: "紧急联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
+ ]}
+ form={form}
+ onFinish={onSubmit}
+ />
+
+ );
+};
+
+const AddOrganizationModal = Connect([NS_ENTERPRISE_PLAN], true)(AddOrganizationModalComponent);
+const AddOrganizationPersonnelModal = Connect([NS_ENTERPRISE_PLAN], true)(AddOrganizationPersonnelModalComponent);
+export default Connect([NS_ENTERPRISE_PLAN], true)(OrganizationStructure);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanAttachments/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanAttachments/index.js
new file mode 100644
index 0000000..8cfe245
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanAttachments/index.js
@@ -0,0 +1,226 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, message, Modal, Space } from "antd";
+import dayjs from "dayjs";
+import { useEffect, useRef, useState } from "react";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import AddIcon from "zy-react-library/components/Icon/AddIcon";
+import DictionarySelect from "zy-react-library/components/Select/Dictionary";
+import Table from "zy-react-library/components/Table";
+import Upload from "zy-react-library/components/Upload";
+import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
+import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
+import useDownloadFile from "zy-react-library/hooks/useDownloadFile";
+import useGetFile from "zy-react-library/hooks/useGetFile";
+import useTable from "zy-react-library/hooks/useTable";
+import useUploadFile from "zy-react-library/hooks/useUploadFile";
+import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
+
+function PlanAttachments(props) {
+ const { loading: getFileLoading, getFile } = useGetFile();
+ const { loading: downloadFileLoading, downloadFile } = useDownloadFile();
+
+ const [addModalVisible, setAddModalVisible] = useState(false);
+ const [currentId, setCurrentId] = useState("");
+
+ const { tableProps, getData } = useTable(props["enterprisePlanAttachmentList"], {
+ params: {
+ likePlanId: props.planId,
+ },
+ useStorageQueryCriteria: false,
+ });
+
+ const onDelete = (id) => {
+ Modal.confirm({
+ title: "删除确认",
+ content: "确定要删除吗?",
+ onOk: async () => {
+ const { success } = await props["enterprisePlanAttachmentDelete"]({ id });
+ if (success) {
+ message.success("删除成功");
+ getData();
+ }
+ },
+ });
+ };
+
+ return (
+
+
(
+ )}
+ onClick={() => {
+ setAddModalVisible(true);
+ }}
+ >
+ 新增
+
+ )}
+ options={false}
+ columns={[
+ { title: "文件名称", dataIndex: "fileName" },
+ { title: "附件类型", dataIndex: "attachmentTypeName" },
+ { title: "备注", dataIndex: "remarks" },
+ {
+ title: "维护日期",
+ dataIndex: "createTime",
+ render: (_, record) => dayjs(record.updateTime || record.createTime).format("YYYY-MM-DD HH:mm:ss"),
+ },
+ {
+ title: "操作",
+ width: 150,
+ fixed: "right",
+ render: (_, record) => (
+
+
+
+
+
+ ),
+ },
+ ]}
+ {...tableProps}
+ loading={tableProps.loading || getFileLoading || downloadFileLoading}
+ />
+ {
+ addModalVisible && (
+ {
+ setAddModalVisible(false);
+ setCurrentId("");
+ }}
+ id={currentId}
+ planId={props.planId}
+ getData={getData}
+ />
+ )
+ }
+
+ );
+}
+
+const AddModalComponent = (props) => {
+ const [form] = FormBuilder.useForm();
+ const { loading: getFileLoading, getFile } = useGetFile();
+ const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
+ const { loading: uploadFileLoading, uploadFile } = useUploadFile();
+
+ const fileIdRef = useRef("");
+
+ const getData = async () => {
+ if (!props.id)
+ return;
+
+ const { data } = await props["enterprisePlanAttachmentInfo"]({ id: props.id });
+ fileIdRef.current = data.fileId;
+ const files = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[702], eqForeignKey: data.fileId });
+ form.setFieldsValue({
+ ...data,
+ files,
+ });
+ };
+
+ useEffect(() => {
+ getData();
+ }, []);
+
+ const onSubmit = async (values) => {
+ await deleteFile({ single: false, files: values.deleteFiles });
+ const { id: fileId } = await uploadFile({
+ single: false,
+ files: values.files,
+ params: { type: UPLOAD_FILE_TYPE_ENUM[702], foreignKey: fileIdRef.current },
+ });
+ const { success } = await props[!props.id ? "enterprisePlanAttachmentAdd" : "enterprisePlanAttachmentUpdate"]({
+ ...values,
+ fileId,
+ id: props.id,
+ planId: props.planId,
+ });
+ if (success) {
+ message.success("操作成功");
+ props.onCancel();
+ props.getData();
+ }
+ };
+
+ return (
+
+ {
+ form.setFieldValue("attachmentTypeName", label);
+ }}
+ />
+ ),
+ },
+ { name: "attachmentTypeName", label: "附件类型名称", onlyForLabel: true },
+ { name: "remarks", label: "备注", required: false },
+ {
+ name: "files",
+ label: "附件",
+ render: (
+ {
+ form.setFieldValue("deleteFiles", [...(form.getFieldValue("deleteFiles") || []), file]);
+ }}
+ />
+ ),
+ },
+ { name: "deleteFiles", label: "删除的附件", onlyForLabel: true },
+ ]}
+ form={form}
+ onFinish={onSubmit}
+ />
+
+ );
+};
+
+const AddModal = Connect([NS_ENTERPRISE_PLAN], true)(AddModalComponent);
+export default Connect([NS_ENTERPRISE_PLAN], true)(PlanAttachments);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanInstructions/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanInstructions/index.js
new file mode 100644
index 0000000..672dcdc
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanInstructions/index.js
@@ -0,0 +1,206 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, Divider, message, Modal, Space } from "antd";
+import { useEffect, useRef, useState } from "react";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import BasicSelectTree from "zy-react-library/components/SelectTree/Basic";
+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 { getLabelName } from "zy-react-library/utils";
+import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
+
+function PlanInstructions(props) {
+ const [form] = FormBuilder.useForm();
+
+ const [responseLevelList, setResponseLevelList] = useState([]);
+ const [executingAgencyListTree, setExecutingAgencyListTree] = useState([]);
+ const isEditCommandIdRef = useRef("");
+
+ const { tableProps, getData } = useTable(props["enterprisePlanCommandSettingList"], {
+ params: {
+ likePlanId: props.planId,
+ },
+ useStorageQueryCriteria: false,
+ });
+
+ const getResponseLevelList = async () => {
+ if (!props.responseLevelRefresh)
+ return;
+
+ const { data } = await props["enterprisePlanLevelResponseListAll"]({ planId: props.planId });
+ setResponseLevelList(data);
+ props.setResponseLevelRefresh(false);
+ };
+
+ const getTreeList = async () => {
+ if (!props.executingAgencyRefresh)
+ return;
+
+ const { data } = await props["enterprisePlanLevelOrganizationListTree"]({ planId: props.planId });
+ setExecutingAgencyListTree(data);
+ props.setExecutingAgencyRefresh(false);
+ };
+
+ useEffect(() => {
+ getTreeList();
+ }, [props.executingAgencyRefresh]);
+
+ useEffect(() => {
+ getResponseLevelList();
+ }, [props.responseLevelRefresh]);
+
+ const onSubmit = async (values) => {
+ const { success } = await props[!isEditCommandIdRef.current ? "enterprisePlanCommandSettingAdd" : "enterprisePlanCommandSettingUpdate"]({
+ ...values,
+ responseLevel: values.responseLevel.join(","),
+ responseLevelName: values.responseLevelName.join(","),
+ executingAgencyId: values.executingAgencyId.join(","),
+ executingAgencyName: values.executingAgencyName.join(","),
+ planId: props.planId,
+ id: isEditCommandIdRef.current,
+ });
+ if (success) {
+ message.success(`${isEditCommandIdRef.current ? "编辑" : "添加"}成功`);
+ form.resetFields();
+ getData();
+ isEditCommandIdRef.current = "";
+ }
+ };
+
+ const onDelete = (id) => {
+ Modal.confirm({
+ title: "删除指令",
+ content: "确定要删除该指令吗?",
+ onOk: async () => {
+ const { success } = await props["enterprisePlanCommandSettingDelete"]({ id });
+ if (success) {
+ message.success("删除成功");
+ form.resetFields();
+ getData();
+ isEditCommandIdRef.current = "";
+ }
+ },
+ });
+ };
+
+ return (
+
+
+ {
+ const responseLevelName = [];
+ for (let i = 0; i < values.length; i++) {
+ responseLevelName.push(getLabelName({
+ list: responseLevelList,
+ status: values[i],
+ idKey: "id",
+ nameKey: "levelName",
+ }));
+ }
+ form.setFieldValue("responseLevelName", responseLevelName);
+ },
+ },
+ },
+ { name: "responseLevelName", label: "响应级别名称", onlyForLabel: true },
+ { name: "commandContent", label: "指令内容", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
+ {
+ name: "executingAgencyId",
+ label: "执行机构",
+ render: (
+ {
+ form.setFieldValue("executingAgencyName", label);
+ }}
+ />
+ ),
+ },
+ { name: "executingAgencyName", label: "执行机构名称", onlyForLabel: true },
+ ]}
+ form={form}
+ onFinish={onSubmit}
+ />
+
+
+
+
+
+
+
指令列表
+
(
+
+
+
+
+ ),
+ },
+ ]}
+ {...tableProps}
+ />
+
+
+ );
+}
+
+export default Connect([NS_ENTERPRISE_PLAN], true)(PlanInstructions);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanResources/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanResources/index.js
new file mode 100644
index 0000000..fce8af0
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanResources/index.js
@@ -0,0 +1,237 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, Descriptions, message, Modal, Space } from "antd";
+import { useEffect, useState } from "react";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import AddIcon from "zy-react-library/components/Icon/AddIcon";
+import Map from "zy-react-library/components/Map";
+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 { PHONE } from "zy-react-library/regular";
+import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
+
+function GradeResponse(props) {
+ const [addModalVisible, setAddModalVisible] = useState(false);
+ const [viewModalVisible, setViewModalVisible] = useState(false);
+ const [currentId, setCurrentId] = useState("");
+
+ const { tableProps, getData } = useTable(props["enterprisePlanResourceList"], {
+ params: {
+ likePlanId: props.planId,
+ },
+ useStorageQueryCriteria: false,
+ });
+
+ const onDelete = (id) => {
+ Modal.confirm({
+ title: "删除确认",
+ content: "确定要删除吗?",
+ onOk: async () => {
+ const { success } = await props["enterprisePlanResourceDelete"]({ id });
+ if (success) {
+ message.success("删除成功");
+ getData();
+ }
+ },
+ });
+ };
+
+ return (
+
+
(
+ )}
+ onClick={() => {
+ setAddModalVisible(true);
+ }}
+ >
+ 新增
+
+ )}
+ columns={[
+ { title: "资源类型", dataIndex: "resourceType" },
+ { title: "资源名称", dataIndex: "resourceName" },
+ { title: "资源地址", dataIndex: "resourceAddress" },
+ { title: "资源数量", dataIndex: "resourceQuantity" },
+ { title: "联系人", dataIndex: "contactPerson" },
+ { title: "电话", dataIndex: "contactPhone" },
+ {
+ title: "操作",
+ width: 150,
+ fixed: "right",
+ render: (_, record) => (
+
+
+
+
+
+ ),
+ },
+ ]}
+ options={false}
+ {...tableProps}
+ />
+ {
+ addModalVisible && (
+ {
+ setAddModalVisible(false);
+ setCurrentId("");
+ }}
+ id={currentId}
+ planId={props.planId}
+ getData={getData}
+ />
+ )
+ }
+ {
+ viewModalVisible && (
+ {
+ setViewModalVisible(false);
+ setCurrentId("");
+ }}
+ id={currentId}
+ />
+ )
+ }
+
+ );
+}
+
+const AddModalComponent = (props) => {
+ const [form] = FormBuilder.useForm();
+
+ const getData = async () => {
+ if (!props.id)
+ return;
+
+ const { data } = await props["enterprisePlanResourceInfo"]({ id: props.id });
+ form.setFieldsValue(data);
+ };
+
+ useEffect(() => {
+ getData();
+ }, []);
+
+ const onSubmit = async (values) => {
+ const { success } = await props[!props.id ? "enterprisePlanResourceAdd" : "enterprisePlanResourceUpdate"]({
+ ...values,
+ id: props.id,
+ planId: props.planId,
+ });
+ if (success) {
+ message.success("操作成功");
+ props.onCancel();
+ props.getData();
+ }
+ };
+
+ return (
+
+ ) },
+ ]}
+ form={form}
+ onFinish={onSubmit}
+ />
+
+ );
+};
+
+const ViewModalComponent = (props) => {
+ const [info, setInfo] = useState({});
+
+ const getData = async () => {
+ const { data } = await props["enterprisePlanResourceInfo"]({ id: props.id });
+ setInfo(data);
+ };
+
+ useEffect(() => {
+ getData();
+ }, []);
+
+ return (
+ 取消,
+ ]}
+ loading={props.enterprisePlan.enterprisePlanResourceLoading}
+ >
+
+
+ );
+};
+
+const AddModal = Connect([NS_ENTERPRISE_PLAN], true)(AddModalComponent);
+const ViewModal = Connect([NS_ENTERPRISE_PLAN], true)(ViewModalComponent);
+export default Connect([NS_ENTERPRISE_PLAN], true)(GradeResponse);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanText/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanText/index.js
new file mode 100644
index 0000000..c848bb1
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/components/PlanText/index.js
@@ -0,0 +1,38 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { message } from "antd";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
+import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
+
+function PlanText(props) {
+ const [form] = FormBuilder.useForm();
+
+ const onSubmit = async (values) => {
+ const { success } = await props["enterprisePlanBasicInfoUpdate"]({
+ ...values,
+ id: props.planId,
+ });
+ if (success) {
+ message.success("保存成功");
+ props.setUrlState({ currentStep: "planAttachments" });
+ }
+ };
+
+ return (
+
+ );
+}
+
+export default Connect([NS_ENTERPRISE_PLAN], true)(PlanText);
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/index.js
new file mode 100644
index 0000000..1117d2d
--- /dev/null
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/Add/index.js
@@ -0,0 +1,245 @@
+import useUrlState from "@ahooksjs/use-url-state";
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, message, Modal, Space, Tabs } from "antd";
+import { useEffect, useState } from "react";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import Page from "zy-react-library/components/Page";
+import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
+import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
+import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
+import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
+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 Add(props) {
+ const query = useGetUrlQuery();
+ const [urlState, setUrlState] = useUrlState(
+ {
+ currentStep: "basicInfo",
+ planId: query.id,
+ planName: query.planName,
+ },
+ { navigateMode: "replace" },
+ );
+
+ const [responseLevelRefresh, setResponseLevelRefresh] = useState(true);
+ const [executingAgencyRefresh, setExecutingAgencyRefresh] = useState(true);
+ const [reviewPersonModalVisible, setReviewPersonModalVisible] = useState(false);
+
+ const subordinateTabDisabled = !urlState.planId;
+ const isShowFooter = ["basicInfo", "planText"].includes(urlState.currentStep);
+
+ const previousStep = () => {
+ const stepMapping = {
+ gradeResponse: "basicInfo",
+ organizationStructure: "gradeResponse",
+ planResources: "organizationStructure",
+ planInstructions: "planResources",
+ planText: "planInstructions",
+ planAttachments: "planText",
+ };
+
+ const prevStep = stepMapping[urlState.currentStep];
+ if (prevStep)
+ setUrlState({ currentStep: prevStep });
+ };
+
+ const nextStep = () => {
+ const stepFlow = {
+ gradeResponse: "organizationStructure",
+ organizationStructure: "planResources",
+ planResources: "planInstructions",
+ planInstructions: "planText",
+ };
+
+ if (urlState.currentStep === "planText") {
+ return;
+ }
+
+ if (urlState.currentStep === "planAttachments") {
+ setReviewPersonModalVisible(true);
+ return;
+ }
+
+ const nextStep = stepFlow[urlState.currentStep];
+ if (nextStep) {
+ setUrlState({ currentStep: nextStep });
+ }
+ };
+
+ return (
+
+
+
+
+ )}
+ >
+ setUrlState({ currentStep: key })}
+ items={[
+ {
+ key: "basicInfo",
+ label: "基本信息",
+ children: (
+
+ ),
+ },
+ {
+ key: "gradeResponse",
+ label: "分级响应",
+ children: (
+
+ ),
+ disabled: subordinateTabDisabled,
+ },
+ {
+ key: "organizationStructure",
+ label: "组织结构",
+ children: (
+
+ ),
+ disabled: subordinateTabDisabled,
+ },
+ {
+ key: "planResources",
+ label: "预案资源",
+ children: (),
+ disabled: subordinateTabDisabled,
+ },
+ {
+ key: "planInstructions",
+ label: "预案指令",
+ children: (
+
+ ),
+ disabled: subordinateTabDisabled,
+ },
+ {
+ key: "planText",
+ label: "预案文案",
+ children: (
+
+ ),
+ disabled: subordinateTabDisabled,
+ },
+ {
+ key: "planAttachments",
+ label: "预案附件",
+ children: (),
+ disabled: subordinateTabDisabled,
+ },
+ ]}
+ />
+ {
+ reviewPersonModalVisible && (
+ setReviewPersonModalVisible(false)}
+ planId={urlState.planId}
+ goBack={props.history.goBack}
+ />
+ )
+ }
+
+ );
+}
+
+const ReviewPersonModalComponent = (props) => {
+ const [form] = FormBuilder.useForm();
+
+ const [userInfo, setUserInfo] = useState({});
+
+ const { getUserInfo } = useGetUserInfo();
+
+ useEffect(() => {
+ (async () => {
+ const userInfo = await getUserInfo();
+ setUserInfo(userInfo);
+ })();
+ }, []);
+
+ const onSubmit = async (values) => {
+ const { success } = await props["enterprisePlanBasicInfoUpdate"]({
+ ...values,
+ id: props.planId,
+ });
+ if (success) {
+ message.success("保存成功");
+ props.onCancel();
+ props.goBack();
+ }
+ };
+
+ return (
+
+ {
+ form.setFieldValue("auditUserName", option.name);
+ form.setFieldValue("auditCorpId", option.corpinfoId);
+ form.setFieldValue("auditCorpName", option.corpinfoName);
+ form.setFieldValue("auditDeptId", option.departmentId);
+ form.setFieldValue("auditDeptName", option.departmentName);
+ }}
+ />
+ ) },
+ { name: "auditUserName", label: "审核人员名称", onlyForLabel: true },
+ { name: "auditCorpId", label: "审核人企业ID", onlyForLabel: true },
+ { name: "auditCorpName", label: "审核人企业名称", onlyForLabel: true },
+ { name: "auditDeptId", label: "审核人部门ID", onlyForLabel: true },
+ { name: "auditDeptName", label: "审核人部门名称", onlyForLabel: true },
+ ]}
+ form={form}
+ onFinish={onSubmit}
+ />
+
+ );
+};
+
+const ReviewPersonModal = Connect([NS_ENTERPRISE_PLAN], true)(ReviewPersonModalComponent);
+export default Add;
diff --git a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/List/index.js b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/List/index.js
index d6ce256..8741878 100644
--- a/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/List/index.js
+++ b/src/pages/Container/Enterprise/PlanAndDrill/EnterprisePlan/List/index.js
@@ -1,9 +1,111 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, message, Modal, Space } from "antd";
+import AddIcon from "zy-react-library/components/Icon/AddIcon";
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 useTable from "zy-react-library/hooks/useTable";
+import { getLabelName } from "zy-react-library/utils";
+import { ENTERPRISE_PLAN_AUDIT_STATUS_ENUM } from "~/enumerate/constant";
+import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
function List(props) {
+ const [form] = Search.useForm();
+
+ const { tableProps, getData } = useTable(props["enterprisePlanBasicInfoList"], {
+ form,
+ });
+
+ const onDelete = (record) => {
+ Modal.confirm({
+ title: "删除确认",
+ content: `确定要删除【${record.planName}】吗`,
+ onOk: async () => {
+ const { success } = await props["enterprisePlanBasicInfoDelete"]({ id: record.id });
+ if (success) {
+ message.success("删除成功");
+ getData();
+ }
+ },
+ });
+ };
+
return (
-
+
+
+ (
+
+ )}
+ onClick={() => {
+ props.history.push("./add");
+ }}
+ >
+ 新增
+
+
+ )}
+ columns={[
+ { title: "预案名称", dataIndex: "planName" },
+ { title: "预案编码", dataIndex: "planCode" },
+ { title: "审核人", dataIndex: "auditUserName" },
+ { title: "预案概述", dataIndex: "planOverview" },
+ {
+ title: "审核状态",
+ dataIndex: "auditFlag",
+ render: (_, record) => getLabelName({ list: ENTERPRISE_PLAN_AUDIT_STATUS_ENUM, status: record.auditFlag }) || "暂存",
+ },
+ {
+ title: "操作",
+ width: 150,
+ fixed: "right",
+ render: (_, record) => (
+
+
+ {(!record.auditFlag || record.auditFlag !== 3) && (
+
+ )}
+ {(!record.auditFlag || record.auditFlag !== 3) && (
+
+ )}
+
+ ),
+ },
+ ]}
+ {...tableProps}
+ />
+
);
}
-export default List;
+export default Connect([NS_ENTERPRISE_PLAN], true)(List);