From 2eec7e20f4df44edb53e658566bc85893b542761 Mon Sep 17 00:00:00 2001 From: liuyunqin Date: Thu, 4 Jun 2026 14:17:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A9=BA=E6=B0=94=E8=B4=A8=E9=87=8F?= =?UTF-8?q?=E6=8C=87=E6=95=B0=E6=8A=98=E7=BA=BF=E5=9B=BETooltip=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=AD=89=E7=BA=A7=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 近24小时点击数据点,数值后追加对应等级名称(清洁/未污染/轻污染/中污染/重污染) - 等级文字颜色与数据点颜色一致,方便识别 --- .../health-monitor/environment/device-detail.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/employee-app/health-monitor/environment/device-detail.html b/employee-app/health-monitor/environment/device-detail.html index e7262c6..b10a414 100644 --- a/employee-app/health-monitor/environment/device-detail.html +++ b/employee-app/health-monitor/environment/device-detail.html @@ -560,6 +560,15 @@ function renderTrend(metricName, period) { return svg; } +/* AQI 等级名称映射 */ +function getAqiLevel(val) { + if (val >= 151) return '重污染'; + if (val >= 101) return '中污染'; + if (val >= 51) return '轻污染'; + if (val >= 21) return '未污染'; + return '清洁'; +} + /* 显示折线图数据点 Tip */ function showTrendTip(e, el) { var td = window._trendTooltipData; @@ -569,12 +578,14 @@ function showTrendTip(e, el) { var val = td.points[idx]; var unit = td.unit || ''; var color = td.isAQI ? getAqiColor(val) : chartLine; + var levelHtml = td.isAQI ? ' ' + getAqiLevel(val) + '' : ''; document.getElementById('tooltipDate').textContent = dateStr; document.getElementById('tooltipBody').innerHTML = '
' + '' + '数值' + - '' + val + (unit ? ' ' + unit : '') + '
'; + '' + val + (unit ? ' ' + unit : '') + '' + + levelHtml + ''; showTooltip(el); }