feat: Implement core PolyWeather application with city weather query service, trend analysis, data collection, and dashboard UI.

This commit is contained in:
2569718930@qq.com
2026-03-11 10:49:35 +08:00
parent d2a40462c5
commit 1958b2764b
17 changed files with 24 additions and 279 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ const GUIDE_CARDS = {
title: "Ankara 专属增强",
},
{
body: "点击多日预报后的模态框,主要用于分析下一个交易日。6-48 小时趋势以 weather.gov 和 Open-Meteo 为主,部分城市补充 Meteoblue;0-2 小时临近判断优先看 METAR 与周边站。",
body: "点击多日预报后的模态框,主要用于分析下一个交易日。6-48 小时趋势以 weather.gov 和 Open-Meteo 为主;0-2 小时临近判断优先看 METAR 与周边站。",
title: "未来日期分析",
},
{
@@ -48,7 +48,7 @@ const GUIDE_CARDS = {
title: "Ankara-specific Enhancement",
},
{
body: "The multi-day modal focuses on next-session analysis. 6-48h trend mainly relies on weather.gov and Open-Meteo, with Meteoblue in selected cities; 0-2h nowcast prioritizes METAR and nearby stations.",
body: "The multi-day modal focuses on next-session analysis. 6-48h trend mainly relies on weather.gov and Open-Meteo; 0-2h nowcast prioritizes METAR and nearby stations.",
title: "Future-date Analysis",
},
{
@@ -552,18 +552,8 @@ export function ModelForecast({
}) {
const { locale, t } = useI18n();
const view = getModelView(detail, targetDate);
const fallbackMeteoblue = detail.source_forecasts?.meteoblue?.today_high;
const modelsMap = { ...view.models };
// 强行插入 Meteoblue,防止 helper 函数或日期对齐导致其被剔除
if (
modelsMap["Meteoblue"] == null &&
fallbackMeteoblue != null &&
(!targetDate || targetDate === detail.local_date)
) {
modelsMap["Meteoblue"] = fallbackMeteoblue;
}
const modelEntries = Object.entries(modelsMap).filter(
([, value]) =>
value !== null && value !== undefined && Number.isFinite(Number(value)),
@@ -591,12 +581,6 @@ export function ModelForecast({
? Math.max(...comparisonValues) + 1
: 1;
const range = Math.max(maxValue - minValue, 1);
const getModelDisplayName = (name: string) => {
if (String(name).trim().toLowerCase() === "meteoblue") {
return "Meteoblue";
}
return name;
};
return (
<section className="models-section">
@@ -615,7 +599,7 @@ export function ModelForecast({
return (
<div key={name} className="model-row">
<div className="model-name" title={name}>
{getModelDisplayName(name)}
{name}
</div>
<div className="model-bar-track">
<div