From 7931a0d863a07a92b72d6f8fad32c86c57d8c6b3 Mon Sep 17 00:00:00 2001 From: liuyunqin Date: Thu, 4 Jun 2026 14:22:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=99=AE=E9=80=9A=E6=8C=87=E6=A0=87Tool?= =?UTF-8?q?tip=E8=A1=A5=E5=85=85=E5=8D=95=E4=BD=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - genTrend返回时补上unit字段(如℃、%、ppm等) - 其他指标点击数据点时正确显示数值+单位 --- employee-app/health-monitor/environment/device-detail.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/employee-app/health-monitor/environment/device-detail.html b/employee-app/health-monitor/environment/device-detail.html index e66fe8e..6ef5ecf 100644 --- a/employee-app/health-monitor/environment/device-detail.html +++ b/employee-app/health-monitor/environment/device-detail.html @@ -314,7 +314,7 @@ function genTrend(metricName, period) { 'TDS':{range:[100,850],unit:'mg/L'} }; - if (configs[metricName]) return { metricName: metricName, cfg: configs[metricName], period: period }; + if (configs[metricName]) return { metricName: metricName, cfg: configs[metricName], period: period, unit: '' }; var r = ranges[metricName]; if (!r) r = { range: [10, 100], unit: '' }; @@ -345,6 +345,7 @@ function genTrend(metricName, period) { return { metricName: metricName, + unit: r.unit || '', isAQI: false, yMax: maxVal, yTicks: Array.from({length: yTicks+1}, function(_, i) { var v = maxVal / yTicks * i; return r.unit === 'mg/m³' ? +v.toFixed(2) : Math.round(v);