From 8319af936bf560565a784efcd8039c022baf5f01 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Wed, 2 Sep 2026 11:04:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=A0=E5=B0=84=E5=9C=B0=E5=9B=BE=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0=20=20=E5=9C=BA=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Map.jsx | 10 ++++++++-- src/components/SystemSetting/StationManage.tsx | 4 ++-- src/pages/Home.tsx | 4 ++-- src/pages/RealTimeMonitor.tsx | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 59436ce..5fe5e19 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState, useMemo, useImperativeHandle, forwardRef, useCallback } from 'react'; +import React, { useEffect, useRef, useState, useMemo, useImperativeHandle, forwardRef, useCallback } from 'react'; import carImg from '../assets/images/carplane.png'; import inspectImg from "../assets/images/inspectCar.png" import planeImg from '../assets/images/planeicon.png'; @@ -27,7 +27,7 @@ const CYAN_GLOW_COLOR = new window.Cesium.Color( ); window.Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmNjk0NjI1MC0wZGYyLTQ1YzItYjJmZi0wY2M5ODEwODllYzIiLCJpZCI6Mzk3MTQxLCJpYXQiOjE3NzI1MjkwMjV9.U6qmakhDgXJVXwLFyWzSxAUOFZRrDkIsRUPP6CCdnKg"; -const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, finishPoint, drawRealTime, realtimePosition, realtimeType, pathPoints = [], devices = [], onCameraClick, focusLocation, points = [], markedPoints = [], onPathChange, from, onClearDraw, onMarkPoint, routeMode = '', polyPoints }, ref) => { +const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, finishPoint, drawRealTime, realtimePosition, realtimeType, pathPoints = [], devices = [], onCameraClick, focusLocation, points = [], markedPoints = [], onPathChange, from, onClearDraw, onMarkPoint, routeMode = '', polyPoints, mapLayer }, ref) => { const containerRef = useRef(null); const viewerRef = useRef(null); const tooltipRef = useRef(null); @@ -948,6 +948,12 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, }; }, []); + // 根据场站映射图层定位地图 + useEffect(() => { + if (!mapLayer || !viewerRef.current) return; + flyToLayer(mapLayer, envConfig.geoserver_url, 1000); + }, [mapLayer]); + useEffect(() => { // 如果有 realtimePosition,不显示 focusEntity diff --git a/src/components/SystemSetting/StationManage.tsx b/src/components/SystemSetting/StationManage.tsx index a54f3cd..fe9699c 100644 --- a/src/components/SystemSetting/StationManage.tsx +++ b/src/components/SystemSetting/StationManage.tsx @@ -263,7 +263,7 @@ export default function StationManage() { { title: t('systemSetting.siteName'), dataIndex: 'siteName' }, { title: t('systemSetting.mappingLayer'), - dataIndex: 'site_map_name', + dataIndex: 'siteMapName', render: (value) => value ? ( {value} ) : ( @@ -387,7 +387,7 @@ export default function StationManage() { - +