parent
d1b1eee4dd
commit
36803e7362
|
|
@ -24,3 +24,103 @@ export const emergencyExerciseDeleteBatch = declareRequest(
|
||||||
"emergencyExerciseLoading",
|
"emergencyExerciseLoading",
|
||||||
"Delete > @/emergencyRescue/emergencyDrill/ids?ids={ids}",
|
"Delete > @/emergencyRescue/emergencyDrill/ids?ids={ids}",
|
||||||
);
|
);
|
||||||
|
export const emergencyExerciseOrganizationList = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyDrillOrganization/list",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationListAll = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationLoading",
|
||||||
|
"Get > /emergencyRescue/emergencyDrillOrganization/listAll",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationInfo = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationLoading",
|
||||||
|
"Get > /emergencyRescue/emergencyDrillOrganization/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationAdd = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyDrillOrganization/save",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationUpdate = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationLoading",
|
||||||
|
"Put > @/emergencyRescue/emergencyDrillOrganization/edit",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationDelete = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyDrillOrganization/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationDeleteBatch = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyDrillOrganization/ids?ids={ids}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationPersonnelList = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationPersonnelLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyDrillOrganizationPersonnel/list",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationPersonnelInfo = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationPersonnelLoading",
|
||||||
|
"Get > /emergencyRescue/emergencyDrillOrganizationPersonnel/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationPersonnelAdd = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationPersonnelLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyDrillOrganizationPersonnel/save",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationPersonnelUpdate = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationPersonnelLoading",
|
||||||
|
"Put > @/emergencyRescue/emergencyDrillOrganizationPersonnel/edit",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationPersonnelDelete = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationPersonnelLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyDrillOrganizationPersonnel/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseOrganizationPersonnelDeleteBatch = declareRequest(
|
||||||
|
"emergencyExerciseOrganizationPersonnelLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyDrillOrganizationPersonnel/ids?ids={ids}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseContentList = declareRequest(
|
||||||
|
"emergencyExerciseContentLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyDrillContent/list",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseContentInfo = declareRequest(
|
||||||
|
"emergencyExerciseContentLoading",
|
||||||
|
"Get > /emergencyRescue/emergencyDrillContent/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseContentAdd = declareRequest(
|
||||||
|
"emergencyExerciseContentLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyDrillContent/save",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseContentUpdate = declareRequest(
|
||||||
|
"emergencyExerciseContentLoading",
|
||||||
|
"Put > @/emergencyRescue/emergencyDrillContent/edit",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseContentDelete = declareRequest(
|
||||||
|
"emergencyExerciseContentLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyDrillContent/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseContentDeleteBatch = declareRequest(
|
||||||
|
"emergencyExerciseContentLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyDrillContent/ids?ids={ids}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseScenarioList = declareRequest(
|
||||||
|
"emergencyExerciseScenarioLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyDrillScenario/list",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseScenarioInfo = declareRequest(
|
||||||
|
"emergencyExerciseScenarioLoading",
|
||||||
|
"Get > /emergencyRescue/emergencyDrillScenario/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseScenarioAdd = declareRequest(
|
||||||
|
"emergencyExerciseScenarioLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyDrillScenario/save",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseScenarioUpdate = declareRequest(
|
||||||
|
"emergencyExerciseScenarioLoading",
|
||||||
|
"Put > @/emergencyRescue/emergencyDrillScenario/edit",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseScenarioDelete = declareRequest(
|
||||||
|
"emergencyExerciseScenarioLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyDrillScenario/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyExerciseScenarioDeleteBatch = declareRequest(
|
||||||
|
"emergencyExerciseScenarioLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyDrillScenario/ids?ids={ids}",
|
||||||
|
);
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["emergencyAddressBookList"], {
|
const { tableProps, getData } = useTable(props["emergencyAddressBookList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
usePagination: false,
|
usePagination: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["expertEmergencyRescueExpertList"], {
|
const { tableProps, getData } = useTable(props["expertEmergencyRescueExpertList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["expertEmergencyRescueExpertGroupList"], {
|
const { tableProps, getData } = useTable(props["expertEmergencyRescueExpertGroupList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["expertEmergencyRescueTeamList"], {
|
const { tableProps, getData } = useTable(props["expertEmergencyRescueTeamList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["enterpriseEmergencyOrganizationList"], {
|
const { tableProps, getData } = useTable(props["enterpriseEmergencyOrganizationList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["enterpriseEmergencyPersonnelList"], {
|
const { tableProps, getData } = useTable(props["enterpriseEmergencyPersonnelList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["emergencyRescueTeamList"], {
|
const { tableProps, getData } = useTable(props["emergencyRescueTeamList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["communicationGuaranteeOrganizationList"], {
|
const { tableProps, getData } = useTable(props["communicationGuaranteeOrganizationList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["medicalGuaranteeOrganizationList"], {
|
const { tableProps, getData } = useTable(props["medicalGuaranteeOrganizationList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["technicalSupportGuaranteeOrganizationList"], {
|
const { tableProps, getData } = useTable(props["technicalSupportGuaranteeOrganizationList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["transportGuaranteeOrganizationList"], {
|
const { tableProps, getData } = useTable(props["transportGuaranteeOrganizationList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["closedCardPortList"], {
|
const { tableProps, getData } = useTable(props["closedCardPortList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["drainageWellList"], {
|
const { tableProps, getData } = useTable(props["drainageWellList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["emergencyEquipmentList"], {
|
const { tableProps, getData } = useTable(props["emergencyEquipmentList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["emergencyShelterList"], {
|
const { tableProps, getData } = useTable(props["emergencyShelterList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function List(props) {
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["materialEquipmentList"], {
|
const { tableProps, getData } = useTable(props["materialEquipmentList"], {
|
||||||
form,
|
form,
|
||||||
params: {
|
params: { corpinfoId: query.corpinfoId },
|
||||||
corpinfoId: query.corpinfoId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onDelete = (record) => {
|
const onDelete = (record) => {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { message } from "antd";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import { NS_EMERGENCY_EXERCISE } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function BasicInfo(props) {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.setFieldsValue(props.basicInfo);
|
||||||
|
}, [props.basicInfo]);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success, data } = await props[!props.drillId ? "emergencyExerciseAdd" : "emergencyExerciseUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.drillId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("保存成功");
|
||||||
|
props.setUrlState({
|
||||||
|
drillId: data?.id || props.drillId,
|
||||||
|
currentStep: "commandOrganization",
|
||||||
|
});
|
||||||
|
props.getBasicInfo();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.emergencyExercise.emergencyExerciseLoading || props.getFileLoading}
|
||||||
|
submitButtonText="保存并下一步"
|
||||||
|
options={[
|
||||||
|
{ name: "drillName", label: "应急演练方案名称", span: 24 },
|
||||||
|
{ name: "drillUnit", label: "演练单位" },
|
||||||
|
{ name: "drillTime", label: "演练时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||||
|
{ name: "drillPurpose", label: "演练目的", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
||||||
|
{ name: "drillFeatures", label: "演练特点", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
||||||
|
{ name: "drillLocation", label: "应急演练地点" },
|
||||||
|
{ name: "participants", label: "参加人员" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(BasicInfo);
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Divider, 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 DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||||
|
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 { NS_EMERGENCY_EXERCISE } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function Institutional(props) {
|
||||||
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
const [addModalVisible, setAddModalVisible] = useState(false);
|
||||||
|
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["emergencyExerciseOrganizationList"], {
|
||||||
|
form,
|
||||||
|
params: { likeDrillId: props.drillId },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (record) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: `确定要删除【${record.orgName}】吗`,
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["emergencyExerciseOrganizationDelete"]({ 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["emergencyExerciseOrganizationDeleteBatch"]({ ids: selectedRowKeys });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Divider orientation="left">机构列表</Divider>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "orgName", label: "机构名称" },
|
||||||
|
]}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
rowSelection={{
|
||||||
|
preserveSelectedRowKeys: true,
|
||||||
|
selectedRowKeys,
|
||||||
|
onChange: (selectedRowKeys) => {
|
||||||
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
danger
|
||||||
|
ghost
|
||||||
|
icon={(<DeleteIcon />)}
|
||||||
|
onClick={onDeleteBatch}
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
{ title: "机构名称", dataIndex: "orgName" },
|
||||||
|
{ title: "组成单位", dataIndex: "constituentUnit" },
|
||||||
|
{ title: "机构职责", dataIndex: "orgDuties" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
setCurrentId(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
addModalVisible && (
|
||||||
|
<AddModal
|
||||||
|
id={currentId}
|
||||||
|
drillId={props.drillId}
|
||||||
|
onCancel={() => {
|
||||||
|
setAddModalVisible(false);
|
||||||
|
setCurrentId("");
|
||||||
|
}}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["emergencyExerciseOrganizationInfo"]({ id: props.id });
|
||||||
|
form.setFieldsValue(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!props.id ? "emergencyExerciseOrganizationAdd" : "emergencyExerciseOrganizationUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.id,
|
||||||
|
drillId: props.drillId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success(`${!props.id ? "新增" : "编辑"}成功`);
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={props.id ? "编辑" : "新增"}
|
||||||
|
width={600}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.emergencyExercise.emergencyExerciseOrganizationLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.emergencyExercise.emergencyExerciseOrganizationLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
options={[
|
||||||
|
{ name: "orgName", label: "机构名称" },
|
||||||
|
{ name: "constituentUnit", label: "组成单位" },
|
||||||
|
{ name: "orgDuties", label: "机构职责" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModal = Connect([NS_EMERGENCY_EXERCISE], true)(AddModalComponent);
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(Institutional);
|
||||||
|
|
@ -0,0 +1,232 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Divider, 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 DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||||
|
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 { PHONE } from "zy-react-library/regular";
|
||||||
|
import { NS_EMERGENCY_EXERCISE } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function InstitutionalPersonnel(props) {
|
||||||
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
const [addModalVisible, setAddModalVisible] = useState(false);
|
||||||
|
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["emergencyExerciseOrganizationPersonnelList"], {
|
||||||
|
form,
|
||||||
|
params: { likeDrillId: props.drillId },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (record) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: `确定要删除【${record.personName}】吗`,
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["emergencyExerciseOrganizationPersonnelDelete"]({ 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["emergencyExerciseOrganizationPersonnelDeleteBatch"]({ ids: selectedRowKeys });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Divider orientation="left">机构人员列表</Divider>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "personName", label: "人员姓名" },
|
||||||
|
]}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
rowSelection={{
|
||||||
|
preserveSelectedRowKeys: true,
|
||||||
|
selectedRowKeys,
|
||||||
|
onChange: (selectedRowKeys) => {
|
||||||
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
danger
|
||||||
|
ghost
|
||||||
|
icon={(<DeleteIcon />)}
|
||||||
|
onClick={onDeleteBatch}
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
{ title: "应急指挥机构", dataIndex: "orgName" },
|
||||||
|
{ title: "姓名", dataIndex: "personName" },
|
||||||
|
{ title: "单位", dataIndex: "unit" },
|
||||||
|
{ title: "职务", dataIndex: "position" },
|
||||||
|
{ title: "联系电话", dataIndex: "contactPhone" },
|
||||||
|
{ title: "紧急联系电话", dataIndex: "emergencyContactPhone" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
setCurrentId(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
addModalVisible && (
|
||||||
|
<AddModal
|
||||||
|
id={currentId}
|
||||||
|
drillId={props.drillId}
|
||||||
|
onCancel={() => {
|
||||||
|
setAddModalVisible(false);
|
||||||
|
setCurrentId("");
|
||||||
|
}}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const [organizationList, setOrganizationList] = useState([]);
|
||||||
|
|
||||||
|
const getOrganizationListAll = async () => {
|
||||||
|
const { data } = await props["emergencyExerciseOrganizationListAll"]({ likeDrillId: props.drillId });
|
||||||
|
setOrganizationList(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["emergencyExerciseOrganizationPersonnelInfo"]({ id: props.id });
|
||||||
|
form.setFieldsValue(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
getOrganizationListAll();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!props.id ? "emergencyExerciseOrganizationPersonnelAdd" : "emergencyExerciseOrganizationPersonnelUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.id,
|
||||||
|
drillId: props.drillId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success(`${!props.id ? "新增" : "编辑"}成功`);
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={props.id ? "编辑" : "新增"}
|
||||||
|
width={600}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.emergencyExercise.emergencyExerciseOrganizationPersonnelLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.emergencyExercise.emergencyExerciseOrganizationLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 10 }}
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
name: "emergencyDrillOrganizationId",
|
||||||
|
label: "应急指挥机构",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: organizationList,
|
||||||
|
itemsField: { labelKey: "orgName", valueKey: "id" },
|
||||||
|
},
|
||||||
|
{ name: "personName", label: "姓名" },
|
||||||
|
{ name: "unit", label: "单位" },
|
||||||
|
{ name: "position", label: "职务" },
|
||||||
|
{ name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
|
||||||
|
{
|
||||||
|
name: "emergencyContactPhone",
|
||||||
|
label: "紧急联系电话",
|
||||||
|
rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }],
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModal = Connect([NS_EMERGENCY_EXERCISE], true)(AddModalComponent);
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(InstitutionalPersonnel);
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
import Institutional from "./Institutional";
|
||||||
|
import InstitutionalPersonnel from "./InstitutionalPersonnel";
|
||||||
|
|
||||||
|
function CommandOrganization(props) {
|
||||||
|
return (
|
||||||
|
<div style={{ display: "flex", gap: "16px" }}>
|
||||||
|
<div style={{ width: "50%" }}>
|
||||||
|
<Institutional drillId={props.drillId} />
|
||||||
|
</div>
|
||||||
|
<div style={{ width: "50%" }}>
|
||||||
|
<InstitutionalPersonnel drillId={props.drillId} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CommandOrganization;
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Space } from "antd";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
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 useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||||
|
import { NS_EMERGENCY_EXERCISE } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function PlanAttachments(props) {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||||
|
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.setFieldsValue(props.basicInfo);
|
||||||
|
}, [props.basicInfo]);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
await deleteFile({ single: false, files: values.deleteEmergencyDrillFiles });
|
||||||
|
const { id: emergencyDrill } = await uploadFile({
|
||||||
|
single: false,
|
||||||
|
files: values.emergencyDrillFiles,
|
||||||
|
params: { type: UPLOAD_FILE_TYPE_ENUM[704], foreignKey: props.basicInfo.emergencyDrill },
|
||||||
|
});
|
||||||
|
const { success } = await props["emergencyExerciseUpdate"]({
|
||||||
|
...values,
|
||||||
|
emergencyDrill,
|
||||||
|
id: props.drillId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("保存成功");
|
||||||
|
props.goBack();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.emergencyExercise.emergencyExerciseLoading || uploadFileLoading || deleteFileLoading || props.getFileLoading}
|
||||||
|
customActionButtons={(
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => {
|
||||||
|
props.setUrlState({ currentStep: "planContent" });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
上一步
|
||||||
|
</Button>
|
||||||
|
<Button type="primary" onClick={form.submit}>保存</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
span={24}
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
name: "emergencyDrillFiles",
|
||||||
|
label: "附件",
|
||||||
|
render: (
|
||||||
|
<Upload
|
||||||
|
maxCount={1}
|
||||||
|
size={20}
|
||||||
|
fileType="document"
|
||||||
|
accept=".pdf,.png,.jpg"
|
||||||
|
onGetRemoveFile={(file) => {
|
||||||
|
form.setFieldValue("deleteEmergencyDrillFiles", [...(form.getFieldValue("deleteEmergencyDrillFiles") || []), file]);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "deleteEmergencyDrillFiles", label: "删除的附件", onlyForLabel: true },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(PlanAttachments);
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Divider, 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 DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||||
|
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 DrillContent(props) {
|
||||||
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
const [addModalVisible, setAddModalVisible] = useState(false);
|
||||||
|
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["emergencyExerciseContentList"], {
|
||||||
|
form,
|
||||||
|
params: { likeDrillId: props.drillId },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (record) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: `确定要删除【${record.drillContent}】吗`,
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["emergencyExerciseContentDelete"]({ 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["emergencyExerciseContentDeleteBatch"]({ ids: selectedRowKeys });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Divider orientation="left">演练内容列表</Divider>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "drillContent", label: "演练内容" },
|
||||||
|
]}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
rowSelection={{
|
||||||
|
preserveSelectedRowKeys: true,
|
||||||
|
selectedRowKeys,
|
||||||
|
onChange: (selectedRowKeys) => {
|
||||||
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
danger
|
||||||
|
ghost
|
||||||
|
icon={(<DeleteIcon />)}
|
||||||
|
onClick={onDeleteBatch}
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
{ title: "演练内容", dataIndex: "drillContent" },
|
||||||
|
{ title: "演练内容序号", dataIndex: "contentOrder" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
setCurrentId(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
addModalVisible && (
|
||||||
|
<AddModal
|
||||||
|
id={currentId}
|
||||||
|
drillId={props.drillId}
|
||||||
|
onCancel={() => {
|
||||||
|
setAddModalVisible(false);
|
||||||
|
setCurrentId("");
|
||||||
|
}}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["emergencyExerciseContentInfo"]({ id: props.id });
|
||||||
|
form.setFieldsValue(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!props.id ? "emergencyExerciseContentAdd" : "emergencyExerciseContentUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.id,
|
||||||
|
drillId: props.drillId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success(`${!props.id ? "新增" : "编辑"}成功`);
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={props.id ? "编辑" : "新增"}
|
||||||
|
width={600}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.emergencyExercise.emergencyExerciseContentLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.emergencyExercise.emergencyExerciseContentLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 10 }}
|
||||||
|
options={[
|
||||||
|
{ name: "drillContent", label: "演练内容" },
|
||||||
|
{ name: "contentOrder", label: "演练内容序号", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModal = Connect([NS_EMERGENCY_EXERCISE], true)(AddModalComponent);
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(DrillContent);
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Divider, 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 DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||||
|
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 DrillScene(props) {
|
||||||
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
const [addModalVisible, setAddModalVisible] = useState(false);
|
||||||
|
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["emergencyExerciseScenarioList"], {
|
||||||
|
form,
|
||||||
|
params: { likeDrillId: props.drillId },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (record) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: `确定要删除【${record.drillScenario}】吗`,
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["emergencyExerciseScenarioDelete"]({ 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["emergencyExerciseScenarioDeleteBatch"]({ ids: selectedRowKeys });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Divider orientation="left">演练场景列表</Divider>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "drillScenario", label: "演练场景" },
|
||||||
|
]}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
rowSelection={{
|
||||||
|
preserveSelectedRowKeys: true,
|
||||||
|
selectedRowKeys,
|
||||||
|
onChange: (selectedRowKeys) => {
|
||||||
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
danger
|
||||||
|
ghost
|
||||||
|
icon={(<DeleteIcon />)}
|
||||||
|
onClick={onDeleteBatch}
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
{ title: "演练场景", dataIndex: "drillScenario" },
|
||||||
|
{ title: "演练场景序号", dataIndex: "scenarioOrder" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
setCurrentId(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
addModalVisible && (
|
||||||
|
<AddModal
|
||||||
|
id={currentId}
|
||||||
|
drillId={props.drillId}
|
||||||
|
onCancel={() => {
|
||||||
|
setAddModalVisible(false);
|
||||||
|
setCurrentId("");
|
||||||
|
}}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["emergencyExerciseScenarioInfo"]({ id: props.id });
|
||||||
|
form.setFieldsValue(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!props.id ? "emergencyExerciseScenarioAdd" : "emergencyExerciseScenarioUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.id,
|
||||||
|
drillId: props.drillId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success(`${!props.id ? "新增" : "编辑"}成功`);
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={props.id ? "编辑" : "新增"}
|
||||||
|
width={600}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.emergencyExercise.emergencyExerciseScenarioLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.emergencyExercise.emergencyExerciseScenarioLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 10 }}
|
||||||
|
options={[
|
||||||
|
{ name: "drillScenario", label: "演练场景" },
|
||||||
|
{ name: "scenarioOrder", label: "演练场景序号", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModal = Connect([NS_EMERGENCY_EXERCISE], true)(AddModalComponent);
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(DrillScene);
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
import DrillContent from "./DrillContent";
|
||||||
|
import DrillScene from "./DrillScene";
|
||||||
|
|
||||||
|
function PlanContent(props) {
|
||||||
|
return (
|
||||||
|
<div style={{ display: "flex", gap: "16px" }}>
|
||||||
|
<div style={{ width: "50%" }}>
|
||||||
|
<DrillContent drillId={props.drillId} />
|
||||||
|
</div>
|
||||||
|
<div style={{ width: "50%" }}>
|
||||||
|
<DrillScene drillId={props.drillId} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PlanContent;
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Space } from "antd";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import Upload from "zy-react-library/components/Upload";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||||
|
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||||
|
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||||
|
import { NS_EMERGENCY_EXERCISE } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function SummaryEvaluation(props) {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||||
|
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.setFieldsValue(props.basicInfo);
|
||||||
|
}, [props.basicInfo]);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
await deleteFile({ single: false, files: values.deleteSummaryEvaluationFiles });
|
||||||
|
const { id: summaryAssessmentFileId } = await uploadFile({
|
||||||
|
single: false,
|
||||||
|
files: values.summaryEvaluationFiles,
|
||||||
|
params: { type: UPLOAD_FILE_TYPE_ENUM[705], foreignKey: props.basicInfo.summaryAssessmentFileId },
|
||||||
|
});
|
||||||
|
const { success } = await props["emergencyExerciseUpdate"]({
|
||||||
|
...values,
|
||||||
|
summaryAssessmentFileId,
|
||||||
|
id: props.drillId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("保存成功");
|
||||||
|
props.setUrlState({
|
||||||
|
currentStep: "planAttachments",
|
||||||
|
});
|
||||||
|
props.getBasicInfo();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.emergencyExercise.emergencyExerciseLoading || uploadFileLoading || deleteFileLoading || props.getFileLoading}
|
||||||
|
customActionButtons={(
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => {
|
||||||
|
props.setUrlState({ currentStep: "planContent" });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
上一步
|
||||||
|
</Button>
|
||||||
|
<Button type="primary" onClick={form.submit}>保存并下一步</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
span={24}
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
name: "drillPurpose",
|
||||||
|
label: "演练目的",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||||
|
componentProps: { disabled: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "summaryEvaluationFiles",
|
||||||
|
label: "相关附件",
|
||||||
|
render: (
|
||||||
|
<Upload
|
||||||
|
maxCount={1}
|
||||||
|
size={20}
|
||||||
|
fileType="document"
|
||||||
|
accept=".pdf,.png,.jpg"
|
||||||
|
onGetRemoveFile={(file) => {
|
||||||
|
form.setFieldValue("deleteSummaryEvaluationFiles", [...(form.getFieldValue("deleteSummaryEvaluationFiles") || []), file]);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "deleteSummaryEvaluationFiles", label: "删除的附件", onlyForLabel: true },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(SummaryEvaluation);
|
||||||
|
|
@ -0,0 +1,156 @@
|
||||||
|
import useUrlState from "@ahooksjs/use-url-state";
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Space, Tabs } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
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 { NS_EMERGENCY_EXERCISE } from "~/enumerate/namespace";
|
||||||
|
import BasicInfo from "./components/BasicInfo";
|
||||||
|
import CommandOrganization from "./components/CommandOrganization";
|
||||||
|
import PlanAttachments from "./components/PlanAttachments";
|
||||||
|
import PlanContent from "./components/PlanContent";
|
||||||
|
import SummaryEvaluation from "./components/SummaryEvaluation";
|
||||||
|
|
||||||
|
function Add(props) {
|
||||||
|
const { loading: getFileLoading, getFile } = useGetFile();
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const [urlState, setUrlState] = useUrlState(
|
||||||
|
{
|
||||||
|
currentStep: "basicInfo",
|
||||||
|
drillId: query.id,
|
||||||
|
},
|
||||||
|
{ navigateMode: "replace" },
|
||||||
|
);
|
||||||
|
|
||||||
|
const [basicInfo, setBasicInfo] = useState({});
|
||||||
|
|
||||||
|
const getBasicInfo = async () => {
|
||||||
|
if (!urlState.drillId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["emergencyExerciseInfo"]({ id: urlState.drillId });
|
||||||
|
const summaryEvaluationFiles = [];
|
||||||
|
const emergencyDrillFiles = [];
|
||||||
|
if (data.summaryAssessmentFileId) {
|
||||||
|
const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[705], eqForeignKey: data.summaryAssessmentFileId });
|
||||||
|
summaryEvaluationFiles.push(...fileItems);
|
||||||
|
}
|
||||||
|
if (data.emergencyDrill) {
|
||||||
|
const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[704], eqForeignKey: data.emergencyDrill });
|
||||||
|
emergencyDrillFiles.push(...fileItems);
|
||||||
|
}
|
||||||
|
setBasicInfo({
|
||||||
|
...data,
|
||||||
|
summaryEvaluationFiles,
|
||||||
|
emergencyDrillFiles,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getBasicInfo();
|
||||||
|
}, [urlState.drillId]);
|
||||||
|
|
||||||
|
const subordinateTabDisabled = !urlState.drillId;
|
||||||
|
const isShowFooter = ["basicInfo", "summaryEvaluation", "planAttachments"].includes(urlState.currentStep);
|
||||||
|
|
||||||
|
const previousStep = () => {
|
||||||
|
const stepMapping = {
|
||||||
|
commandOrganization: "basicInfo",
|
||||||
|
planContent: "commandOrganization",
|
||||||
|
summaryEvaluation: "planContent",
|
||||||
|
planAttachments: "summaryEvaluation",
|
||||||
|
};
|
||||||
|
|
||||||
|
const prevStep = stepMapping[urlState.currentStep];
|
||||||
|
if (prevStep)
|
||||||
|
setUrlState({ currentStep: prevStep });
|
||||||
|
};
|
||||||
|
|
||||||
|
const nextStep = () => {
|
||||||
|
const stepFlow = {
|
||||||
|
commandOrganization: "planContent",
|
||||||
|
planContent: "summaryEvaluation",
|
||||||
|
};
|
||||||
|
|
||||||
|
const nextStep = stepFlow[urlState.currentStep];
|
||||||
|
if (nextStep) {
|
||||||
|
setUrlState({ currentStep: nextStep });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page
|
||||||
|
headerTitle={query.id ? "编辑" : "新增"}
|
||||||
|
isShowFooter={!isShowFooter}
|
||||||
|
customActionButtons={(
|
||||||
|
<Space>
|
||||||
|
<Button onClick={previousStep}>上一步</Button>
|
||||||
|
<Button type="primary" onClick={nextStep}>下一步</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Tabs
|
||||||
|
activeKey={urlState.currentStep}
|
||||||
|
onChange={key => setUrlState({ currentStep: key })}
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
key: "basicInfo",
|
||||||
|
label: "应急演练基本信息",
|
||||||
|
children: (
|
||||||
|
<BasicInfo
|
||||||
|
drillId={urlState.drillId}
|
||||||
|
setUrlState={setUrlState}
|
||||||
|
basicInfo={basicInfo}
|
||||||
|
getBasicInfo={getBasicInfo}
|
||||||
|
getFileLoading={getFileLoading}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "commandOrganization",
|
||||||
|
label: "应急指挥机构",
|
||||||
|
children: (<CommandOrganization drillId={urlState.drillId} />),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "planContent",
|
||||||
|
label: "演练内容及场景",
|
||||||
|
children: (<PlanContent drillId={urlState.drillId} />),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "summaryEvaluation",
|
||||||
|
label: "总结评估",
|
||||||
|
children: (
|
||||||
|
<SummaryEvaluation
|
||||||
|
drillId={urlState.drillId}
|
||||||
|
setUrlState={setUrlState}
|
||||||
|
basicInfo={basicInfo}
|
||||||
|
getBasicInfo={getBasicInfo}
|
||||||
|
getFileLoading={getFileLoading}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "planAttachments",
|
||||||
|
label: "应急演练附件",
|
||||||
|
children: (
|
||||||
|
<PlanAttachments
|
||||||
|
drillId={urlState.drillId}
|
||||||
|
basicInfo={basicInfo}
|
||||||
|
getFileLoading={getFileLoading}
|
||||||
|
goBack={props.history.goBack}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(Add);
|
||||||
|
|
@ -0,0 +1,170 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Descriptions, Divider, 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 Table from "zy-react-library/components/Table";
|
||||||
|
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 useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getFileSuffix } from "zy-react-library/utils";
|
||||||
|
import { NS_EMERGENCY_EXERCISE } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function View(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const { loading: getFileLoading, getFile } = useGetFile();
|
||||||
|
|
||||||
|
const [basicInfo, setBasicInfo] = useState({});
|
||||||
|
|
||||||
|
const { tableProps: organizationTableProps } = useTable(props["emergencyExerciseOrganizationList"], {
|
||||||
|
params: { likeDrillId: query.id },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
const { tableProps: organizationPersonnelTableProps } = useTable(props["emergencyExerciseOrganizationPersonnelList"], {
|
||||||
|
params: { likeDrillId: query.id },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
const { tableProps: contentTableProps } = useTable(props["emergencyExerciseContentList"], {
|
||||||
|
params: { likeDrillId: query.id },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
const { tableProps: scenarioTableProps } = useTable(props["emergencyExerciseScenarioList"], {
|
||||||
|
params: { likeDrillId: query.id },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const getBasicInfo = async () => {
|
||||||
|
const { data } = await props["emergencyExerciseInfo"]({ id: query.id });
|
||||||
|
const summaryEvaluationFiles = [];
|
||||||
|
const emergencyDrillFiles = [];
|
||||||
|
if (data.summaryAssessmentFileId) {
|
||||||
|
const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[705], eqForeignKey: data.summaryAssessmentFileId });
|
||||||
|
summaryEvaluationFiles.push(...fileItems);
|
||||||
|
}
|
||||||
|
if (data.emergencyDrill) {
|
||||||
|
const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[704], eqForeignKey: data.emergencyDrill });
|
||||||
|
emergencyDrillFiles.push(...fileItems);
|
||||||
|
}
|
||||||
|
setBasicInfo({
|
||||||
|
...data,
|
||||||
|
summaryEvaluationFiles,
|
||||||
|
emergencyDrillFiles,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getBasicInfo();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
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 (
|
||||||
|
<>
|
||||||
|
<PreviewPdf files={pdfFile} />
|
||||||
|
<PreviewImg files={imgFile} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page headerTitle="查看">
|
||||||
|
<Divider orientation="left">应急演练基本信息</Divider>
|
||||||
|
<Spin spinning={props.emergencyExercise.emergencyExerciseLoading || getFileLoading}>
|
||||||
|
<Descriptions
|
||||||
|
bordered
|
||||||
|
column={2}
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "应急演练方案名称", children: basicInfo.drillName, span: 2 },
|
||||||
|
{ label: "演练单位", children: basicInfo.drillUnit },
|
||||||
|
{ label: "演练时间", children: basicInfo.drillTime },
|
||||||
|
{ label: "演练目的", children: basicInfo.drillPurpose, span: 2 },
|
||||||
|
{ label: "演练特点", children: basicInfo.drillFeatures, span: 2 },
|
||||||
|
{ label: "应急演练地点", children: basicInfo.drillLocation },
|
||||||
|
{ label: "参加人员", children: basicInfo.participants },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
|
<Divider orientation="left">应急指挥机构</Divider>
|
||||||
|
<Table
|
||||||
|
options={false}
|
||||||
|
disabledResizer={true}
|
||||||
|
columns={[
|
||||||
|
{ title: "机构名称", dataIndex: "orgName" },
|
||||||
|
{ title: "组成单位", dataIndex: "constituentUnit" },
|
||||||
|
{ title: "机构职责", dataIndex: "orgDuties" },
|
||||||
|
]}
|
||||||
|
{...organizationTableProps}
|
||||||
|
/>
|
||||||
|
<Divider orientation="left">应急指挥机构人员</Divider>
|
||||||
|
<Table
|
||||||
|
options={false}
|
||||||
|
disabledResizer={true}
|
||||||
|
columns={[
|
||||||
|
{ title: "应急指挥机构", dataIndex: "orgName" },
|
||||||
|
{ title: "姓名", dataIndex: "personName" },
|
||||||
|
{ title: "单位", dataIndex: "unit" },
|
||||||
|
{ title: "职务", dataIndex: "position" },
|
||||||
|
{ title: "联系电话", dataIndex: "contactPhone" },
|
||||||
|
{ title: "紧急联系电话", dataIndex: "emergencyContactPhone" },
|
||||||
|
]}
|
||||||
|
{...organizationPersonnelTableProps}
|
||||||
|
/>
|
||||||
|
<Divider orientation="left">演练内容</Divider>
|
||||||
|
<Table
|
||||||
|
options={false}
|
||||||
|
disabledResizer={true}
|
||||||
|
columns={[
|
||||||
|
{ title: "演练内容", dataIndex: "drillContent" },
|
||||||
|
{ title: "演练内容序号", dataIndex: "contentOrder" },
|
||||||
|
]}
|
||||||
|
{...contentTableProps}
|
||||||
|
/>
|
||||||
|
<Divider orientation="left">演练场景</Divider>
|
||||||
|
<Table
|
||||||
|
options={false}
|
||||||
|
disabledResizer={true}
|
||||||
|
columns={[
|
||||||
|
{ title: "演练场景", dataIndex: "drillScenario" },
|
||||||
|
{ title: "演练场景序号", dataIndex: "scenarioOrder" },
|
||||||
|
]}
|
||||||
|
{...scenarioTableProps}
|
||||||
|
/>
|
||||||
|
<Divider orientation="left">总结评价</Divider>
|
||||||
|
<Spin spinning={props.emergencyExercise.emergencyExerciseLoading || getFileLoading}>
|
||||||
|
<Descriptions
|
||||||
|
bordered
|
||||||
|
column={1}
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "演练目的", children: basicInfo.drillPurpose },
|
||||||
|
{ label: "附件", children: previewFile(basicInfo.summaryEvaluationFiles) },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
|
<Divider orientation="left">应急演练方案附件</Divider>
|
||||||
|
<Spin spinning={props.emergencyExercise.emergencyExerciseLoading || getFileLoading}>
|
||||||
|
<Descriptions
|
||||||
|
bordered
|
||||||
|
column={1}
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "附件", children: previewFile(basicInfo.emergencyDrillFiles) },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_EMERGENCY_EXERCISE], true)(View);
|
||||||
|
|
@ -13,9 +13,7 @@ function GradeResponse(props) {
|
||||||
const [currentId, setCurrentId] = useState("");
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["enterprisePlanLevelResponseList"], {
|
const { tableProps, getData } = useTable(props["enterprisePlanLevelResponseList"], {
|
||||||
params: {
|
params: { likePlanId: props.planId },
|
||||||
likePlanId: props.planId,
|
|
||||||
},
|
|
||||||
useStorageQueryCriteria: false,
|
useStorageQueryCriteria: false,
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
props.mode !== "view" && props.setResponseLevelRefresh(true);
|
props.mode !== "view" && props.setResponseLevelRefresh(true);
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ function OrganizationStructure(props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div style={{ display: "flex" }}>
|
<div style={{ display: "flex", gap: 16 }}>
|
||||||
<div style={{ width: 500 }}>
|
<div style={{ width: 500 }}>
|
||||||
{props.mode !== "view" && (
|
{props.mode !== "view" && (
|
||||||
<Space style={{ marginBottom: 16 }}>
|
<Space style={{ marginBottom: 16 }}>
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,7 @@ function PlanAttachments(props) {
|
||||||
const [currentId, setCurrentId] = useState("");
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["enterprisePlanAttachmentList"], {
|
const { tableProps, getData } = useTable(props["enterprisePlanAttachmentList"], {
|
||||||
params: {
|
params: { likePlanId: props.planId },
|
||||||
likePlanId: props.planId,
|
|
||||||
},
|
|
||||||
useStorageQueryCriteria: false,
|
useStorageQueryCriteria: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,7 @@ function PlanInstructions(props) {
|
||||||
const isEditCommandIdRef = useRef("");
|
const isEditCommandIdRef = useRef("");
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["enterprisePlanCommandSettingList"], {
|
const { tableProps, getData } = useTable(props["enterprisePlanCommandSettingList"], {
|
||||||
params: {
|
params: { likePlanId: props.planId },
|
||||||
likePlanId: props.planId,
|
|
||||||
},
|
|
||||||
useStorageQueryCriteria: false,
|
useStorageQueryCriteria: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -84,7 +82,7 @@ function PlanInstructions(props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: "flex" }}>
|
<div style={{ display: "flex", gap: 16 }}>
|
||||||
{
|
{
|
||||||
props.mode !== "view" && (
|
props.mode !== "view" && (
|
||||||
<div style={{ width: "50%" }}>
|
<div style={{ width: "50%" }}>
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,7 @@ function GradeResponse(props) {
|
||||||
const [currentId, setCurrentId] = useState("");
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
|
||||||
const { tableProps, getData } = useTable(props["enterprisePlanResourceList"], {
|
const { tableProps, getData } = useTable(props["enterprisePlanResourceList"], {
|
||||||
params: {
|
params: { likePlanId: props.planId },
|
||||||
likePlanId: props.planId,
|
|
||||||
},
|
|
||||||
useStorageQueryCriteria: false,
|
useStorageQueryCriteria: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue