From 4f35fc415836f0b4b7e46585f03564e7993f8c49 Mon Sep 17 00:00:00 2001 From: Iamasoldier <1272745473@qq.com> Date: Thu, 19 Jun 2025 23:20:11 +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=E8=AE=BE=E5=A4=87=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BB=A5=E5=8F=8A=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=9C=89=E5=95=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/device-ops/map-dashboard/index.tsx | 331 ++++++++++++++++-- 1 file changed, 308 insertions(+), 23 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 3244d7dd..8921f4d2 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 @@ -105,6 +105,8 @@ interface RealDevice { subDeviceSn: string; deviceOnlineStatus: number; firstPowerOn: number; + powerSupplyType: number; + drcState: number; }; airportStatus?: { flightTaskStep: number; @@ -458,6 +460,8 @@ const DeviceMapDashboard: React.FC = () => { subDeviceSn: '', deviceOnlineStatus: 0, firstPowerOn: 0, + powerSupplyType: 0, + drcState: 0, } }))); } else { @@ -542,6 +546,11 @@ const DeviceMapDashboard: React.FC = () => { if (device.metrics.rainfall > 0) { return DeviceStatus.MAINTENANCE; } + + // 检查DRC状态 + if (device.metrics.drcState === 1) { + return DeviceStatus.TASK; + } // 检查无人机是否在机库中 if (device.metrics.droneInDock === 1) { @@ -549,7 +558,7 @@ const DeviceMapDashboard: React.FC = () => { } // 检查工作模式代码(飞行任务) - if (device.metrics.modeCode > 0) { + if (device.metrics.modeCode > 0 || device.metrics.flightTaskStep > 0) { return DeviceStatus.TASK; } @@ -711,6 +720,8 @@ const DeviceMapDashboard: React.FC = () => { subDeviceSn: '', deviceOnlineStatus: 0, firstPowerOn: 0, + powerSupplyType: 0, + drcState: 0, } })); }; @@ -1328,7 +1339,8 @@ const DeviceMapDashboard: React.FC = () => { // 数据速率(基于网络速率) dataRate: networkRate, // 更新时间 - uptime: firstPowerOn > 0 ? Date.now() - firstPowerOn : 0 + uptime: firstPowerOn > 0 ? Date.now() - firstPowerOn : 0, + drcState: 0, }, lastUpdateTime: new Date().toISOString() } @@ -2175,6 +2187,74 @@ const DeviceMapDashboard: React.FC = () => { + {/* 状态说明区域 */} +
+
+ 状态说明 +
+
+ {Object.entries(DEVICE_STATUS_CONFIG).map(([status, config]) => ( +
+
+ {config.icon} + {config.text} +
+
+ {status === 'offline' && '最后数据上报时间超过5分钟'} + {status === 'error' && '紧急停止、报警状态或电量低于20%'} + {status === 'maintenance' && '网络质量低于30%、定位质量差、风速过大或有降雨'} + {status === 'task' && 'DRC遥控中、执行任务中或飞行任务进行中'} + {status === 'standby' && '设备在线且无异常状态'} +
+ {status === 'error' && ( +
+ · 紧急停止:emergencyStopState = 1 +
+ · 报警状态:alarmState = 1 +
+ · 低电量:batteryCapacity < 20% +
+ )} + {status === 'maintenance' && ( +
+ · 网络质量:networkQuality < 30% +
+ · 定位质量:positionQuality < 3 +
+ · 风速:windSpeed > 10 +
+ · 降雨:rainfall > 0 +
+ )} + {status === 'task' && ( +
+ · DRC状态:drcState = 1 +
+ · 工作模式:modeCode > 0 +
+ · 飞行任务:flightTaskStep > 0 +
+ )} +
+ ))} +
+
+ {/* 统计数据 */} @@ -2810,45 +2890,37 @@ const DeviceMapDashboard: React.FC = () => { {/* 设备状态信息 */} -
- 设备状态 +
+ 基础状态
-
紧急停止
-
- {selectedDevice.metrics.emergencyStopState === 1 ? '已触发' : '正常'} +
供电方式
+
+ {selectedDevice.metrics.powerSupplyType === 0 ? '交流电' : '电池供电'}
-
报警状态
-
- {selectedDevice.metrics.alarmState === 1 ? '有报警' : '正常'} -
-
- - -
-
机盖状态
-
+
舱盖状态
+
{selectedDevice.metrics.coverState === 1 ? '开启' : '关闭'}
-
静音模式
-
- {selectedDevice.metrics.silentMode === 1 ? '开启' : '关闭'} +
降落保护罩
+
+ {selectedDevice.metrics.putterState === 1 ? '开启' : '关闭'}
补光灯
-
+
{selectedDevice.metrics.supplementLightState === 1 ? '开启' : '关闭'}
@@ -2856,8 +2928,62 @@ const DeviceMapDashboard: React.FC = () => {
空调状态
-
- {selectedDevice.metrics.airConditionerState === 1 ? '开启' : '关闭'} +
+ {selectedDevice.metrics.airConditionerState === 0 ? '关闭' : + selectedDevice.metrics.airConditionerState === 1 ? '制冷' : '制热'} +
+
+ + +
+
静音模式
+
+ {selectedDevice.metrics.silentMode === 1 ? '开启' : '关闭'} +
+
+ + +
+ + {/* 环境数据 */} +
+ 环境数据 + + +
+
环境温度
+
35 ? '#ff4d4f' : + selectedDevice.metrics.environmentTemperature < 0 ? '#ff4d4f' : '#52c41a' }}> + {selectedDevice.metrics.environmentTemperature}°C +
+
+ + +
+
机场温度
+
40 ? '#ff4d4f' : + selectedDevice.metrics.temperature < 0 ? '#ff4d4f' : '#52c41a' }}> + {selectedDevice.metrics.temperature}°C +
+
+ + +
+
相对湿度
+
95 ? '#ff4d4f' : '#52c41a' }}> + {selectedDevice.metrics.humidity}% +
+
+ + +
+
风速
+
8 ? '#ff4d4f' : '#52c41a' }}> + {selectedDevice.metrics.windSpeed}m/s
@@ -2949,6 +3075,165 @@ const DeviceMapDashboard: React.FC = () => {
)}
+ + {/* 电源系统 */} +
+ 电源系统 + + +
+
电池容量
+ +
+ + +
+
电池状态
+
+ {selectedDevice.metrics.batteryState === 0 ? '正常' : '异常'} +
+
+ + +
+
工作电压
+
+ {selectedDevice.metrics.workingVoltage}V +
+
+ + +
+
工作电流
+
+ {selectedDevice.metrics.workingCurrent}A +
+
+ + +
+
备用电池电压
+
+ {selectedDevice.metrics.backupBatteryVoltage}V +
+
+ + +
+
交流输入
+
+ {selectedDevice.metrics.acdcPowerInput === 1 ? '正常' : '异常'} +
+
+ +
+
+ + {/* 告警状态 */} +
+ 告警状态 + + +
+
紧急停止
+
+ {selectedDevice.metrics.emergencyStopState === 1 ? '已触发' : '正常'} +
+
+ + +
+
告警状态
+
+ {selectedDevice.metrics.alarmState === 1 ? '有告警' : '正常'} +
+
+ + +
+
告警统计
+ + + 0 ? '#ff4d4f' : '#52c41a' }} + style={{ marginRight: '16px' }} + /> + + + 0 ? '#faad14' : '#52c41a' }} + /> + + +
+ +
+
+ + {/* 设备运行状态 */} +
+ 运行状态 + + +
+
DRC状态
+
+ {selectedDevice.metrics.drcState === 1 ? '遥控中' : '待机中'} +
+
+ + +
+
任务状态
+
0 ? '#1890ff' : '#8c8c8c' + }}> + {selectedDevice.metrics.flightTaskStep > 0 ? `任务中(${selectedDevice.metrics.flightTaskStep})` : '空闲'} +
+
+ + +
+
无人机状态
+
+ {selectedDevice.metrics.droneInDock === 1 ? '在库' : '离库'} +
+
+ + +
+
运行时间
+
+ {Math.floor(selectedDevice.metrics.uptime / 3600)}小时 + {Math.floor((selectedDevice.metrics.uptime % 3600) / 60)}分 +
+
+ +
+
)}