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 = '