fix: 优化前端体验
This commit is contained in:
parent
4a73a41a6c
commit
85c7691d0b
@ -18,7 +18,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-white border rounded p-3 mb-4" style="border-color:#ddd;">
|
<div class="bg-white border rounded p-3 mb-4" style="border-color:#ddd;">
|
||||||
<!-- 第一行:站点编号 / 地图类型 / 预报源 / 图例 -->
|
|
||||||
<div class="flex flex-wrap items-center gap-3 mb-3">
|
<div class="flex flex-wrap items-center gap-3 mb-3">
|
||||||
<label class="text-sm text-gray-600">站点编号</label>
|
<label class="text-sm text-gray-600">站点编号</label>
|
||||||
<input class="px-2 py-1 border rounded w-32 font-mono text-sm" [(ngModel)]="decimalId" placeholder="十六进制(如 29CA)" />
|
<input class="px-2 py-1 border rounded w-32 font-mono text-sm" [(ngModel)]="decimalId" placeholder="十六进制(如 29CA)" />
|
||||||
@ -52,7 +51,6 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 第二行:数据粒度 / 开始 / 结束 / 查询按钮 -->
|
|
||||||
<div class="flex flex-wrap items-center gap-3 mb-3">
|
<div class="flex flex-wrap items-center gap-3 mb-3">
|
||||||
<label class="text-sm text-gray-600">数据粒度</label>
|
<label class="text-sm text-gray-600">数据粒度</label>
|
||||||
<select class="px-2 py-1 border rounded text-sm" [(ngModel)]="interval">
|
<select class="px-2 py-1 border rounded text-sm" [(ngModel)]="interval">
|
||||||
@ -69,7 +67,6 @@
|
|||||||
<button class="bg-blue-600 text-white px-3 py-1 rounded text-sm" (click)="query()">查看历史数据</button>
|
<button class="bg-blue-600 text-white px-3 py-1 rounded text-sm" (click)="query()">查看历史数据</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 第三行:叠加显示 / 时间选择 / 上一/下一时次 / 计数 -->
|
|
||||||
<div class="flex flex-wrap items-center gap-3">
|
<div class="flex flex-wrap items-center gap-3">
|
||||||
<label class="text-sm text-gray-600">叠加显示</label>
|
<label class="text-sm text-gray-600">叠加显示</label>
|
||||||
<select class="px-2 py-1 border rounded text-sm" [(ngModel)]="tileProduct" (change)="onProductChange()">
|
<select class="px-2 py-1 border rounded text-sm" [(ngModel)]="tileProduct" (change)="onProductChange()">
|
||||||
|
|||||||
@ -321,11 +321,14 @@ WeatherApp.updateSummaryPanel = function(historyData, forecastData){
|
|||||||
setLevel(futureSum);
|
setLevel(futureSum);
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
// --- 过去预报准确率(按小时分档 [0,5), [5,10), [10,∞))---
|
// --- 过去预报准确率(四档:0mm、(0,5]、(5,10]、>10)---
|
||||||
const bucketOf = (mm)=>{
|
const bucketOf = (mm)=>{
|
||||||
if (mm==null || isNaN(Number(mm))) return null;
|
if (mm==null || isNaN(Number(mm))) return null;
|
||||||
const v = Math.max(0, Number(mm));
|
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();
|
const rainActual = new Map();
|
||||||
(historyData||[]).forEach(it=>{ if (it && it.date_time) rainActual.set(it.date_time, it.rainfall); });
|
(historyData||[]).forEach(it=>{ if (it && it.date_time) rainActual.set(it.date_time, it.rainfall); });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user