From 85c7691d0ba6ccbca65bee703202edd0cb0c7ecc Mon Sep 17 00:00:00 2001 From: yarnom Date: Thu, 6 Nov 2025 09:55:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/app.component.html | 3 --- static/js/app.js | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/frontend/src/app.component.html b/core/frontend/src/app.component.html index 3dfc334..f18aa50 100644 --- a/core/frontend/src/app.component.html +++ b/core/frontend/src/app.component.html @@ -18,7 +18,6 @@
-
@@ -52,7 +51,6 @@
-
diff --git a/static/js/app.js b/static/js/app.js index 28cdde1..cfe0e3c 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -321,11 +321,14 @@ WeatherApp.updateSummaryPanel = function(historyData, forecastData){ setLevel(futureSum); } catch {} - // --- 过去预报准确率(按小时分档 [0,5), [5,10), [10,∞))--- + // --- 过去预报准确率(四档:0mm、(0,5]、(5,10]、>10)--- const bucketOf = (mm)=>{ if (mm==null || isNaN(Number(mm))) return null; const v = Math.max(0, Number(mm)); - if (v < 5) return 0; if (v < 10) return 1; return 2; + if (v === 0) return 0; // 0mm + if (v > 0 && v <= 5) return 1; // (0,5] + if (v > 5 && v <= 10) return 2; // (5,10] + return 3; // >10 }; const rainActual = new Map(); (historyData||[]).forEach(it=>{ if (it && it.date_time) rainActual.set(it.date_time, it.rainfall); });