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); });