From 15d989a8c10b9dbe551c68a05d9bd5ba86574f47 Mon Sep 17 00:00:00 2001 From: fandaiyang <1147379969@qq.com> Date: Sat, 14 Dec 2024 19:44:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=9F=E8=A7=88=E9=87=8D=E7=82=B9?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MapCantainer/EmphasisAreaMap/index.tsx | 87 ++++++++++++++----- .../components/MapCantainer/index.tsx | 7 +- 2 files changed, 70 insertions(+), 24 deletions(-) diff --git a/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/index.tsx b/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/index.tsx index 94974240..a1b73e3d 100644 --- a/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/index.tsx +++ b/src/pages/SecurityServiceOverview/components/MapCantainer/EmphasisAreaMap/index.tsx @@ -61,7 +61,7 @@ const EmphasisAreaMap: React.FC = () => { const [isBmap, setIsBmap] = useState(false); const MapRef = useRef(); const [leftTabKey, setLeftTabKey] = useState('1'); - const [checkedKeys,setCheckedKeys]=useState(['aq', 'cswt']) + const [checkedKeys, setCheckedKeys] = useState(['aq', 'cswt']) // 事件详情弹窗 const [detailModalOpt, setDetailModalOpt] = useState({ open: false, @@ -69,6 +69,7 @@ const EmphasisAreaMap: React.FC = () => { eventId: '', }); const [areaList, setAreaList] = useState([]) + const [allAreaMapData, setAllAreaMapData] = useState([]) const [searchParams, setSearchParams] = useState({ parentTypeCode: 'dlql', lat: 30.680193, @@ -162,10 +163,10 @@ const EmphasisAreaMap: React.FC = () => { } const res = await services.Physicalsign.getGroupObjectPhysicalSignIndex(params) console.log(res); - if(res.code === 200) { + if (res.code === 200) { setAreaList(res.data) } - } + } useEffect(() => { getImportantAreaList() @@ -194,6 +195,24 @@ const EmphasisAreaMap: React.FC = () => { }, ]; + const getObjectPolygon = async () => { + const params = { + physicalSignType: 1, + objectHierarchy: 19, + } + const res = await services.Physicalsign.getObjectPolygon(params) + if (res.code === 200) { + if (res.data?.length) { + console.log(res.data) + setAllAreaMapData(res.data) + } + } + } + + useEffect(() => { + getObjectPolygon() + }, []) + /** 标题渲染 */ const titleRender = () => { @@ -203,9 +222,8 @@ const EmphasisAreaMap: React.FC = () => { @@ -267,7 +285,7 @@ const EmphasisAreaMap: React.FC = () => { > {leftTabKey === '1' ? ( <> - { dispatch.push('KeyAreaDetail', { @@ -310,13 +328,41 @@ const EmphasisAreaMap: React.FC = () => { style={{ borderColor: getColorByIndex(98.5) }} > - + */} + { + allAreaMapData?.map((item: any) => ( + { + dispatch.push('KeyAreaDetail', { + title: item.objectName, + props: { + objectId: item?.objectId, + cqi: item?.qualitySign, + }, + }); + }} + key={item.objectId} + > +
+
+ { item?.objectName } + {item?.qualitySign} +
+
+
+
+ )) + } ) : ( <> {warnMark?.data?.items?.map((item: any, index: number) => { const point = [Number(item?.x_pos), Number(item?.y_pos)]; - + return ( { > @@ -344,7 +389,7 @@ const EmphasisAreaMap: React.FC = () => { return ( {}} + onClick={() => { }} position={item.l} icon={(iconList as any)[index + 1]} > @@ -454,7 +499,7 @@ const EmphasisAreaMap: React.FC = () => { components: { Tree: { directoryNodeSelectedBg: '#1b4761', - + }, }, }} @@ -464,13 +509,13 @@ const EmphasisAreaMap: React.FC = () => { defaultExpandAll onSelect={(e) => { console.log(e); - + }} - onCheck={(e)=>{ - + onCheck={(e) => { + setCheckedKeys(e) - }} - checkedKeys={checkedKeys} + }} + checkedKeys={checkedKeys} treeData={[ { title: '安全风险', @@ -542,8 +587,8 @@ const EmphasisAreaMap: React.FC = () => { )} - {/* 事件详情 */} - { diff --git a/src/pages/SecurityServiceOverview/components/MapCantainer/index.tsx b/src/pages/SecurityServiceOverview/components/MapCantainer/index.tsx index a0f76693..525a7143 100644 --- a/src/pages/SecurityServiceOverview/components/MapCantainer/index.tsx +++ b/src/pages/SecurityServiceOverview/components/MapCantainer/index.tsx @@ -16,7 +16,8 @@ const MapContainer = () => { key: '2', img: require('@/assets/images/aqyztTab.png'), onclick: () => { - history.push('/securityServiceOverview'); + // history.push('/securityServiceOverview'); + window.open(`${window.location.origin}/cd-comprehensive/securityServiceOverview`, '_blank'); }, }, { @@ -28,8 +29,8 @@ const MapContainer = () => { }, ]; const Mpa = { - '1': , - '2': , + '1': , + '2': , }; return (
-- GitLab