From fdfd546582b0357df42acf92d4b41281f4bb3731 Mon Sep 17 00:00:00 2001
From: lijingqi <1437862981@qq.com>
Date: Fri, 27 Dec 2024 18:06:57 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E4=B8=80=E5=BC=A0=E5=9B=BE?=
=?UTF-8?q?=E5=9B=BE=E6=A0=87=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SafetyMap/index.tsx | 4 +
.../components/BaseInfo/DetMap/index.tsx | 95 +++++++------------
.../components/BaseInfo/index.tsx | 3 +
3 files changed, 42 insertions(+), 60 deletions(-)
diff --git a/src/pages/SecurityServiceOverview/SafetyMap/index.tsx b/src/pages/SecurityServiceOverview/SafetyMap/index.tsx
index d0174d08..961be3e0 100644
--- a/src/pages/SecurityServiceOverview/SafetyMap/index.tsx
+++ b/src/pages/SecurityServiceOverview/SafetyMap/index.tsx
@@ -210,6 +210,8 @@ const SafetyMap = () => {
return {};
}
};
+
+
return (
@@ -222,6 +224,8 @@ const SafetyMap = () => {
{facility?.data?.records?.map((item: any, index: number) => {
const point = [Number(item?.longitude), Number(item?.latitude)];
+
+
return (
{
- console.log(data, '44');
-
const MapRef = useRef();
- // const [searchParams, setSearchParams] = useState({
- // parentTypeCode: 'dlql',
- // lat: 30.680193,
- // lon: 104.075555,
- // distance: 1000,
- // page: 1,
- // count: 100,
- // });
- // // 事件详情弹窗
- // const [detailModalOpt, setDetailModalOpt] = useState({
- // open: false,
- // title: '',
- // eventId: '',
- // });
- // const [wayModalOpt, setWayModalOpt] = useState<{
- // open: boolean;
- // title: string;
- // }>({
- // open: false,
- // title: '道路桥梁情况',
- // });
- useEffect(()=>{
- if(data){
+ useEffect(() => {
+ if (data) {
MapRef?.current?.flyTo({
destination: {
x: Number(data?.longitude),
y: Number(data?.latitude),
z: 239,
},
-
+
// orientation: {
// heading: 6.283185307179586,
// pitch: -1.568627330287271,
@@ -46,40 +23,38 @@ const DetMap = ({ data }: { data: any }) => {
// },
});
}
-
- },[data])
-
+ }, [data]);
+ if (!data) {
+ return;
+ }
return (
-
-
- <>
- {
- // setDetailModalOpt({
- // open: true,
- // eventId: item?.riskId,
- // ...item,
- // });
- }}
- >
-
-
- >
-
-
-
+
+ <>
+ {
+ // setDetailModalOpt({
+ // open: true,
+ // eventId: item?.riskId,
+ // ...item,
+ // });
+ }}
+ >
+
+
+ >
+
);
};
diff --git a/src/pages/SecurityServiceOverview/components/BaseInfo/index.tsx b/src/pages/SecurityServiceOverview/components/BaseInfo/index.tsx
index cf8458a2..974a00be 100644
--- a/src/pages/SecurityServiceOverview/components/BaseInfo/index.tsx
+++ b/src/pages/SecurityServiceOverview/components/BaseInfo/index.tsx
@@ -139,7 +139,10 @@ const BaseInfo: React.FC<{
*/}
+
+
+
({
--
GitLab