diff --git a/package.json b/package.json index c66d67d..a47b37c 100644 --- a/package.json +++ b/package.json @@ -25,13 +25,15 @@ "@cqsjjb/jjb-common-lib": "latest", "@cqsjjb/jjb-dva-runtime": "latest", "@cqsjjb/jjb-react-admin-component": "latest", + "@rc-component/virtual-list": "^1.0.2", "ahooks": "^3.9.5", "antd": "^5.27.6", "dayjs": "^1.11.7", + "immer": "^11.1.4", "lodash-es": "^4.17.21", "react": "^18.2.0", "react-dom": "^18.2.0", - "zy-react-library": "^1.2.32" + "zy-react-library": "^1.2.39" }, "devDependencies": { "@antfu/eslint-config": "^5.4.1", diff --git a/public/index.html b/public/index.html index 9bfa85d..a43118e 100644 --- a/public/index.html +++ b/public/index.html @@ -10,6 +10,7 @@ + <% for (const item of $links) { %> <% } %> diff --git a/router.md b/router.md index 56c9c21..4c0e71b 100644 --- a/router.md +++ b/router.md @@ -80,6 +80,8 @@ `/emergencyRescue/container/enterprise/emergencyRescue/duty/schedulingRegistration/list` - 应急救援/应急接报/事件接报 `/emergencyRescue/container/enterprise/emergencyRescue/emergencyReporting/eventReport/list` +- 应急救援/救援 + `/emergencyRescue/container/enterprise/emergencyRescue/rescue/list` - 应急救援/应急知识库/案例库 `/emergencyRescue/container/enterprise/emergencyRescue/emergencyKnowledgeLibrary/case/list` - 应急救援/应急知识库/危险货物库 diff --git a/src/api/closedCardPort/index.js b/src/api/closedCardPort/index.js index b9f0aca..1d3717c 100644 --- a/src/api/closedCardPort/index.js +++ b/src/api/closedCardPort/index.js @@ -4,6 +4,10 @@ export const closedCardPortList = declareRequest( "closedCardPortLoading", "Post > @/emergencyRescue/closedCheckpointInfo/list", ); +export const closedCardPortListAll = declareRequest( + "closedCardPortLoading", + "Get > /emergencyRescue/closedCheckpointInfo/listAll", +); export const closedCardPortInfo = declareRequest( "closedCardPortLoading", "Get > /emergencyRescue/closedCheckpointInfo/{id}", diff --git a/src/api/communicationGuaranteeOrganization/index.js b/src/api/communicationGuaranteeOrganization/index.js index c79bb4b..a6ff9af 100644 --- a/src/api/communicationGuaranteeOrganization/index.js +++ b/src/api/communicationGuaranteeOrganization/index.js @@ -4,6 +4,10 @@ export const communicationGuaranteeOrganizationList = declareRequest( "communicationGuaranteeOrganizationLoading", "Post > @/emergencyRescue/communicationSecurityAgency/list", ); +export const communicationGuaranteeOrganizationListAll = declareRequest( + "communicationGuaranteeOrganizationLoading", + "Get > /emergencyRescue/communicationSecurityAgency/listAll", +); export const communicationGuaranteeOrganizationInfo = declareRequest( "communicationGuaranteeOrganizationLoading", "Get > /emergencyRescue/communicationSecurityAgency/{id}", diff --git a/src/api/drainageWell/index.js b/src/api/drainageWell/index.js index a495513..0b6e16a 100644 --- a/src/api/drainageWell/index.js +++ b/src/api/drainageWell/index.js @@ -4,6 +4,10 @@ export const drainageWellList = declareRequest( "drainageWellLoading", "Post > @/emergencyRescue/drainageWellInfo/list", ); +export const drainageWellListAll = declareRequest( + "drainageWellLoading", + "Get > /emergencyRescue/drainageWellInfo/listAll", +); export const drainageWellInfo = declareRequest( "drainageWellLoading", "Get > /emergencyRescue/drainageWellInfo/{id}", diff --git a/src/api/emergencyEquipment/index.js b/src/api/emergencyEquipment/index.js index 24794c1..c779bbf 100644 --- a/src/api/emergencyEquipment/index.js +++ b/src/api/emergencyEquipment/index.js @@ -4,6 +4,10 @@ export const emergencyEquipmentList = declareRequest( "emergencyEquipmentLoading", "Post > @/emergencyRescue/emergencyEquipmentManagement/list", ); +export const emergencyEquipmentListAll = declareRequest( + "emergencyEquipmentLoading", + "Get > /emergencyRescue/emergencyEquipmentManagement/listAll", +); export const emergencyEquipmentInfo = declareRequest( "emergencyEquipmentLoading", "Get > /emergencyRescue/emergencyEquipmentManagement/{id}", diff --git a/src/api/emergencyShelter/index.js b/src/api/emergencyShelter/index.js index d3e672d..0c6ccb6 100644 --- a/src/api/emergencyShelter/index.js +++ b/src/api/emergencyShelter/index.js @@ -4,6 +4,10 @@ export const emergencyShelterList = declareRequest( "emergencyShelterLoading", "Post > @/emergencyRescue/placeInfo/list", ); +export const emergencyShelterListAll = declareRequest( + "emergencyShelterLoading", + "Get > /emergencyRescue/placeInfo/listAll", +); export const emergencyShelterInfo = declareRequest( "emergencyShelterLoading", "Get > /emergencyRescue/placeInfo/{id}", diff --git a/src/api/enterpriseEmergencyPersonnel/index.js b/src/api/enterpriseEmergencyPersonnel/index.js index fed94a1..819a56d 100644 --- a/src/api/enterpriseEmergencyPersonnel/index.js +++ b/src/api/enterpriseEmergencyPersonnel/index.js @@ -4,6 +4,10 @@ export const enterpriseEmergencyPersonnelList = declareRequest( "enterpriseEmergencyPersonnelLoading", "Post > @/emergencyRescue/enterpriseEmergencyPersonnel/list", ); +export const enterpriseEmergencyPersonnelListAll = declareRequest( + "enterpriseEmergencyPersonnelLoading", + "Get > /emergencyRescue/enterpriseEmergencyPersonnel/listAll", +); export const enterpriseEmergencyPersonnelInfo = declareRequest( "enterpriseEmergencyPersonnelLoading", "Get > /emergencyRescue/enterpriseEmergencyPersonnel/{id}", diff --git a/src/api/enterprisePlan/index.js b/src/api/enterprisePlan/index.js index 83c3a5e..63dfe44 100644 --- a/src/api/enterprisePlan/index.js +++ b/src/api/enterprisePlan/index.js @@ -4,6 +4,10 @@ export const enterprisePlanBasicInfoList = declareRequest( "enterprisePlanBasicInfoLoading", "Post > @/emergencyRescue/enterprisePlanBasicInfo/list", ); +export const enterprisePlanBasicInfoListAll = declareRequest( + "enterprisePlanBasicInfoLoading", + "Get > /emergencyRescue/enterprisePlanBasicInfo/listAll", +); export const enterprisePlanBasicInfoInfo = declareRequest( "enterprisePlanBasicInfoLoading", "Get > /emergencyRescue/enterprisePlanBasicInfo/{id}", @@ -76,6 +80,10 @@ export const enterprisePlanOrganizationPersonnelList = declareRequest( "enterprisePlanOrganizationPersonnelLoading", "Post > @/emergencyRescue/enterprisePlanOrganizationPersonnel/list", ); +export const enterprisePlanOrganizationPersonnelListAll = declareRequest( + "enterprisePlanOrganizationPersonnelLoading", + "Get > /emergencyRescue/enterprisePlanOrganizationPersonnel/listAll", +); export const enterprisePlanOrganizationPersonnelInfo = declareRequest( "enterprisePlanOrganizationPersonnelLoading", "Get > /emergencyRescue/enterprisePlanOrganizationPersonnel/{id}", diff --git a/src/api/eventReport/index.js b/src/api/eventReport/index.js index 6413720..f1b8d32 100644 --- a/src/api/eventReport/index.js +++ b/src/api/eventReport/index.js @@ -16,7 +16,3 @@ export const eventReportRescue = declareRequest( "eventReportLoading", "Post > @/emergencyRescue/eventReport/triggerRescue", ); -export const eventReportSpecialReportSave = declareRequest( - "eventReportSpecialReportLoading", - "Post > @/emergencyRescue/eventReportSpecial/save", -); diff --git a/src/api/expertEmergencyRescueExpertGroup/index.js b/src/api/expertEmergencyRescueExpertGroup/index.js index 2181a87..d14be49 100644 --- a/src/api/expertEmergencyRescueExpertGroup/index.js +++ b/src/api/expertEmergencyRescueExpertGroup/index.js @@ -4,6 +4,10 @@ export const expertEmergencyRescueExpertGroupList = declareRequest( "expertEmergencyRescueExpertGroupLoading", "Post > @/emergencyRescue/emergencyRescueExpertGroup/list", ); +export const expertEmergencyRescueExpertGroupListAll = declareRequest( + "expertEmergencyRescueExpertGroupLoading", + "Get > /emergencyRescue/emergencyRescueExpertGroup/listAll", +); export const expertEmergencyRescueExpertGroupInfo = declareRequest( "expertEmergencyRescueExpertGroupLoading", "Get > /emergencyRescue/emergencyRescueExpertGroup/{id}", diff --git a/src/api/expertEmergencyRescueTeam/index.js b/src/api/expertEmergencyRescueTeam/index.js index 374fd20..f9fec1b 100644 --- a/src/api/expertEmergencyRescueTeam/index.js +++ b/src/api/expertEmergencyRescueTeam/index.js @@ -4,6 +4,10 @@ export const expertEmergencyRescueTeamList = declareRequest( "expertEmergencyRescueTeamLoading", "Post > @/emergencyRescue/emergencyRescueTeam/list", ); +export const expertEmergencyRescueTeamListAll = declareRequest( + "expertEmergencyRescueTeamLoading", + "Get > /emergencyRescue/emergencyRescueTeam/listAll", +); export const expertEmergencyRescueTeamInfo = declareRequest( "expertEmergencyRescueTeamLoading", "Get > /emergencyRescue/emergencyRescueTeam/{id}", diff --git a/src/api/firefightingEquipment/index.js b/src/api/firefightingEquipment/index.js index 7e1b847..0914849 100644 --- a/src/api/firefightingEquipment/index.js +++ b/src/api/firefightingEquipment/index.js @@ -4,6 +4,10 @@ export const firefightingEquipmentList = declareRequest( "firefightingEquipmentLoading", "Post > @/emergencyRescue", ); +export const firefightingEquipmentListAll = declareRequest( + "firefightingEquipmentLoading", + "Get > /emergencyRescue", +); export const fireAreaListAll = declareRequest( "firefightingEquipmentLoading", "Get > /fireCheck/fireRegion/listAll", diff --git a/src/api/materialEquipment/index.js b/src/api/materialEquipment/index.js index 2a2a43d..9cdbb4f 100644 --- a/src/api/materialEquipment/index.js +++ b/src/api/materialEquipment/index.js @@ -4,6 +4,10 @@ export const materialEquipmentList = declareRequest( "materialEquipmentLoading", "Post > @/emergencyRescue/materialEquipmentWarehouse/list", ); +export const materialEquipmentListAll = declareRequest( + "materialEquipmentLoading", + "Get > /emergencyRescue/materialEquipmentWarehouse/listAll", +); export const materialEquipmentInfo = declareRequest( "materialEquipmentLoading", "Get > /emergencyRescue/materialEquipmentWarehouse/{id}", diff --git a/src/api/medicalGuaranteeOrganization/index.js b/src/api/medicalGuaranteeOrganization/index.js index d7abeaf..8d17065 100644 --- a/src/api/medicalGuaranteeOrganization/index.js +++ b/src/api/medicalGuaranteeOrganization/index.js @@ -4,6 +4,10 @@ export const medicalGuaranteeOrganizationList = declareRequest( "medicalGuaranteeOrganizationLoading", "Post > @/emergencyRescue/medicalSecurityAgency/list", ); +export const medicalGuaranteeOrganizationListAll = declareRequest( + "medicalGuaranteeOrganizationLoading", + "Get > /emergencyRescue/medicalSecurityAgency/listAll", +); export const medicalGuaranteeOrganizationInfo = declareRequest( "medicalGuaranteeOrganizationLoading", "Get > /emergencyRescue/medicalSecurityAgency/{id}", diff --git a/src/api/rescue/index.js b/src/api/rescue/index.js new file mode 100644 index 0000000..0883c21 --- /dev/null +++ b/src/api/rescue/index.js @@ -0,0 +1,42 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const rescueUpdateStatus = declareRequest( + "rescueLoading", + "Post > @/emergencyRescue/eventReport/endRescue", +); +export const eventReportSpecialReportSave = declareRequest( + "rescueLoading", + "Post > @/emergencyRescue/eventReportSpecial/save", +); +export const eventReportSpecialReportInfo = declareRequest( + "rescueLoading", + "Get > /emergencyRescue/eventReportSpecial/{id}", +); +export const rescueExecutionRecordList = declareRequest( + "rescueLoading", + "Get > /emergencyRescue/rescueInstructionExecutorFeedback/queryByRescueIdList/{id}", +); +export const rescueEventHandlingRecordList = declareRequest( + "rescueLoading", + "Post > @/emergencyRescue/rescueHandlingRecord/list", +); +export const rescueEventHandlingRecordListAll = declareRequest( + "rescueLoading", + "Get > /emergencyRescue/rescueHandlingRecord/listAll/{id}", +); +export const rescueCommandUsePlan = declareRequest( + "rescueLoading", + "Post > @/emergencyRescue/rescueInstruction/addBatch", +); +export const rescueCommandFeedbackRecords = declareRequest( + "rescueLoading", + "Get > /emergencyRescue/rescueInstructionExecutorFeedback/queryByRescueId/{id}", +); +export const rescueCommandSendCommand = declareRequest( + "rescueLoading", + "Post > @/emergencyRescue/rescueInstruction/save", +); +export const rescueCommandEventHandlingRecordsAdd = declareRequest( + "rescueLoading", + "Post > @/emergencyRescue/rescueHandlingRecord/save", +); diff --git a/src/api/technicalSupportGuaranteeOrganization/index.js b/src/api/technicalSupportGuaranteeOrganization/index.js index f1f15e4..da12396 100644 --- a/src/api/technicalSupportGuaranteeOrganization/index.js +++ b/src/api/technicalSupportGuaranteeOrganization/index.js @@ -4,6 +4,10 @@ export const technicalSupportGuaranteeOrganizationList = declareRequest( "technicalSupportGuaranteeOrganizationLoading", "Post > @/emergencyRescue/technicalSupportAgency/list", ); +export const technicalSupportGuaranteeOrganizationListAll = declareRequest( + "technicalSupportGuaranteeOrganizationLoading", + "Get > /emergencyRescue/technicalSupportAgency/listAll", +); export const technicalSupportGuaranteeOrganizationInfo = declareRequest( "technicalSupportGuaranteeOrganizationLoading", "Get > /emergencyRescue/technicalSupportAgency/{id}", diff --git a/src/api/transportGuaranteeOrganization/index.js b/src/api/transportGuaranteeOrganization/index.js index 0ddc3bc..627eafa 100644 --- a/src/api/transportGuaranteeOrganization/index.js +++ b/src/api/transportGuaranteeOrganization/index.js @@ -4,6 +4,10 @@ export const transportGuaranteeOrganizationList = declareRequest( "transportGuaranteeOrganizationLoading", "Post > @/emergencyRescue/transportSecurityAgency/list", ); +export const transportGuaranteeOrganizationListAll = declareRequest( + "transportGuaranteeOrganizationLoading", + "Get > /emergencyRescue/transportSecurityAgency/listAll", +); export const transportGuaranteeOrganizationInfo = declareRequest( "transportGuaranteeOrganizationLoading", "Get > /emergencyRescue/transportSecurityAgency/{id}", diff --git a/src/enumerate/namespace/index.js b/src/enumerate/namespace/index.js index 8a7339b..379d167 100644 --- a/src/enumerate/namespace/index.js +++ b/src/enumerate/namespace/index.js @@ -30,3 +30,4 @@ export const NS_DUTY_LOG = defineNamespace("dutyLog"); export const NS_EVENT_REPORT = defineNamespace("eventReport"); export const NS_EMERGENCY_KNOWLEDGE_LIBRARY = defineNamespace("emergencyKnowledgeLibrary"); export const NS_SCHEDULING_REGISTRATION = defineNamespace("schedulingRegistration"); +export const NS_RESUE = defineNamespace("rescue"); diff --git a/src/pages/Container/Enterprise/EmergencyOrganization/EmergencyExpertTeam/ExpertEmergencyRescueTeam/View/index.js b/src/pages/Container/Enterprise/EmergencyOrganization/EmergencyExpertTeam/ExpertEmergencyRescueTeam/View/index.js index 88b77fb..5410fb8 100644 --- a/src/pages/Container/Enterprise/EmergencyOrganization/EmergencyExpertTeam/ExpertEmergencyRescueTeam/View/index.js +++ b/src/pages/Container/Enterprise/EmergencyOrganization/EmergencyExpertTeam/ExpertEmergencyRescueTeam/View/index.js @@ -11,20 +11,23 @@ function View(props) { const [info, setInfo] = useState({}); const getData = async () => { - const { data } = await props["expertEmergencyRescueTeamInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["expertEmergencyRescueTeamInfo"]({ id: query.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + { - const { data } = await props["enterpriseEmergencyOrganizationInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["enterpriseEmergencyOrganizationInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + { - const { data } = await props["communicationGuaranteeOrganizationInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["communicationGuaranteeOrganizationInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + { - const { data } = await props["medicalGuaranteeOrganizationInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["medicalGuaranteeOrganizationInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + { - const { data } = await props["technicalSupportGuaranteeOrganizationInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["technicalSupportGuaranteeOrganizationInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + { - const { data } = await props["transportGuaranteeOrganizationInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["transportGuaranteeOrganizationInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + ) }, ]} form={form} diff --git a/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/List/index.js b/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/List/index.js index 1c1be99..7b8e2fa 100644 --- a/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/List/index.js +++ b/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/List/index.js @@ -22,7 +22,7 @@ function List(props) { occurrenceStartTime: formData.occurrenceTime?.[0], occurrenceEndTime: formData.occurrenceTime?.[1], }), - params: { corpId: query.corpinfoId }, + params: { corpId: query.corpinfoId, isEventOrRescue: 1 }, }); const onRescue = async (id) => { @@ -104,28 +104,6 @@ function List(props) { 查看 )} - {(!props.isRecord && props.permission("qyd-event-report-special-report")) && ( - - )} ), }, diff --git a/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/View/index.js b/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/View/index.js index a8bae40..fb25507 100644 --- a/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/View/index.js +++ b/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/View/index.js @@ -30,9 +30,11 @@ function View(props) { { label: "接入方式", children: info.accessModeName }, { label: "机主姓名", children: info.ownerName }, { label: "呼入电话", children: info.incomingCall }, + { label: "事件标题", children: info.eventTitle }, { label: "事件类型", children: info.eventType }, { label: "接报时间", children: info.reportTime }, { label: "发生时间", children: info.occurrenceTime }, + { label: "所在地址", children: info.locationAddress }, { label: "经度", children: info.longitude }, { label: "纬度", children: info.latitude }, ]} diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/cesiumUtils.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/cesiumUtils.js new file mode 100644 index 0000000..016777c --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/cesiumUtils.js @@ -0,0 +1,204 @@ +export const getPosition = (x, y, z = 0.0) => { + return window.Cesium.Cartesian3.fromDegrees(x, y, z); +}; + +export const createId = () => { + return window.Cesium.createGuid(); +}; + +export const filterNull = (arr = [], longitudeKey = "longitude", latitudeKey = "latitude") => { + return arr.filter(item => item[longitudeKey] && item[latitudeKey]); +}; + +export const createTextCanvas = (text) => { + return new Promise((resolve) => { + if (!text) { + resolve(null); + return; + } + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + const ratio = window.devicePixelRatio || 1; + const fontSize = 14 * ratio; + const fontFamily = "Arial, sans-serif"; + const paddingX = Math.round(7 * ratio); + const paddingY = Math.round(5 * ratio); + + ctx.font = `${fontSize}px ${fontFamily}`; + const textMetrics = ctx.measureText(text); + const textWidth = textMetrics.width; + const canvasWidth = Math.ceil(textWidth + paddingX * 2); + const canvasHeight = Math.ceil(fontSize + paddingY * 2); + + canvas.style.width = `${canvasWidth / ratio}px`; + canvas.style.height = `${canvasHeight / ratio}px`; + canvas.width = canvasWidth * ratio; + canvas.height = canvasHeight * ratio; + + ctx.scale(ratio, ratio); + ctx.font = `${fontSize}px ${fontFamily}`; + ctx.fillStyle = "rgba(20, 58, 142, 1)"; + ctx.fillRect(0, 0, canvasWidth, canvasHeight); + ctx.fillStyle = "#ffffff"; + ctx.textBaseline = "top"; + ctx.textRendering = "geometricPrecision"; + + const drawX = Math.round(paddingX); + const drawY = Math.round(paddingY); + ctx.fillText(text, drawX, drawY); + + resolve({ + base64: canvas.toDataURL(), + width: canvasWidth, + height: canvasHeight, + }); + }); +}; + +export const createImgCanvas = (imageUrl) => { + return new Promise((resolve, reject) => { + const img = new Image(); + img.crossOrigin = "Anonymous"; + img.src = imageUrl; + + img.onload = () => { + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + canvas.width = img.width; + canvas.height = img.height; + ctx.drawImage(img, 0, 0); + + resolve({ + base64: canvas.toDataURL(), + width: img.width, + height: img.height, + }); + }; + + img.onerror = (error) => { + reject(new Error(`Failed to load image: ${error}`)); + }; + }); +}; + +const imgCanvasCache = new Map(); + +export const getBillboardCanvases = async (imageUrl, text, spacing = 5) => { + let imgPromise; + if (imgCanvasCache.has(imageUrl)) { + imgPromise = imgCanvasCache.get(imageUrl); + } + else { + imgPromise = createImgCanvas(imageUrl); + imgCanvasCache.set(imageUrl, imgPromise); + } + + const [imgResult, textResult] = await Promise.all([ + imgPromise, + createTextCanvas(text), + ]); + + if (!textResult) { + return { + base64: imgResult.base64, + width: imgResult.width, + height: imgResult.height, + }; + } + + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + const maxWidth = Math.max(imgResult.width, textResult.width); + const totalHeight = textResult.height + imgResult.height + spacing; + + canvas.width = maxWidth; + canvas.height = totalHeight; + + const loadImage = base64 => + new Promise((resolve, reject) => { + const img = new Image(); + img.onload = () => resolve(img); + img.onerror = reject; + img.src = base64; + }); + + const [image, textImage] = await Promise.all([ + loadImage(imgResult.base64), + loadImage(textResult.base64), + ]); + + const textX = (maxWidth - textResult.width) / 2; + const imageX = (maxWidth - imgResult.width) / 2; + + ctx.drawImage(textImage, textX, 0); + ctx.drawImage( + image, + imageX, + textResult.height + spacing, + imgResult.width, + imgResult.height, + ); + + return { + base64: canvas.toDataURL(), + width: maxWidth, + height: totalHeight, + }; +}; + +export const getBillboard = async ({ image, name = "" }) => { + const { base64, width, height } = await getBillboardCanvases(image, name); + return { + image: base64, + width, + height, + verticalOrigin: window.Cesium.VerticalOrigin.BOTTOM, + horizontalOrigin: window.Cesium.HorizontalOrigin.CENTER, + heightReference: window.Cesium.HeightReference.CLAMP_TO_GROUND, + disableDepthTestDistance: Number.POSITIVE_INFINITY, + clampToGround: true, + }; +}; + +export const createEntityCollection = (name) => { + return new window.Cesium.CustomDataSource(`${name}_${createId()}`); +}; + +export const removeEntityCollection = (viewer, name) => { + viewer.dataSources._dataSources + .filter(ds => ds.name.startsWith(`${name}_`)) + .forEach((item) => { + viewer.dataSources.remove(item); + }); +}; + +export const createMergedEntityCollection = (viewer, name) => { + const mergedDataSource = createEntityCollection(name); + viewer.dataSources._dataSources + .filter(ds => + ds.name.startsWith(`${name.substring(0, name.indexOf("Merged"))}_`), + ) + .forEach((dataSource) => { + dataSource.entities.values.forEach((entity) => { + mergedDataSource.entities.add(entity); + }); + }); + return mergedDataSource; +}; + +export const addMergedEntityCollection = async (viewer, firstName, lastName = "") => { + const mergedDataSource = createMergedEntityCollection(viewer, `${firstName}Merged${lastName ? `_${lastName}` : ""}`); + await viewer.dataSources.add(mergedDataSource); + removeEntityCollection(viewer, `${firstName}${lastName ? `_${lastName}` : ""}`); + return mergedDataSource; +}; + +export const chunkedLoad = async (dataArray, chunkSize = 10, processItem) => { + const results = []; + for (let i = 0; i < dataArray.length; i += chunkSize) { + const chunk = dataArray.slice(i, i + chunkSize); + const chunkResults = await Promise.all(chunk.map(processItem)); + results.push(...chunkResults.filter(Boolean)); + } + return results; +}; diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/images/h.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/images/h.png new file mode 100644 index 0000000..31cec4a Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/images/h.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/index.js new file mode 100644 index 0000000..35fcabb --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/index.js @@ -0,0 +1,132 @@ +import { useEventEmitter, useMount } from "ahooks"; +import { Button, Descriptions, Modal } from "antd"; +import { useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import ExpertEmergencyRescueTeamView from "~/pages/Container/Enterprise/EmergencyOrganization/EmergencyExpertTeam/ExpertEmergencyRescueTeam/View"; +import EnterpriseEmergencyOrganizationView from "~/pages/Container/Enterprise/EmergencyOrganization/EmergencyManagementOrganization/EnterpriseEmergencyOrganization/View"; +import CommunicationGuaranteeOrganizationView from "~/pages/Container/Enterprise/EmergencyOrganization/ProfessionalGuaranteeOrganization/CommunicationGuaranteeOrganization/View"; +import MedicalGuaranteeOrganizationView from "~/pages/Container/Enterprise/EmergencyOrganization/ProfessionalGuaranteeOrganization/MedicalGuaranteeOrganization/View"; +import TechnicalSupportGuaranteeOrganizationView from "~/pages/Container/Enterprise/EmergencyOrganization/ProfessionalGuaranteeOrganization/TechnicalSupportGuaranteeOrganization/View"; +import TransportGuaranteeOrganizationView from "~/pages/Container/Enterprise/EmergencyOrganization/ProfessionalGuaranteeOrganization/TransportGuaranteeOrganization/View"; +import ClosedCardPortView from "~/pages/Container/Enterprise/EmergencyResource/ClosedCardPort/View"; +import DrainageWellView from "~/pages/Container/Enterprise/EmergencyResource/DrainageWell/View"; +import EmergencyShelterView from "~/pages/Container/Enterprise/EmergencyResource/EmergencyShelter/View"; +import MaterialEquipmentView from "~/pages/Container/Enterprise/EmergencyResource/MaterialEquipment/View"; +import MarkOptions from "../MarkOptions"; +import { useCesiumMap } from "./useCesiumMap"; + +function Cesium(props) { + const [modalVisible, setModalVisible] = useState(false); + const [modalType, setModalType] = useState(""); + const [modalTitle, setModalTitle] = useState(""); + const [modalInfo, setModalInfo] = useState({}); + + const [form] = FormBuilder.useForm(); + + const mackClickEvent = useEventEmitter(); + + mackClickEvent.useSubscription((value) => { + setModalVisible(true); + setModalType(value.mapType); + setModalTitle(value.data.modalTitle); + if (value.mapType === "default") { + setModalInfo(props.urlState); + } + else { + setModalInfo(value.data); + } + }); + + const { loadCesiumMap, initCesiumMap, drawScope, addMarkPoint, removeMarkPoint } = useCesiumMap(mackClickEvent); + + useMount(async () => { + await loadCesiumMap(); + initCesiumMap(); + }); + + const onDrawScope = (values) => { + drawScope(values.scope); + }; + + return ( +
+
+ 确定 }, + ]} + form={form} + onFinish={onDrawScope} + /> +
+
+ + { + modalVisible && ( + { + setModalVisible(false); + setModalType(""); + setModalTitle(""); + setModalInfo({}); + }} + /> + ) + } +
+ ); +} + +const MarkModal = (props) => { + const info = props.info; + const id = props.info.id; + const type = props.type; + + return ( + 取消, + ]} + > + { + type === "default" && ( + + ) + } + {type === "materialEquipment" && } + {type === "emergencyShelter" && } + {type === "drainageWell" && } + {type === "closedCardPort" && } + {type === "expertEmergencyRescueTeam" && } + {type === "transportGuaranteeOrganization" && } + {type === "medicalGuaranteeOrganization" && } + {type === "communicationGuaranteeOrganization" && } + {type === "technicalSupportGuaranteeOrganization" && } + {type === "enterpriseEmergencyOrganization" && } + + ); +}; + +export default Cesium; diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/useCesiumMap.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/useCesiumMap.js new file mode 100644 index 0000000..39543fe --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/Cesium/useCesiumMap.js @@ -0,0 +1,140 @@ +import { useRef } from "react"; +import CesiumMap from "zy-react-library/components/Map/CesiumMap"; +import { dynamicLoadCss, dynamicLoadJs } from "zy-react-library/utils"; +import { + addMergedEntityCollection, + chunkedLoad, + createEntityCollection, + createId, + filterNull, + getBillboard, + getPosition, + removeEntityCollection, +} from "./cesiumUtils"; +import defaultBillboardImage from "./images/h.png"; + +export const useCesiumMap = (mackClickEvent) => { + const mapInstanceRef = useRef(null); + + const loadCesiumMap = async () => { + if (!window.Cesium) { + if (window?.base?.loadDynamicResource) { + await window.base.loadDynamicResource({ + url: "https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Cesium.js", + type: "script", + attr: { type: "text/javascript" }, + }); + await window.base.loadDynamicResource({ + url: "https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Widgets/widgets.css", + type: "link", + attr: { rel: "stylesheet", type: "text/css" }, + }); + } + else { + await dynamicLoadJs("https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Cesium.js"); + await dynamicLoadCss("https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Widgets/widgets.css"); + } + } + }; + + const flyTo = ({ longitude, latitude, height }) => { + mapInstanceRef.current.camera.flyTo({ + destination: getPosition(longitude, latitude, height), + duration: 2, + }); + }; + + const registerClickEvent = () => { + mapInstanceRef.current.cesiumWidget.screenSpaceEventHandler.removeInputAction(window.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK); + mapInstanceRef.current.cesiumWidget.screenSpaceEventHandler.removeInputAction(window.Cesium.ScreenSpaceEventType.LEFT_CLICK); + const screenSpaceEventHandler = new window.Cesium.ScreenSpaceEventHandler(mapInstanceRef.current.scene.canvas); + screenSpaceEventHandler.setInputAction((movement) => { + const pick = mapInstanceRef.current.scene.pick(movement.position); + if (window.Cesium.defined(pick) && pick.id?.id && pick.id?.monitorItems) { + const data = pick.id.monitorItems.data; + const mapType = data.mapType.substring(data.mapType.indexOf("_") + 1); + mackClickEvent.emit({ mapType, data: pick.id.monitorItems.data }); + } + }, window.Cesium.ScreenSpaceEventType.LEFT_CLICK); + }; + + const addMarkPoint = async (pointList, options) => { + await chunkedLoad(filterNull(pointList), 10, async (item) => { + const entityCollection = createEntityCollection( + `markEntityCollection_${options.mapType}`, + ); + const name = item[options.nameKey] || ""; + entityCollection.entities.add( + new window.Cesium.Entity({ + id: createId(), + name, + position: getPosition(item.longitude, item.latitude), + billboard: await getBillboard({ image: options.mapIcon || defaultBillboardImage, name }), + monitorItems: { + data: { ...item, mapType: `标记点_${options.mapType}`, modalTitle: options.modalTitle }, + }, + }), + ); + mapInstanceRef.current.dataSources.add(entityCollection); + }); + await addMergedEntityCollection( + mapInstanceRef.current, + "markEntityCollection", + options.mapType, + ); + }; + + const removeMarkPoint = (mapType) => { + removeEntityCollection(mapInstanceRef.current, `markEntityCollectionMerged${mapType ? `_${mapType}` : ""}`); + }; + + const initCesiumMap = () => { + const { init } = new CesiumMap(); + const { viewer } = init(); + mapInstanceRef.current = viewer; + flyTo({ longitude: window.mapLongitude, latitude: window.mapLatitude, height: 2000 }); + addMarkPoint([{ longitude: window.mapLongitude, latitude: window.mapLatitude }], { mapType: "default", modalTitle: "事件" }); + registerClickEvent(); + return viewer; + }; + + const getViewer = () => { + return mapInstanceRef.current; + }; + + const drawScope = (radius) => { + const viewer = mapInstanceRef.current; + if (!viewer || !radius) + return; + + const existingEntity = viewer.entities.getById("scopeCircle"); + if (existingEntity) { + viewer.entities.remove(existingEntity); + } + + viewer.entities.add({ + id: "scopeCircle", + position: getPosition(window.mapLongitude, window.mapLatitude), + ellipse: { + semiMinorAxis: radius, + semiMajorAxis: radius, + material: window.Cesium.Color.RED.withAlpha(0.3), + outline: true, + outlineColor: window.Cesium.Color.RED, + outlineWidth: 2, + }, + }); + + flyTo({ longitude: window.mapLongitude, latitude: window.mapLatitude, height: radius * 3 }); + }; + + return { + viewer: mapInstanceRef.current, + loadCesiumMap, + initCesiumMap, + getViewer, + drawScope, + addMarkPoint, + removeMarkPoint, + }; +}; diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/CommandFeedbackRecords/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/CommandFeedbackRecords/index.js new file mode 100644 index 0000000..7f5ed4e --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/CommandFeedbackRecords/index.js @@ -0,0 +1,110 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import VirtualList from "@rc-component/virtual-list"; +import { useInterval } from "ahooks"; +import { Image, Space } from "antd"; +import { useEffect, useState } from "react"; +import { NS_RESUE } from "~/enumerate/namespace"; +import circle from "../../images/circle.png"; + +function CommandFeedbackRecords(props) { + const [list, setList] = useState([]); + + const getData = async () => { + const { data } = await props["rescueCommandFeedbackRecords"]({ id: props.id }); + setList(data || []); + }; + + props.getCommandEvent.useSubscription(() => { + getData(); + }); + + useInterval(() => { + getData(); + }, 5000); + + useEffect(() => { + getData(); + }, []); + + return ( +
+
+ + 预案指令反馈记录 +
+
+ {list.length > 0 + ? ( + + {item => ( +
+
+
+
+
+ 指令编号: + {item.commandNumber} +
+
+ 发送时间: + {item.sendTime} +
+
+ 指令类型: + {item.commandType} +
+
+ 指令内容: + {item.commandContent} +
+
+
+ {item.rescueInstructionExecutorFeedbackCOList.map((feedback, feedbackIndex) => ( +
+
+
+
+ 指令反馈 + {String(item.rescueInstructionExecutorFeedbackCOList.length - feedbackIndex).padStart(2, "0")} +
+
+ 反馈时间: + {feedback.feedbackTime} +
+
+ 指令执行状态: + {feedback.commandStatus} +
+
+ 反馈内容: + {feedback.feedbackContent} +
+
+ 现场图片: +
+ + {(feedback.feedbackImageUrl ? feedback.feedbackImageUrl.split(",") : []).map((img, imgIndex) => ( + feedback + ))} + +
+
+
+
+ ))} +
+ )} + + ) + :
暂无数据
} +
+
+ ); +} + +export default Connect([NS_RESUE], true)(CommandFeedbackRecords); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/EventHandlingRecords/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/EventHandlingRecords/index.js new file mode 100644 index 0000000..7bdc5ea --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/EventHandlingRecords/index.js @@ -0,0 +1,91 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import VirtualList from "@rc-component/virtual-list"; +import { Button, Input, message, Space } from "antd"; +import { useEffect, useState } from "react"; +import { NS_RESUE } from "~/enumerate/namespace"; +import circle from "~/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/circle.png"; + +function EventHandlingRecords(props) { + const [list, setList] = useState([]); + const [value, setValue] = useState(""); + + const getData = async () => { + const { data } = await props["rescueEventHandlingRecordListAll"]({ id: props.id }); + setList(data || []); + }; + + useEffect(() => { + getData(); + }, []); + + const onSubmit = async () => { + if (!value) { + message.error("请输入内容"); + return; + } + const { success } = await props["rescueCommandEventHandlingRecordsAdd"]({ + rescueId: props.id, + handlingContent: value, + }); + if (success) { + message.success("添加成功"); + setValue(""); + getData(); + } + }; + + return ( +
+
+ + 事件处置记录 +
+
+ {list.length > 0 + ? ( + + {item => ( +
+
+
{item.handlingTime}
+
{item.handlingContent}
+
+ )} + + ) + : ( +
+ 暂无数据 +
+ )} +
+ setValue(e.target.value)} + maxLength={500} + showCount={true} + rows={3} + /> +
+ + + +
+
+
+
+ ); +} + +export default Connect([NS_RESUE], true)(EventHandlingRecords); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/MarkOptions/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/MarkOptions/index.js new file mode 100644 index 0000000..1fc61e9 --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/MarkOptions/index.js @@ -0,0 +1,255 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { produce } from "immer"; +import { useState } from "react"; +import { + NS_CLOSED_CARD_PORT, + NS_COMMUNICATION_GUARANTEE_ORGANIZATION, + NS_DRAINAGE_WELL, + NS_EMERGENCY_EQUIPMENT, + NS_EMERGENCY_SHELTER, + NS_ENTERPRISE_EMERGENCY_ORGANIZATION, + NS_EXPERT_EMERGENCY_RESCUE_EXPERT_GROUP, + NS_EXPERT_EMERGENCY_RESCUE_TEAM, + NS_FIREFIGHTING_EQUIPMENT, + NS_MATERIAL_EQUIPMENT, + NS_MEDICAL_GUARANTEE_ORGANIZATION, + NS_TECHNICAL_SUPPORT_GUARANTEE_ORGANIZATION, + NS_TRANSPORT_GUARANTEE_ORGANIZATION, +} from "~/enumerate/namespace"; +// import ico1 from "../../images/ico1.png"; +import ico2 from "../../images/ico2.png"; +import ico3 from "../../images/ico3.png"; +import ico4 from "../../images/ico4.png"; +import ico5 from "../../images/ico5.png"; +import ico6 from "../../images/ico6.png"; +import ico7 from "../../images/ico7.png"; +// import ico8 from "../../images/ico8.png"; +import ico9 from "../../images/ico9.png"; +import ico10 from "../../images/ico10.png"; +import ico11 from "../../images/ico11.png"; +import ico12 from "../../images/ico12.png"; +import ico13 from "../../images/ico13.png"; +import option_bg from "../../images/option_bg.png"; + +function MarkOptions(props) { + const [list, setList] = useState([ + { + title: "应急救援物资", + checked: false, + children: [ + // { + // title: "应急装备", + // checked: false, + // icon: ico1, + // nameKey: "equipmentName", + // action: props["emergencyEquipmentListAll"], + // type: "emergencyEquipment", + // }, + { + title: "物资装备库", + checked: false, + icon: ico2, + nameKey: "warehouseName", + action: props["materialEquipmentListAll"], + type: "materialEquipment", + }, + { + title: "应急避难场所", + checked: false, + icon: ico3, + nameKey: "placeName", + action: props["emergencyShelterListAll"], + type: "emergencyShelter", + }, + { + title: "消防物资", + checked: false, + icon: ico4, + action: props["firefightingEquipmentListAll"], + type: "firefightingEquipment", + }, + { + title: "排水井", + checked: false, + icon: ico5, + nameKey: "wellName", + action: props["drainageWellListAll"], + type: "drainageWell", + }, + { + title: "封闭卡口", + checked: false, + icon: ico6, + nameKey: "checkpointName", + action: props["closedCardPortListAll"], + type: "closedCardPort", + }, + ], + }, + { + title: "应急专家队伍", + checked: false, + children: [ + { + title: "应急救援队伍", + checked: false, + icon: ico7, + nameKey: "teamName", + action: props["expertEmergencyRescueTeamListAll"], + type: "expertEmergencyRescueTeam", + }, + // { + // title: "应急救援专家组", + // checked: false, + // icon: ico8, + // nameKey: "groupName", + // action: props["expertEmergencyRescueExpertGroupListAll"], + // type: "expertEmergencyRescueExpertGroup", + // }, + ], + }, + { + title: "专业保障机构", + checked: false, + children: [ + { + title: "运输保障机构", + checked: false, + icon: ico9, + nameKey: "agencyName", + action: props["transportGuaranteeOrganizationListAll"], + type: "transportGuaranteeOrganization", + }, + { + title: "医疗保障机构", + checked: false, + icon: ico10, + nameKey: "agencyName", + action: props["medicalGuaranteeOrganizationListAll"], + type: "medicalGuaranteeOrganization", + }, + { + title: "通讯保障机构", + checked: false, + icon: ico11, + nameKey: "agencyName", + action: props["communicationGuaranteeOrganizationListAll"], + type: "communicationGuaranteeOrganization", + }, + { + title: "技术支持机构", + checked: false, + icon: ico12, + nameKey: "agencyName", + action: props["technicalSupportGuaranteeOrganizationListAll"], + type: "technicalSupportGuaranteeOrganization", + }, + ], + }, + { + title: "企业应急机构", + checked: false, + icon: ico13, + nameKey: "agencyName", + action: props["enterpriseEmergencyOrganizationListAll"], + type: "enterpriseEmergencyOrganization", + }, + ]); + + const onClickFirst = async (item, index) => { + setList(produce((draft) => { + draft.forEach((draftItem, draftIndex) => { + (draftIndex !== index && draftItem.children) && (draftItem.checked = false); + }); + draft[index].checked = !draft[index].checked; + })); + if (item.action) { + if (item.checked) { + props.removeMarkPoint(item.type); + return; + } + const { data } = await item.action(); + props.addMarkPoint(data, { + mapType: item.type, + mapIcon: item.icon, + modalTitle: item.title, + nameKey: item.nameKey, + }); + } + }; + + const onClickLast = async (parentIndex, item, index) => { + setList(produce((draft) => { + draft[parentIndex].children[index].checked = !draft[parentIndex].children[index].checked; + })); + if (item.action) { + if (item.checked) { + props.removeMarkPoint(item.type); + return; + } + const { data } = await item.action(); + props.addMarkPoint(data, { + mapType: item.type, + mapIcon: item.icon, + modalTitle: item.title, + nameKey: item.nameKey, + }); + } + }; + + return ( +
+ { + list.map((item, index) => ( +
+
{ + onClickFirst(item, index); + }} + > +
{item.title}
+
+ {item.checked && item.children && ( +
+ { + item.children.map((child, childIndex) => ( +
{ + onClickLast(index, child, childIndex); + }} + > +
{child.title}
+
+ )) + } +
+ )} +
+ )) + } +
+ ); +} + +export default Connect([ + NS_EMERGENCY_EQUIPMENT, + NS_MATERIAL_EQUIPMENT, + NS_EMERGENCY_SHELTER, + NS_FIREFIGHTING_EQUIPMENT, + NS_DRAINAGE_WELL, + NS_CLOSED_CARD_PORT, + NS_EXPERT_EMERGENCY_RESCUE_TEAM, + NS_EXPERT_EMERGENCY_RESCUE_EXPERT_GROUP, + NS_TRANSPORT_GUARANTEE_ORGANIZATION, + NS_MEDICAL_GUARANTEE_ORGANIZATION, + NS_COMMUNICATION_GUARANTEE_ORGANIZATION, + NS_TECHNICAL_SUPPORT_GUARANTEE_ORGANIZATION, + NS_ENTERPRISE_EMERGENCY_ORGANIZATION, +], true)(MarkOptions); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/NonContingencyInstructions/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/NonContingencyInstructions/index.js new file mode 100644 index 0000000..4eaa19a --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/NonContingencyInstructions/index.js @@ -0,0 +1,239 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import VirtualList from "@rc-component/virtual-list"; +import { message, Modal } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +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_EMERGENCY_PERSONNEL, NS_ENTERPRISE_PLAN, NS_RESUE } from "~/enumerate/namespace"; +import circle from "~/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/circle.png"; + +function NonContingencyInstructions(props) { + const [sendCommandModalVisible, setSendCommandModalVisible] = useState(false); + const [currentInfo, setCurrentInfo] = useState({}); + const [modalSubTitle, setModalSubTitle] = useState(""); + + const { + tableProps: enterprisePlanOrganizationPersonnelTableProps, + getData: enterprisePlanOrganizationPersonnelGetData, + } = useTable(props["enterprisePlanOrganizationPersonnelListAll"], { + params: { planId: props.planId }, + usePagination: false, + useStorageQueryCriteria: false, + manual: true, + }); + const { tableProps: enterpriseEmergencyPersonnelTableProps } = useTable(props["enterpriseEmergencyPersonnelListAll"], { + usePagination: false, + useStorageQueryCriteria: false, + }); + + useEffect(() => { + props.planId && enterprisePlanOrganizationPersonnelGetData(); + }, [props.planId]); + + return ( +
+
+ + 非预案指令发送 +
+
+ { + props.planId && ( + <> +
预案应急救援机构人员
+
+
+
姓名
+
组内岗位
+
联系电话
+
操作
+
+
0 ? "transparent" : "#fff"}` }} + > + { + enterprisePlanOrganizationPersonnelTableProps.dataSource.length > 0 + ? ( + + {item => ( + + )} + + ) + : ( +
+ 暂无数据 +
+ ) + } +
+
+ + ) + } +
+
企业应急救援机构人员
+
+
+
姓名
+
行政职务
+
联系电话
+
操作
+
+
0 ? "transparent" : "#fff"}` }} + > + { + enterpriseEmergencyPersonnelTableProps.dataSource.length > 0 + ? ( + + {item => ( + + )} + + ) + : ( +
+ 暂无数据 +
+ ) + } +
+
+
+ { + sendCommandModalVisible && ( + { + setSendCommandModalVisible(false); + setCurrentInfo({}); + }} + /> + ) + } +
+
+ ); +} + +const SendCommandModalComponent = (props) => { + const [form] = FormBuilder.useForm(); + + const onSubmit = async (values) => { + const { success } = await props["rescueCommandSendCommand"]({ + ...values, + rescueId: props.id, + userId: props.info.id, + }); + if (success) { + message.success("发送成功"); + props.onCancel(); + props.getCommandEvent.emit(); + } + }; + + return ( + + {props.subTitle}} + options={false} + disabledResizer={true} + pagination={false} + columns={props.subTitle === "预案应急救援机构人员" + ? [ + { title: "所属机构", dataIndex: "organizationName" }, + { title: "姓名", dataIndex: "userName" }, + { title: "职务", dataIndex: "position" }, + { title: "组内岗位", dataIndex: "groupPost" }, + { title: "联系电话", dataIndex: "contactPhone" }, + ] + : [ + { title: "姓名", dataIndex: "userName" }, + { title: "行政职务", dataIndex: "administrativePosition" }, + { title: "行政级别", dataIndex: "administrativeLevel" }, + { title: "联系电话", dataIndex: "contactPhone" }, + ]} + dataSource={[props.info]} + /> + + + ); +}; + +const SendCommandModal = Connect([NS_RESUE], true)(SendCommandModalComponent); +export default Connect([NS_RESUE, NS_ENTERPRISE_EMERGENCY_PERSONNEL, NS_ENTERPRISE_PLAN], true)(NonContingencyInstructions); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/SelectEmergencyPlan/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/SelectEmergencyPlan/index.js new file mode 100644 index 0000000..415fdca --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/components/SelectEmergencyPlan/index.js @@ -0,0 +1,163 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Space } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE_PLAN, NS_RESUE } from "~/enumerate/namespace"; + +function SelectEmergencyPlan(props) { + const [form] = FormBuilder.useForm(); + + const [enterprisePlanList, setEnterprisePlanList] = useState([]); + const [responseLevelList, setResponseLevelList] = useState([]); + const [isActivatePlan, setIsActivatePlan] = useState(false); + const [info, setInfo] = useState({}); + + const getEnterprisePlanList = async () => { + const { data } = await props["enterprisePlanBasicInfoListAll"]({ auditFlag: 2 }); + setEnterprisePlanList(data); + }; + + const getResponseLevelList = async (planId) => { + const { data } = await props["enterprisePlanLevelResponseListAll"]({ planId }); + setResponseLevelList(data); + }; + + useEffect(() => { + getEnterprisePlanList(); + }, []); + + useEffect(() => { + if (props.urlState.planId) { + setIsActivatePlan(true); + setInfo(props.urlState); + props.setUrlState({ + planId: props.urlState.planId, + planName: props.urlState.planName, + responseLevel: props.urlState.responseLevel, + responseLevelName: props.urlState.responseLevelName, + }); + props.getCommandEvent.emit(); + } + }, [props.urlState]); + + useEffect(() => { + props.urlState.planId && getResponseLevelList(props.urlState.planId); + }, [props.urlState.planId]); + + const onActivatePlan = async (values) => { + const { success } = await props["rescueCommandUsePlan"]({ rescueId: props.id, ...values }); + if (success) { + setIsActivatePlan(true); + setInfo(values); + props.setUrlState({ + planId: values.planId, + planName: values.planName, + responseLevel: values.responseLevel, + responseLevelName: values.responseLevelName, + }); + props.getCommandEvent.emit(); + } + }; + + const onChangePlan = () => { + setIsActivatePlan(false); + form.setFieldsValue(info); + }; + + return ( +
+
+ { + !isActivatePlan + ? ( + <> + 0, + onChange: (value) => { + if (value) { + getResponseLevelList(value); + form.setFieldValue("planName", getLabelName({ + list: enterprisePlanList, + status: value, + nameKey: "planName", + idKey: "id", + })); + } + else { + setResponseLevelList([]); + } + }, + }, + }, + { name: "planName", label: "企业预案名称", onlyForLabel: true }, + { + name: "responseLevel", + label: "响应级别", + render: FORM_ITEM_RENDER_ENUM.SELECT, + items: responseLevelList, + itemsField: { labelKey: "levelName", valueKey: "id" }, + componentProps: { + onChange: (value) => { + form.setFieldValue("responseLevelName", getLabelName({ + list: responseLevelList, + status: value, + nameKey: "levelName", + idKey: "id", + })); + }, + }, + }, + { name: "responseLevelName", label: "响应级别名称", onlyForLabel: true }, + ]} + form={form} + onFinish={onActivatePlan} + showActionButtons={false} + /> +
+ + + +
+ + ) + : ( +
+
+
+ 预案名称: + {info.planName} +
+
+ 响应级别: + {info.responseLevelName} +
+
+
+ + + +
+
+ ) + } +
+
+ ); +} + +export default Connect([NS_ENTERPRISE_PLAN, NS_RESUE], true)(SelectEmergencyPlan); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/circle.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/circle.png new file mode 100644 index 0000000..022f574 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/circle.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico1.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico1.png new file mode 100644 index 0000000..85b6b51 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico1.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico10.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico10.png new file mode 100644 index 0000000..3d8edd5 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico10.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico11.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico11.png new file mode 100644 index 0000000..5ae5dce Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico11.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico12.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico12.png new file mode 100644 index 0000000..944fc84 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico12.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico13.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico13.png new file mode 100644 index 0000000..bc30206 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico13.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico2.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico2.png new file mode 100644 index 0000000..4046a3e Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico2.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico3.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico3.png new file mode 100644 index 0000000..67c5bc1 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico3.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico4.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico4.png new file mode 100644 index 0000000..c181ec1 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico4.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico5.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico5.png new file mode 100644 index 0000000..0f5657f Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico5.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico6.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico6.png new file mode 100644 index 0000000..5868596 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico6.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico7.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico7.png new file mode 100644 index 0000000..6917c7f Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico7.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico8.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico8.png new file mode 100644 index 0000000..c5dd129 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico8.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico9.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico9.png new file mode 100644 index 0000000..1b9f817 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/ico9.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/option_bg.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/option_bg.png new file mode 100644 index 0000000..cc7afea Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/option_bg.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/top.png b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/top.png new file mode 100644 index 0000000..b2e0226 Binary files /dev/null and b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/images/top.png differ diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/index.js new file mode 100644 index 0000000..6dcd3ce --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/index.js @@ -0,0 +1,56 @@ +import useUrlState from "@ahooksjs/use-url-state"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { useEventEmitter } from "ahooks"; +import { Button, message } from "antd"; +import Page from "zy-react-library/components/Page"; +import { NS_RESUE } from "~/enumerate/namespace"; +import Cesium from "./components/Cesium"; +import CommandFeedbackRecords from "./components/CommandFeedbackRecords"; +import EventHandlingRecords from "./components/EventHandlingRecords"; +import NonContingencyInstructions from "./components/NonContingencyInstructions"; +import SelectEmergencyPlan from "./components/SelectEmergencyPlan"; +import top from "./images/top.png"; +import "./index.less"; + +function Command(props) { + const [urlState, setUrlState] = useUrlState({ + id: "", + planId: "", + planName: "", + responseLevel: "", + responseLevelName: "", + }, { navigateMode: "replace" }); + + const getCommandEvent = useEventEmitter(); + + const onComplete = async () => { + const { success } = await props["rescueUpdateStatus"]({ id: urlState.id, isRescueExecuted: 4 }); + if (success) { + message.success("完成救援成功"); + props.history.goBack(); + } + }; + + return ( + 完成救援}> +
+
应急指挥台
+
+
+ + +
+
+ +
+
+ + +
+
+
+
+ ); +} + +export default Connect([NS_RESUE], true)(Command); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/index.less b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/index.less new file mode 100644 index 0000000..f996040 --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/Command/index.less @@ -0,0 +1,329 @@ +.command { + background-color: #E5EDFD; + margin: -20px -20px -31px -20px; + + .top { + background-size: 100% 100%; + background-repeat: no-repeat; + height: 66px; + width: 100%; + font-size: 36px; + color: #fff; + text-align: center; + line-height: 66px; + font-weight: bold; + } + + .select-emergency-plan { + border-radius: 0 0 4px 4px; + background-image: linear-gradient(to bottom, #DAE9FA, #CFE5FF); + padding: 10px; + border-width: 2px; + border-style: solid; + border-image: linear-gradient(to top, #FFFFFF, #D1E1F9) 1; + + .container { + border-radius: 2px; + background-color: #E4F0FF; + border-width: 2px; + border-style: solid; + border-image: linear-gradient(to top, #FFFFFF, #D9EFFD) 1; + box-shadow: inset 0 0 3px 0 rgba(49, 122, 202, 0.48); + padding: 15px; + } + } + + .command-feedback-records { + margin-top: 10px; + border-radius: 0 0 4px 4px; + background-image: linear-gradient(to bottom, #DAE9FA, #CFE5FF); + padding: 10px; + border-width: 2px; + border-style: solid; + border-image: linear-gradient(to top, #FFFFFF, #D1E1F9) 1; + + .title { + img { + width: 18px; + height: 18px; + } + + span { + padding-left: 6px; + color: #222222; + font-size: 14px; + font-weight: bold; + } + } + + .container { + padding-left: 20px; + + .timeline-item { + position: relative; + padding-left: 20px; + margin-top: 10px; + + &::before { + content: ''; + position: absolute; + left: 10px; + top: 0; + bottom: -10px; + width: 2px; + background-color: #5B8CFF; + } + + &:last-child::before { + bottom: 0; + } + + .timeline-dot { + position: absolute; + left: 6px; + top: 15px; + width: 10px; + height: 10px; + border-radius: 50%; + border: 2px solid #5B8CFF; + background-color: #fff; + z-index: 1; + } + + .parent { + .timeline-dot { + top: 15px; + } + } + } + + .parent, .child { + margin-top: 10px; + border-radius: 2px; + background-color: rgb(255 255 255 / 0.41); + border-width: 1px; + border-style: solid; + border-image: linear-gradient(to top, #FFFFFF, #D9EFFD) 1; + padding: 10px; + + .label { + color: #666666; + font-size: 14px; + } + } + } + } + + .non-contingency-instructions { + border-radius: 0 0 4px 4px; + background-image: linear-gradient(to bottom, #DAE9FA, #CFE5FF); + padding: 5px; + border-width: 2px; + border-style: solid; + border-image: linear-gradient(to top, #FFFFFF, #D1E1F9) 1; + + .title { + img { + width: 18px; + height: 18px; + } + + span { + padding-left: 6px; + color: #222222; + font-size: 14px; + font-weight: bold; + } + } + + .container { + .subtitle { + margin-left: 10px; + color: #3B445C; + font-size: 14px; + position: relative; + + &::before { + content: ''; + position: absolute; + left: -10px; + top: 7px; + bottom: 0; + width: 3px; + height: 13px; + background-color: #3796FF; + } + } + + .table { + font-size: 13px; + margin-top: 5px; + text-align: center; + + .header { + font-weight: bold; + display: grid; + grid-template-columns: 0.8fr 1fr 1fr 0.6fr; + + .title { + color: #3B445C; + border: 1px solid #fff; + background-color: #C4E2F8; + } + } + + .body { + border-top: none !important; + + .row { + display: grid; + grid-template-columns: 0.8fr 1fr 1fr 0.6fr; + + .cell { + border: 1px solid #fff; + } + } + } + } + } + } + + .event-handling-records { + margin-top: 10px; + border-radius: 0 0 4px 4px; + background-image: linear-gradient(to bottom, #DAE9FA, #CFE5FF); + padding: 5px; + border-width: 2px; + border-style: solid; + border-image: linear-gradient(to top, #FFFFFF, #D1E1F9) 1; + + .title { + img { + width: 18px; + height: 18px; + } + + span { + padding-left: 6px; + color: #222222; + font-size: 14px; + font-weight: bold; + } + } + + .container { + margin-top: 10px; + + .time { + color: #222222; + font-weight: bold; + } + + .content { + color: #444444; + } + + .timeline-item { + position: relative; + padding-left: 20px; + margin-top: 10px; + + &::before { + content: ''; + position: absolute; + left: 10px; + top: 0; + bottom: -10px; + width: 2px; + background-color: #5B8CFF; + } + + &:last-child::before { + bottom: 0; + } + + .timeline-dot { + position: absolute; + left: 6px; + top: 7px; + width: 10px; + height: 10px; + border-radius: 50%; + border: 2px solid #5B8CFF; + background-color: #fff; + z-index: 1; + } + } + } + } + + .cesium { + .form { + position: absolute; + top: 20px; + left: 20px; + z-index: 1; + width: 100%; + + label { + color: #fff; + } + } + + .mark-options { + display: flex; + justify-content: space-around; + gap: 25px; + position: absolute; + width: 100%; + bottom: 0; + + &-item { + text-align: center; + cursor: pointer; + padding: 10px; + width: 194px; + height: 48px; + color: #3796FF; + font-size: 16px; + font-weight: bold; + position: relative; + background-size: 100% 100%; + background-repeat: no-repeat; + + &-children { + position: absolute; + bottom: 55px; + left: 50%; + transform: translateX(-50%); + background-color: #D3E7FF; + width: 80%; + padding: 10px; + border-radius: 0 0 4px 4px; + border-width: 1px; + border-style: solid; + border-image: linear-gradient(to top, #1F89E3, #A2C3EA) 1; + + &-item { + text-align: center; + cursor: pointer; + padding: 5px; + font-size: 14px; + font-weight: normal; + color: #000; + border: 1px solid transparent; + + &.active{ + color: #fff; + background-color: #3796FF; + border-radius: 0 0 4px 4px; + border-width: 1px; + border-style: solid; + border-image: linear-gradient(to top, #1F89E3, #A2C3EA) 1; + } + } + } + } + } + } +} diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/List/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/List/index.js new file mode 100644 index 0000000..d383371 --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/List/index.js @@ -0,0 +1,147 @@ +import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Space } from "antd"; +import dayjs from "dayjs"; +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 { NS_EVENT_REPORT, NS_RESUE } from "~/enumerate/namespace"; + +function List(props) { + const [form] = Search.useForm(); + + const { tableProps, getData } = useTable(props["eventReportList"], { + form, + params: { isEventOrRescue: 2 }, + }); + + return ( + + +
getLabelName({ list: [ + { bianma: 1, name: "未执行" }, + { bianma: 2, name: "未开始" }, + { bianma: 3, name: "进行中" }, + { bianma: 4, name: "已完成" }, + ], status: record.isRescueExecuted }), + }, + { + title: "操作", + width: 200, + fixed: "right", + render: (_, record) => ( + + {(record.isEventReportSpecial === 2 && props.permission("qyd-rescue-view")) && ( + + )} + { + (record.isRescueExecuted !== 4 && props.permission("qyd-rescue-command")) && ( + + ) + } + { + (record.isRescueExecuted === 4 && props.permission("qyd-rescue-rescue-record")) && ( + + ) + } + { + (record.isRescueExecuted === 4 && record.isEventReportSpecial === 1 && props.permission("qyd-rescue-special-report")) && ( + + ) + } + + ), + }, + ]} + {... + tableProps + } + /> + + ) + ; +} + +export default Connect([NS_EVENT_REPORT, NS_RESUE], true)(Permission(List)); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/RescueRecord/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/RescueRecord/index.js new file mode 100644 index 0000000..49ed22d --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/RescueRecord/index.js @@ -0,0 +1,69 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Descriptions, Divider } from "antd"; +import Page from "zy-react-library/components/Page"; +import Table from "zy-react-library/components/Table"; +import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_RESUE } from "~/enumerate/namespace"; + +function RescueRecord(props) { + const query = useGetUrlQuery(); + + const { tableProps: executionRecordTableProps } = useTable(props["rescueExecutionRecordList"], { + params: { id: query.id }, + useStorageQueryCriteria: false, + }); + const { tableProps: eventHandlingRecordTableProps } = useTable(props["rescueEventHandlingRecordList"], { + params: { id: query.id }, + useStorageQueryCriteria: false, + }); + + return ( + + 指挥相关数据 + + 执行记录 +
(), + }, + { title: "完成状态", dataIndex: "commandStatus" }, + ]} + {...executionRecordTableProps} + /> + 事件处置记录 +
+ + ); +} + +export default Connect([NS_RESUE], true)(RescueRecord); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/SpecialReport/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/SpecialReport/index.js similarity index 92% rename from src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/SpecialReport/index.js rename to src/pages/Container/Enterprise/EmergencyRescue/Rescue/SpecialReport/index.js index fb91ffc..76644b3 100644 --- a/src/pages/Container/Enterprise/EmergencyRescue/EmergencyReporting/EventReport/SpecialReport/index.js +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/SpecialReport/index.js @@ -9,7 +9,7 @@ import DictionarySelect from "zy-react-library/components/Select/Dictionary"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import { PHONE } from "zy-react-library/regular"; -import { NS_EVENT_REPORT } from "~/enumerate/namespace"; +import { NS_RESUE } from "~/enumerate/namespace"; function Add(props) { const query = useGetUrlQuery(); @@ -23,7 +23,7 @@ function Add(props) { const { success } = await props["eventReportSpecialReportSave"]({ ...values, eventReportId: query.id, - regionCode: values.regionCode.join(","), + regionCode: values.regionCode?.join(","), }); if (success) { message.success("新增成功"); @@ -34,10 +34,10 @@ function Add(props) { return ( ) }, { name: "reportType", label: "接报类型" }, { name: "accidentTitle", label: "事故标题" }, @@ -110,4 +110,4 @@ function Add(props) { ); } -export default Connect([NS_EVENT_REPORT], true)(Add); +export default Connect([NS_RESUE], true)(Add); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/View/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/View/index.js new file mode 100644 index 0000000..98921d3 --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/View/index.js @@ -0,0 +1,71 @@ +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 useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import { NS_RESUE } from "~/enumerate/namespace"; + +function View(props) { + const query = useGetUrlQuery(); + + const [info, setInfo] = useState({}); + + const getData = async () => { + const { data } = await props["eventReportSpecialReportInfo"]({ id: query.id }); + setInfo(data); + }; + + useEffect(() => { + getData(); + }, []); + + return ( + + + + + + ); +} + +export default Connect([NS_RESUE], true)(View); diff --git a/src/pages/Container/Enterprise/EmergencyRescue/Rescue/index.js b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/index.js new file mode 100644 index 0000000..b0b175e --- /dev/null +++ b/src/pages/Container/Enterprise/EmergencyRescue/Rescue/index.js @@ -0,0 +1,5 @@ +function Rescue(props) { + return props.children; +} + +export default Rescue; diff --git a/src/pages/Container/Enterprise/EmergencyResource/ClosedCardPort/View/index.js b/src/pages/Container/Enterprise/EmergencyResource/ClosedCardPort/View/index.js index 8bd3770..15bacf6 100644 --- a/src/pages/Container/Enterprise/EmergencyResource/ClosedCardPort/View/index.js +++ b/src/pages/Container/Enterprise/EmergencyResource/ClosedCardPort/View/index.js @@ -11,20 +11,23 @@ function View(props) { const [info, setInfo] = useState({}); const getData = async () => { - const { data } = await props["closedCardPortInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["closedCardPortInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + { - const { data } = await props["drainageWellInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["drainageWellInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + { - const { data } = await props["emergencyShelterInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["emergencyShelterInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - + { - const { data } = await props["materialEquipmentInfo"]({ id: query.id }); + if (!props.id && !query.id) + return; + + const { data } = await props["materialEquipmentInfo"]({ id: props.id || query.id }); setInfo(data); }; useEffect(() => { getData(); - }, []); + }, [props.id]); return ( - +