From 1b0890eaab70cb8261365173afc729200ebc7688 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Mon, 15 Jun 2026 13:57:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=8A=B6=E6=80=81=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=9C=BA=E5=99=A8=E4=BA=BA=E5=AE=9E=E6=97=B6=E8=BD=A8?= =?UTF-8?q?=E8=BF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Draggable.tsx | 2 +- src/components/Map.jsx | 15 +++++++++------ .../{VideoPlayer.tsx.tsx => VideoPlayer.tsx} | 0 src/components/devices/DeviceOverviewPage.tsx | 2 +- src/components/devices/DeviceStatusPage.tsx | 4 +++- src/components/devices/mowerAllView.jsx | 9 ++++++++- 6 files changed, 22 insertions(+), 10 deletions(-) rename src/components/{VideoPlayer.tsx.tsx => VideoPlayer.tsx} (100%) diff --git a/src/components/Draggable.tsx b/src/components/Draggable.tsx index 9e0154d..7748819 100644 --- a/src/components/Draggable.tsx +++ b/src/components/Draggable.tsx @@ -29,7 +29,7 @@ const DraggableBox: React.FC = ({ ref={nodeRef} className={clsx( 'fixed select-none z-[9999] bg-white shadow-xl rounded-lg overflow-hidden', - 'border-[8px] border-slate-200 top-[8px] left-[8px] w-[600px] h-[300px]' // 整体8px外边框 + 'border-[8px] border-slate-200 top-[8px] left-[8px] w-[700px] h-[580px] ' // 整体8px外边框 )} > {/* 拖拽标题栏 + 关闭按钮 */} diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 984df0b..4af2a91 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -829,7 +829,7 @@ export default function CesiumMap({ ifClear, ifClearPlanLine, ifClearNavLine, fi const yellowCircleImg = useMemo(() => createYellowCircleDataUrl(30), []); // 监听 drawRealTime 变化,每次开始执行任务时重置为定位模式 - useEffect(() =>{ + useEffect(() => { if (drawRealTime) { // 开始执行任务时:重置为定位模式,清空之前的轨迹数据 tracePointRef.current.setMode(TPMode.LOCATION); @@ -857,7 +857,7 @@ export default function CesiumMap({ ifClear, ifClearPlanLine, ifClearNavLine, fi if (!finishPoint || !finishPoint.lng || !finishPoint.lat || !drawRealTime) { // 没有 finishPoint 时,移除跟随小车 const viewer = viewerRef.current; - if (viewer &&followCarEntityRef.current) { + if (viewer && followCarEntityRef.current) { viewer.entities.remove(followCarEntityRef.current); followCarEntityRef.current = null; } @@ -1009,7 +1009,7 @@ export default function CesiumMap({ ifClear, ifClearPlanLine, ifClearNavLine, fi }; // 清空规划航线(使用上一次的 ifClearPlanLine 作为比较,避免重复触发) const prevIfClearPlanLine = useRef(0); - useEffect(() =>{ + useEffect(() => { if (ifClearPlanLine !== prevIfClearPlanLine.current && ifClearPlanLine) { const viewer = viewerRef.current; if (viewer) { @@ -1026,7 +1026,7 @@ export default function CesiumMap({ ifClear, ifClearPlanLine, ifClearNavLine, fi // 清空实时轨迹 const prevIfClearNavLine = useRef(0); useEffect(() => { - if (ifClearNavLine !== prevIfClearNavLine.current &&ifClearNavLine) { + if (ifClearNavLine !== prevIfClearNavLine.current && ifClearNavLine) { updateTraceLine(true); prevIfClearNavLine.current = ifClearNavLine; } @@ -1482,7 +1482,7 @@ export default function CesiumMap({ ifClear, ifClearPlanLine, ifClearNavLine, fi // ==================================== // 无人机模式:保持原来的逻辑 // ==================================== - if (isDroneMode) { + if (isDroneMode || from == "deviceStatus") { // 轨迹点去抖动(防止重复点) const last = realtimeLastPointRef.current; let shouldAdd = true; @@ -1521,7 +1521,7 @@ export default function CesiumMap({ ifClear, ifClearPlanLine, ifClearNavLine, fi } // 无人机图标 - const img = planeImg; + const img = realtimeType === 'plane' || realtimeType === 'drone' ? planeImg : carImg; const imgWidth = 70; const imgHeight = 70; @@ -1532,6 +1532,9 @@ export default function CesiumMap({ ifClear, ifClearPlanLine, ifClearNavLine, fi rotation = Cesium.Math.toRadians(headingDeg); } + //rotation = Cesium.Math.toRadians(-3.17); + + if (!realtimeCarEntityRef.current) { realtimeCarEntityRef.current = viewer.entities.add({ position: position, diff --git a/src/components/VideoPlayer.tsx.tsx b/src/components/VideoPlayer.tsx similarity index 100% rename from src/components/VideoPlayer.tsx.tsx rename to src/components/VideoPlayer.tsx diff --git a/src/components/devices/DeviceOverviewPage.tsx b/src/components/devices/DeviceOverviewPage.tsx index 8d2799b..3464966 100644 --- a/src/components/devices/DeviceOverviewPage.tsx +++ b/src/components/devices/DeviceOverviewPage.tsx @@ -21,7 +21,7 @@ import DroneLivePlayer from '../VolcRtcPlayer.jsx'; import DroneVideoPlayer from './DroneVideoPlayer'; import AgoraTextTest from '../AgoraRtc.tsx'; import { useWebRTCPlayer } from '../useWebRTCStream.tsx'; -import VideoPlayer from '../VideoPlayer.tsx.tsx'; +import VideoPlayer from '../VideoPlayer.tsx'; import CesiumMap from '../Map.jsx'; import { getUAVState, getSiteDevice, getSiteUAVList, getsinglePlan, getRobotTaskList, getDeviceTotalData, updateDeviceAliasApi } from '@/api/device.ts'; import dayjs from 'dayjs'; diff --git a/src/components/devices/DeviceStatusPage.tsx b/src/components/devices/DeviceStatusPage.tsx index 3394154..d860ce2 100644 --- a/src/components/devices/DeviceStatusPage.tsx +++ b/src/components/devices/DeviceStatusPage.tsx @@ -159,6 +159,7 @@ export default function DeviceStatusPage({ setPersistentDroneData(prevData => { const newData = { ...prevData }; + // 无人机特有字段 if (host.battery?.capacity_percent !== undefined) { newData.capacity_percent = host.battery.capacity_percent; @@ -359,7 +360,7 @@ export default function DeviceStatusPage({ return { lon: robotLon, lat: robotLat, - //heading: runningStatus.yaw || wsDeviceInfo.yaw || 0, + heading: runningStatus.pitch || wsDeviceInfo.pitch || 0, }; } @@ -746,6 +747,7 @@ export default function DeviceStatusPage({ finishPoint={arrivedPoint} ifClearNavLine={clearNavLine} ifClearPlanLine={clearPlanLine} + from="deviceStatus" /> diff --git a/src/components/devices/mowerAllView.jsx b/src/components/devices/mowerAllView.jsx index e56a5ff..c85a09b 100644 --- a/src/components/devices/mowerAllView.jsx +++ b/src/components/devices/mowerAllView.jsx @@ -22,6 +22,7 @@ export function MowerAllView({ serialNumber, robotVideo, error, ready }) { border: '1px solid #eae4e4', flexShrink: 0,// 禁止压缩 borderRadius: 8, + overflow: "hidden" }}>