From d88f64a87b7ee34731516f5c1d113324b2bbe018 Mon Sep 17 00:00:00 2001 From: yarnom Date: Mon, 3 Nov 2025 16:06:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=A7=E5=B1=8F=E5=B9=95=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/static/js/app.js b/static/js/app.js index d7c2ef6..92a3e32 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -300,6 +300,15 @@ WeatherApp.updateSummaryPanel = function(historyData, forecastData){ const futureSum = [r1,r2,r3].reduce((s,v)=> s + (v!=null?Number(v):0), 0); if (elFuture) elFuture.textContent = `未来1~3小时降雨 ${fmt(futureSum)} 毫米`; + // 超过阈值(>0.4mm)触发 Summary 面板橙色预警样式 + try { + const panel = document.getElementById('summaryPanel'); + if (panel) { + if (futureSum > 0.4) panel.classList.add('alert-on'); + else panel.classList.remove('alert-on'); + } + } catch {} + // --- 过去预报准确率(按小时分档 [0,5), [5,10), [10,∞))--- const bucketOf = (mm)=>{ if (mm==null || isNaN(Number(mm))) return null;