diff --git a/src/components/devices/DeviceStatusPage.tsx b/src/components/devices/DeviceStatusPage.tsx index ae0ffbb..da3a733 100644 --- a/src/components/devices/DeviceStatusPage.tsx +++ b/src/components/devices/DeviceStatusPage.tsx @@ -1147,101 +1147,119 @@ export default function DeviceStatusPage() { : null} -
- {robotVideo ? ( - mowerView === 'all' ? ( + + {/* 视频层:停止时不渲染 / 未播放时为空,不影响状态面板 */} + {robotVideo && isVideoPlaying && ( + mowerView === 'all' ? ( +
- ) : ( -
- - {/* 单视频模式状态叠加层 */} -
-
机器人状态
-
- 电量: - - {runningStatus.battery !== undefined ? `${runningStatus.battery}%` : '-'} - - 电压: - {runningStatus.voltage !== undefined ? `${Number(runningStatus.voltage).toFixed(2)}V` : '-'} - 左电机: - {runningStatus.leftCurrent !== undefined ? `${Number(runningStatus.leftCurrent).toFixed(2)}A` : '-'} - 右电机: - {runningStatus.rightCurrent !== undefined ? `${Number(runningStatus.rightCurrent).toFixed(2)}A` : '-'} - 左速度: - {runningStatus.leftMeasureSpeed !== undefined ? `${Number(runningStatus.leftMeasureSpeed).toFixed(1)}rpm` : '-'} - 右速度: - {runningStatus.rightMeasureSpeed !== undefined ? `${Number(runningStatus.rightMeasureSpeed).toFixed(1)}rpm` : '-'} - 左温度: - {runningStatus.leftMotorTemp !== undefined ? `${Number(runningStatus.leftMotorTemp).toFixed(1)}℃` : '-'} - 右温度: - {runningStatus.rightMotorTemp !== undefined ? `${Number(runningStatus.rightMotorTemp).toFixed(1)}℃` : '-'} - 主控温度: - {runningStatus.chipTemp !== undefined ? `${Number(runningStatus.chipTemp).toFixed(1)}℃` : '-'} - 航向角: - {runningStatus.yaw !== undefined ? `${Number(runningStatus.yaw).toFixed(1)}°` : '-'} - 俯仰角: - {runningStatus.pitch !== undefined ? `${Number(runningStatus.pitch).toFixed(1)}°` : '-'} - 航向角状态: - {runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? '初始化' : '未初始化'}` : '-'} - 定位: - - {runningStatus.qual == 0 ? '无效' : - runningStatus.qual == 1 ? 'GPS单点' : - runningStatus.qual == 2 ? 'DGPS差分' : - runningStatus.qual == 4 ? 'RTK固定' : - runningStatus.qual == 5 ? 'RTK浮点' : '未知'} - - 卫星: - {runningStatus.satelliteCnt || 0}颗 - 模式: - - {runningStatus.controlMode == 1 ? '本地' : - runningStatus.controlMode == 3 ? '远程' : '未知'} - -
-
- -
- ) +
) : ( -
视频加载中...
- )} -
+
+ +
+ ) + )} + + {/* 视频未加载 / 停止播放的占位 */} + {(!robotVideo || !isVideoPlaying) && ( +
+ +
+ {!isVideoPlaying ? '已停止视频' : '视频加载中...'} +
+
+ {!isVideoPlaying ? '点击右上角「播放」按钮开启视频' : ''} +
+
+ )} + + {/* 单视频(非全景)模式状态叠加层:始终渲染,和视频层解耦 */} + {mowerView !== 'all' && ( +
+
机器人状态
+
+ 电量: + + {runningStatus.battery !== undefined ? `${runningStatus.battery}%` : '-'} + + 电压: + {runningStatus.voltage !== undefined ? `${Number(runningStatus.voltage).toFixed(2)}V` : '-'} + 左电机: + {runningStatus.leftCurrent !== undefined ? `${Number(runningStatus.leftCurrent).toFixed(2)}A` : '-'} + 右电机: + {runningStatus.rightCurrent !== undefined ? `${Number(runningStatus.rightCurrent).toFixed(2)}A` : '-'} + 左速度: + {runningStatus.leftMeasureSpeed !== undefined ? `${Number(runningStatus.leftMeasureSpeed).toFixed(1)}rpm` : '-'} + 右速度: + {runningStatus.rightMeasureSpeed !== undefined ? `${Number(runningStatus.rightMeasureSpeed).toFixed(1)}rpm` : '-'} + 左温度: + {runningStatus.leftMotorTemp !== undefined ? `${Number(runningStatus.leftMotorTemp).toFixed(1)}℃` : '-'} + 右温度: + {runningStatus.rightMotorTemp !== undefined ? `${Number(runningStatus.rightMotorTemp).toFixed(1)}℃` : '-'} + 主控温度: + {runningStatus.chipTemp !== undefined ? `${Number(runningStatus.chipTemp).toFixed(1)}℃` : '-'} + 航向角: + {runningStatus.yaw !== undefined ? `${Number(runningStatus.yaw).toFixed(1)}°` : '-'} + 俯仰角: + {runningStatus.pitch !== undefined ? `${Number(runningStatus.pitch).toFixed(1)}°` : '-'} + 航向角状态: + {runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? '初始化' : '未初始化'}` : '-'} + 定位: + + {runningStatus.qual == 0 ? '无效' : + runningStatus.qual == 1 ? 'GPS单点' : + runningStatus.qual == 2 ? 'DGPS差分' : + runningStatus.qual == 4 ? 'RTK固定' : + runningStatus.qual == 5 ? 'RTK浮点' : '未知'} + + 卫星: + {runningStatus.satelliteCnt || 0}颗 + 模式: + + {runningStatus.controlMode == 1 ? '本地' : + runningStatus.controlMode == 3 ? '远程' : '未知'} + +
+
+ + ) + }