From 65aa96660692652c37e8729fe483b41f47cfc44f Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Fri, 11 Sep 2026 15:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=88=AA=E5=90=91=E8=A7=92?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=BB=91=E5=AE=9A=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=20=E8=B4=9F=E8=B4=A3=E4=BA=BA=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Map.jsx | 15 +++++++++++++-- .../SystemSetting/SmartDeviceManagement.tsx | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 5457c72..e3ddab6 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -1468,6 +1468,15 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, // ============================== + // 航向角:优先用设备自带 heading/yaw/angle,否则按设备索引模拟角度(演示旋转) + // ============================== + + //let headingDeg = Number(device?.heading ?? device?.yaw ?? device?.headingAngle ?? device?.angle); + //if (!isFinite(headingDeg)) { + // headingDeg = (index * 36) % 360; + //} + //const headingRotation = Cesium.Math.toRadians(-10); + // entity 获取 / 创建 // ============================== @@ -1487,7 +1496,8 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, height, verticalOrigin: window.Cesium.VerticalOrigin.BOTTOM, disableDepthTestDistance: Number.POSITIVE_INFINITY, - show: !isIOT + show: !isIOT, + //rotation: headingRotation, }, label: { @@ -1518,6 +1528,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, entity.billboard.image = image; entity.billboard.width = width; entity.billboard.height = height; + //entity.billboard.rotation = headingRotation; entity.label.text = device.name || ""; @@ -1902,7 +1913,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, if (realtimePosition?.heading !== undefined && !isNaN(Number(realtimePosition.heading))) { let headingDeg = Number(realtimePosition.heading); - rotation = Cesium.Math.toRadians(headingDeg); + rotation = Cesium.Math.toRadians(-headingDeg); diff --git a/src/components/SystemSetting/SmartDeviceManagement.tsx b/src/components/SystemSetting/SmartDeviceManagement.tsx index 1525efd..82b26b3 100644 --- a/src/components/SystemSetting/SmartDeviceManagement.tsx +++ b/src/components/SystemSetting/SmartDeviceManagement.tsx @@ -358,7 +358,7 @@ export default function SmartDeviceManagement({ { title: t('systemSetting.leader'), width: 150, key: 'userName', render: (_, record: any) => { - const user = allUserOptions.find(u => u.userId == record.userId); + const user = allUserOptions.find(u => u.userId == record.tenantId); return user ? (user.nickName || user.userName) : {t('systemSetting.s02')}; }, },