From 230560e321cb5daf0fc16c3b34cd5b51821a20f6 Mon Sep 17 00:00:00 2001 From: Iamasoldier <1272745473@qq.com> Date: Thu, 19 Jun 2025 23:02:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9C=B0=E5=9B=BE=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E5=85=A8=E5=B1=8F=E4=B8=8B=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/device-ops/map-dashboard/index.tsx | 79 ++++++++++++++----- 1 file changed, 60 insertions(+), 19 deletions(-) diff --git a/zlt-web/react-web/src/main/frontend/src/pages/device-ops/map-dashboard/index.tsx b/zlt-web/react-web/src/main/frontend/src/pages/device-ops/map-dashboard/index.tsx index 346ee24d..3244d7dd 100644 --- a/zlt-web/react-web/src/main/frontend/src/pages/device-ops/map-dashboard/index.tsx +++ b/zlt-web/react-web/src/main/frontend/src/pages/device-ops/map-dashboard/index.tsx @@ -12,7 +12,7 @@ import { ClockCircleOutlined, WarningOutlined, InfoCircleOutlined, EyeOutlined, PlayCircleOutlined, PauseCircleOutlined, HomeOutlined, CameraOutlined, ControlOutlined, BellOutlined, BarChartOutlined, - PauseOutlined, SearchOutlined + PauseOutlined, SearchOutlined, FullscreenOutlined, FullscreenExitOutlined } from '@ant-design/icons'; import moment from 'moment'; import { Amap } from '@amap/amap-react'; @@ -1835,17 +1835,46 @@ const DeviceMapDashboard: React.FC = () => { currentMarkers.clear(); }; + const [isFullscreen, setIsFullscreen] = useState(false); + const containerRef = useRef(null); + + // 处理全屏切换 + const toggleFullscreen = () => { + if (!document.fullscreenElement) { + containerRef.current?.requestFullscreen(); + setIsFullscreen(true); + } else { + document.exitFullscreen(); + setIsFullscreen(false); + } + }; + + // 监听全屏变化 + useEffect(() => { + const handleFullscreenChange = () => { + setIsFullscreen(!!document.fullscreenElement); + }; + + document.addEventListener('fullscreenchange', handleFullscreenChange); + return () => { + document.removeEventListener('fullscreenchange', handleFullscreenChange); + }; + }, []); + return ( -
+
{/* 顶部控制栏 */}
{ )} )} + + @@ -2033,8 +2070,9 @@ const DeviceMapDashboard: React.FC = () => { position: 'relative', display: 'flex', overflow: 'hidden', - height: 'calc(100vh - 56px - 48px)', // 减去顶部工具栏和全局头部的高度 - width: '100%' // 确保宽度填满 + height: 'calc(100vh - 56px - 48px)', + width: '100%', + gap: 0 // 移除面板之间的间距 }}> {/* 左侧统计面板 */} {leftPanelVisible && ( @@ -2045,7 +2083,7 @@ const DeviceMapDashboard: React.FC = () => { height: '100%', zIndex: 1000, transition: 'all 0.3s ease', - marginRight: '8px' + marginRight: 0 // 移除右边距 }}> { position: 'relative', minWidth: 0, minHeight: 0, - display: 'flex' + display: 'flex', + margin: 0 // 移除边距 }}> {/* 地图容器 */}
{ height: '100%', position: 'relative', backgroundColor: '#f5f5f5', - border: '1px solid #e8e8e8', - borderRadius: '4px' + border: 'none', // 移除边框 + borderRadius: 0 // 移除圆角 }} /> @@ -2420,7 +2459,7 @@ const DeviceMapDashboard: React.FC = () => { height: '100%', position: 'relative', transition: 'all 0.3s ease', - marginLeft: '8px', + marginLeft: 0, // 移除左边距 flexShrink: 0, overflow: 'hidden' }}> @@ -2448,7 +2487,9 @@ const DeviceMapDashboard: React.FC = () => { height: '100%', display: 'flex', flexDirection: 'column', - overflow: 'hidden' + overflow: 'hidden', + borderRadius: 0, // 移除卡片圆角 + border: 'none' // 移除卡片边框 }} bodyStyle={{ padding: '12px',