From c76102bf96733413cc3190453409334d7f4cf257 Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Tue, 30 Jun 2026 11:55:46 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E7=94=B5=E6=B1=A0=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/equipmentList/list.vue | 159 +++++++++++++++++++++++++++++-- 1 file changed, 150 insertions(+), 9 deletions(-) diff --git a/src/views/equipmentList/list.vue b/src/views/equipmentList/list.vue index e73ea29..13566cf 100644 --- a/src/views/equipmentList/list.vue +++ b/src/views/equipmentList/list.vue @@ -65,21 +65,119 @@ {{ scope.row.status ?? '-' }} --> - + - - {{ scope.row.batteryLevel1 + '%' }} + 左{{ scope.row.batteryLevel1 + '%' }} - {{ scope.row.batteryLevel2 + '%' }} + 右{{ scope.row.batteryLevel2 + '%' }} - 未获取 + --> + + + + + + + + + + + 左{{ scope.row.batteryLevel1 }}% + + + + + + + + + + + 右{{ scope.row.batteryLevel2 }}% + + + + + 未获取 + + @@ -702,6 +800,21 @@ const handleRefresh = async () => { initHls(monitorVideoUrl, monitorVideoRef); } }; + +/** 电池颜色:>50% 绿,30-50% 黄,<30% 红 */ +const getBatteryColor = (val: number) => { + if (val > 50) return '#52c41a'; + if (val >= 30) return '#faad14'; + return '#ff4d4f'; +}; + +const formatPowerLevel = (val: any) => Number(val) || 0; +const getPowerLevelClass = (val: any) => { + const v = Number(val); + if (v > 50) return 'power--high'; + if (v >= 30) return 'power--mid'; + return 'power--low'; +};