天气窗口与执行约束 温度和速度显示

This commit is contained in:
mmc
2026-05-28 16:28:10 +08:00
parent 1ca393472d
commit ef175e7bed
3 changed files with 112 additions and 19 deletions

View File

@@ -159,6 +159,15 @@ export function getWeatherType(weatherText = "") {
return "cloudy";
}
export const fix2 = (val) => {
if (val === null || val === undefined || isNaN(val)) return '-';
return Number(val).toFixed(2);
};
export const getVal = (val) => val == "no_rain" ? "无" : (val || '-');
// ==============================================
// 通用导出表格为 CSV / Excel(通用版,不写死任何字段)
// ==============================================