refactor(map): 修改港区portArea字段类型并重命名多处组件

master
LiuJiaNan 2026-07-22 14:43:46 +08:00
parent f4d2d6766e
commit 731de8b1a8
18 changed files with 42 additions and 41 deletions

View File

@ -47,7 +47,7 @@ function CenterUtils() {
const list = [ const list = [
{ label: "秦皇岛西", portArea: 3 }, { label: "秦皇岛西", portArea: 3 },
{ label: "秦皇岛港区", portArea: 1 }, { label: "秦皇岛港区", portArea: "" },
{ label: "秦皇岛东", portArea: 2 }, { label: "秦皇岛东", portArea: 2 },
]; ];
@ -89,7 +89,7 @@ function CenterUtils() {
</div> </div>
<div className="statistics"> <div className="statistics">
<AnimatePresence> <AnimatePresence>
{[1, 3].includes(portArea) && ( {["", 3].includes(portArea) && (
<motion.div key="west" {...statisticAnimation}> <motion.div key="west" {...statisticAnimation}>
<div className="statistic"> <div className="statistic">
<div className="title" style={{ backgroundImage: `url(${statisticsTitleImg})` }}>西港区</div> <div className="title" style={{ backgroundImage: `url(${statisticsTitleImg})` }}>西港区</div>
@ -102,7 +102,7 @@ function CenterUtils() {
)} )}
</AnimatePresence> </AnimatePresence>
<AnimatePresence> <AnimatePresence>
{[1, 2].includes(portArea) && ( {["", 2].includes(portArea) && (
<motion.div key="east" {...statisticAnimation}> <motion.div key="east" {...statisticAnimation}>
<div className="statistic"> <div className="statistic">
<div className="title" style={{ backgroundImage: `url(${statisticsTitleImg})` }}>东港区</div> <div className="title" style={{ backgroundImage: `url(${statisticsTitleImg})` }}>东港区</div>

View File

@ -73,7 +73,7 @@ function Content(props) {
"danger": PortWeiXian, "danger": PortWeiXian,
"weather": PortQiXiang, "weather": PortQiXiang,
"people": PortRenYuan, "people": PortRenYuan,
"project": PortZhongDian, "keyProject": PortZhongDian,
"closedArea": PortFengBi, "closedArea": PortFengBi,
}; };
const Component = contentMap[bottomUtilsCurrentType]; const Component = contentMap[bottomUtilsCurrentType];
@ -88,7 +88,7 @@ function Content(props) {
"fire": BranchXiaoFang, "fire": BranchXiaoFang,
"people": BranchRenYuan, "people": BranchRenYuan,
"weather": BranchQiXiang, "weather": BranchQiXiang,
"project": BranchZhongDian, "keyProject": BranchZhongDian,
"closedArea": BranchFengBi, "closedArea": BranchFengBi,
"camera": BranchCamera, "camera": BranchCamera,
}; };

View File

@ -1,7 +1,7 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Descriptions } from "antd"; import { Descriptions } from "antd";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName, isEmptyToWhether } from "zy-react-library/utils";
import { NS_BI_MARK_INFO } from "~/enumerate/namespace"; import { NS_BI_MARK_INFO } from "~/enumerate/namespace";
const SENSOR_ATTR_OPTIONS = [ const SENSOR_ATTR_OPTIONS = [
@ -9,11 +9,6 @@ const SENSOR_ATTR_OPTIONS = [
{ bianma: "SWITCH", name: "开关类" }, { bianma: "SWITCH", name: "开关类" },
]; ];
const YES_NO_OPTIONS = [
{ bianma: 1, name: "是" },
{ bianma: 0, name: "否" },
];
const SENSOR_STATUS_OPTIONS = [ const SENSOR_STATUS_OPTIONS = [
{ bianma: "NORMAL", name: "正常" }, { bianma: "NORMAL", name: "正常" },
{ bianma: "FAULT", name: "故障" }, { bianma: "FAULT", name: "故障" },
@ -21,7 +16,7 @@ const SENSOR_STATUS_OPTIONS = [
{ bianma: "deactivate", name: "停用" }, { bianma: "deactivate", name: "停用" },
]; ];
const FireRescueTeam = (props) => { const AlarmEquipment = (props) => {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const getData = async () => { const getData = async () => {
@ -47,11 +42,11 @@ const FireRescueTeam = (props) => {
{ label: "传感器状态", children: getLabelName({ status: info.sensorStatus, list: SENSOR_STATUS_OPTIONS }) }, { label: "传感器状态", children: getLabelName({ status: info.sensorStatus, list: SENSOR_STATUS_OPTIONS }) },
{ label: "安装位置", children: info.installPosition }, { label: "安装位置", children: info.installPosition },
{ label: "出厂日期", children: info.factoryDate }, { label: "出厂日期", children: info.factoryDate },
{ label: "是否阈值设定", children: getLabelName({ status: info.thresholdFlag, list: YES_NO_OPTIONS }) }, { label: "是否阈值设定", children: isEmptyToWhether(info.thresholdFlag) },
]} ]}
/> />
</div> </div>
); );
}; };
export default Connect([NS_BI_MARK_INFO], true)(FireRescueTeam); export default Connect([NS_BI_MARK_INFO], true)(AlarmEquipment);

View File

@ -8,7 +8,7 @@ import OpinionSign from "../eightWordPubilc/OpinionSign";
import SafetyMeasures from "../eightWordPubilc/SafetyMeasures"; import SafetyMeasures from "../eightWordPubilc/SafetyMeasures";
import "../eightWordPubilc/index.less"; import "../eightWordPubilc/index.less";
function View(props) { function BlindBoardWork(props) {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const getData = async () => { const getData = async () => {
@ -175,4 +175,4 @@ function View(props) {
); );
} }
export default Connect([NS_BI_MARK_INFO], true)(View); export default Connect([NS_BI_MARK_INFO], true)(BlindBoardWork);

View File

@ -9,7 +9,7 @@ import OpinionSign from "../eightWordPubilc/OpinionSign";
import SafetyMeasures from "../eightWordPubilc/SafetyMeasures"; import SafetyMeasures from "../eightWordPubilc/SafetyMeasures";
import "../eightWordPubilc/index.less"; import "../eightWordPubilc/index.less";
function View(props) { function BreakGroundWork(props) {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const getData = async () => { const getData = async () => {
@ -144,4 +144,4 @@ function View(props) {
); );
} }
export default Connect([NS_BI_MARK_INFO], true)(View); export default Connect([NS_BI_MARK_INFO], true)(BreakGroundWork);

View File

@ -5,7 +5,7 @@ import { getFileUrl } from "zy-react-library/utils";
import { NS_BI_MARK_INFO } from "~/enumerate/namespace"; import { NS_BI_MARK_INFO } from "~/enumerate/namespace";
import "../eightWordPubilc/index.less"; import "../eightWordPubilc/index.less";
function View(props) { function ConfinedSpaceWork(props) {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const [safetyMeasures, setSafetyMeasures] = useState([]); const [safetyMeasures, setSafetyMeasures] = useState([]);
const [otherSafetyMeasures, setOtherSafetyMeasures] = useState([]); const [otherSafetyMeasures, setOtherSafetyMeasures] = useState([]);
@ -206,4 +206,4 @@ function View(props) {
); );
} }
export default Connect([NS_BI_MARK_INFO], true)(View); export default Connect([NS_BI_MARK_INFO], true)(ConfinedSpaceWork);

View File

@ -9,7 +9,7 @@ import OpinionSign from "../eightWordPubilc/OpinionSign";
import SafetyMeasures from "../eightWordPubilc/SafetyMeasures"; import SafetyMeasures from "../eightWordPubilc/SafetyMeasures";
import "../eightWordPubilc/index.less"; import "../eightWordPubilc/index.less";
function View(props) { function CutRoadWork(props) {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const getData = async () => { const getData = async () => {
@ -144,4 +144,4 @@ function View(props) {
); );
} }
export default Connect([NS_BI_MARK_INFO], true)(View); export default Connect([NS_BI_MARK_INFO], true)(CutRoadWork);

View File

@ -9,7 +9,7 @@ import OpinionSign from "../eightWordPubilc/OpinionSign";
import SafetyMeasures from "../eightWordPubilc/SafetyMeasures"; import SafetyMeasures from "../eightWordPubilc/SafetyMeasures";
import "../eightWordPubilc/index.less"; import "../eightWordPubilc/index.less";
function View(props) { function ElectricityWork(props) {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const [gasMonitoringRecord, setGasMonitoringRecord] = useState([]); const [gasMonitoringRecord, setGasMonitoringRecord] = useState([]);
@ -175,4 +175,4 @@ function View(props) {
); );
} }
export default Connect([NS_BI_MARK_INFO], true)(View); export default Connect([NS_BI_MARK_INFO], true)(ElectricityWork);

View File

@ -9,7 +9,7 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { NS_BI_MARK_INFO } from "~/enumerate/namespace"; import { NS_BI_MARK_INFO } from "~/enumerate/namespace";
const FireRescueTeam = (props) => { const FireControlRoom = (props) => {
const { getDictionary } = useDictionary(); const { getDictionary } = useDictionary();
const { getFile } = useGetFile(); const { getFile } = useGetFile();
@ -86,4 +86,4 @@ const FireRescueTeam = (props) => {
); );
}; };
export default Connect([NS_BI_MARK_INFO], true)(FireRescueTeam); export default Connect([NS_BI_MARK_INFO], true)(FireControlRoom);

View File

@ -2,9 +2,10 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Descriptions } from "antd"; import { Descriptions } from "antd";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import PreviewImg from "zy-react-library/components/PreviewImg"; import PreviewImg from "zy-react-library/components/PreviewImg";
import { isEmptyToWhether } from "zy-react-library/utils";
import { NS_BI_MARK_INFO } from "~/enumerate/namespace"; import { NS_BI_MARK_INFO } from "~/enumerate/namespace";
const FireRescueTeam = (props) => { const FirePointLocation = (props) => {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const getData = async () => { const getData = async () => {
@ -30,7 +31,7 @@ const FireRescueTeam = (props) => {
{ label: "消防点位编码", children: info.firePointCode }, { label: "消防点位编码", children: info.firePointCode },
{ label: "经度", children: info.longitude }, { label: "经度", children: info.longitude },
{ label: "维度", children: info.latitude }, { label: "维度", children: info.latitude },
{ label: "是否关联NFC", children: info.nfcFlag === 1 ? "是" : info.nfcFlag === 0 ? "否" : "" }, { label: "是否关联NFC", children: isEmptyToWhether(info.nfcFlag) },
{ label: "点检照片", children: (<PreviewImg files={info.urlList} />) }, { label: "点检照片", children: (<PreviewImg files={info.urlList} />) },
]} ]}
/> />
@ -38,4 +39,4 @@ const FireRescueTeam = (props) => {
); );
}; };
export default Connect([NS_BI_MARK_INFO], true)(FireRescueTeam); export default Connect([NS_BI_MARK_INFO], true)(FirePointLocation);

View File

@ -9,7 +9,7 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { NS_BI_MARK_INFO } from "~/enumerate/namespace"; import { NS_BI_MARK_INFO } from "~/enumerate/namespace";
const FireRescueTeam = (props) => { const FirePumpRoom = (props) => {
const { getDictionary } = useDictionary(); const { getDictionary } = useDictionary();
const { getFile } = useGetFile(); const { getFile } = useGetFile();
@ -76,4 +76,4 @@ const FireRescueTeam = (props) => {
); );
}; };
export default Connect([NS_BI_MARK_INFO], true)(FireRescueTeam); export default Connect([NS_BI_MARK_INFO], true)(FirePumpRoom);

View File

@ -5,7 +5,7 @@ import useDictionary from "zy-react-library/hooks/useDictionary";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { NS_BI_MARK_INFO } from "~/enumerate/namespace"; import { NS_BI_MARK_INFO } from "~/enumerate/namespace";
const FireRescueTeam = (props) => { const FireWaterSource = (props) => {
const { getDictionary } = useDictionary(); const { getDictionary } = useDictionary();
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
@ -55,4 +55,4 @@ const FireRescueTeam = (props) => {
); );
}; };
export default Connect([NS_BI_MARK_INFO], true)(FireRescueTeam); export default Connect([NS_BI_MARK_INFO], true)(FireWaterSource);

View File

@ -9,7 +9,7 @@ import OpinionSign from "../eightWordPubilc/OpinionSign";
import SafetyMeasures from "../eightWordPubilc/SafetyMeasures"; import SafetyMeasures from "../eightWordPubilc/SafetyMeasures";
import "../eightWordPubilc/index.less"; import "../eightWordPubilc/index.less";
function View(props) { function HighWork(props) {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const getData = async () => { const getData = async () => {
@ -141,4 +141,4 @@ function View(props) {
); );
} }
export default Connect([NS_BI_MARK_INFO], true)(View); export default Connect([NS_BI_MARK_INFO], true)(HighWork);

View File

@ -9,7 +9,7 @@ import OpinionSign from "../eightWordPubilc/OpinionSign";
import SafetyMeasures from "../eightWordPubilc/SafetyMeasures"; import SafetyMeasures from "../eightWordPubilc/SafetyMeasures";
import "../eightWordPubilc/index.less"; import "../eightWordPubilc/index.less";
function View(props) { function HoistingWork(props) {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const getData = async () => { const getData = async () => {
@ -153,4 +153,4 @@ function View(props) {
); );
} }
export default Connect([NS_BI_MARK_INFO], true)(View); export default Connect([NS_BI_MARK_INFO], true)(HoistingWork);

View File

@ -7,7 +7,7 @@ import { NS_BI_MARK_INFO } from "~/enumerate/namespace";
import SafetyMeasures from "../eightWordPubilc/SafetyMeasures"; import SafetyMeasures from "../eightWordPubilc/SafetyMeasures";
import "../eightWordPubilc/index.less"; import "../eightWordPubilc/index.less";
function View(props) { function HotWork(props) {
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const [delayedMonitoringRecord, setDelayedMonitoringRecord] = useState([]); const [delayedMonitoringRecord, setDelayedMonitoringRecord] = useState([]);
const [gasMonitoringRecord, setGasMonitoringRecord] = useState([]); const [gasMonitoringRecord, setGasMonitoringRecord] = useState([]);
@ -200,4 +200,4 @@ function View(props) {
); );
} }
export default Connect([NS_BI_MARK_INFO], true)(View); export default Connect([NS_BI_MARK_INFO], true)(HotWork);

View File

@ -15,7 +15,9 @@ import FireWaterSource from "./FireWaterSource";
import HighWork from "./HighWork"; import HighWork from "./HighWork";
import HoistingWork from "./HoistingWork"; import HoistingWork from "./HoistingWork";
import HotWork from "./HotWork"; import HotWork from "./HotWork";
import KeyProject from "./KeyProject";
import MeteorologicalMonitoring from "./MeteorologicalMonitoring"; import MeteorologicalMonitoring from "./MeteorologicalMonitoring";
import VideoPlay from "./VideoPlay";
const CustomModal = () => { const CustomModal = () => {
const { modalVisible, modalData, actions } = useContext(Context); const { modalVisible, modalData, actions } = useContext(Context);
@ -38,6 +40,9 @@ const CustomModal = () => {
breakground_work: <BreakGroundWork id={modalData.id} workId={modalData.workId} />, // 动土作业 breakground_work: <BreakGroundWork id={modalData.id} workId={modalData.workId} />, // 动土作业
hoisting_work: <HoistingWork id={modalData.id} workId={modalData.workId} />, // 吊装作业 hoisting_work: <HoistingWork id={modalData.id} workId={modalData.workId} />, // 吊装作业
blindboard_work: <BlindBoardWork id={modalData.id} workId={modalData.workId} />, // 盲板抽堵作业 blindboard_work: <BlindBoardWork id={modalData.id} workId={modalData.workId} />, // 盲板抽堵作业
keyProject: <KeyProject id={modalData.id} />, // 重点工程定位
video: <VideoPlay cameraNumber={modalData.cameraNumber} />, // 重点工程-视频定位
platCamera: <VideoPlay cameraNumber={modalData.cameraNumber} />, // 视频巡屏-摄像头
}[markType]; }[markType];
}; };

View File

@ -7,7 +7,7 @@ export const initialMapState = {
coverMaskVisible: false, coverMaskVisible: false,
currentPort: "", currentPort: "",
currentBranchOffice: "", currentBranchOffice: "",
portArea: 1, portArea: "",
bottomUtilsCurrentIndex: "", bottomUtilsCurrentIndex: "",
pureMap: false, pureMap: false,
headerTitle: "秦港股份安全监管平台", headerTitle: "秦港股份安全监管平台",

View File

@ -129,7 +129,7 @@ export default function useMapMethods(viewerRef, request) {
}; };
// 添加分公司点 // 添加分公司点
const addBranchOfficePoint = async (portArea = 1, pointInfo = null) => { const addBranchOfficePoint = async (portArea = "", pointInfo = null) => {
const { data = [] } = await request.getCorpInfoListAll({ eqPortArea: portArea, inType: [0, 1, 2, 6] }); const { data = [] } = await request.getCorpInfoListAll({ eqPortArea: portArea, inType: [0, 1, 2, 6] });
mitt.emit(changeCoverMaskVisibleMittKey, true); mitt.emit(changeCoverMaskVisibleMittKey, true);
let branchOfficePoint = []; let branchOfficePoint = [];