From 3f351ac60cae4d1a97352c3c7ba538baf34b6327 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 10 May 2026 18:58:42 +0800 Subject: [PATCH] =?UTF-8?q?Busan=20=E6=9C=BA=E5=9C=BA=E8=A7=82=E6=B5=8B?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=9AMETAR=20=E6=95=B0=E6=8D=AE=E5=85=9C?= =?UTF-8?q?=E5=BA=95=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:AMOS 仅支持仁川 RKSI,釜山 RKPK 无法获取跑道级数据 解决:AmosRunwayPanel 新增 airportCurrent 回退模式 - 有 AMOS 数据时:展示完整跑道卡片网格(首尔/仁川) - 无 AMOS 时:展示单张机场观测卡片(釜山/所有其他机场) 包含:温度、风向风速、气压 QNH、能见度 标注数据来源(METAR/AMOS)和是否过旧 - AirportCurrentConditions 类型新增 pressure_hpa 字段 这样首尔有完整的 4 对跑道数据,釜山至少展示机场官方观测值 --- .../scan-terminal/AiPinnedCityCard.tsx | 3 +- .../scan-terminal/AmosRunwayPanel.tsx | 66 +++++++++++++++++-- frontend/lib/dashboard-types.ts | 1 + 3 files changed, 63 insertions(+), 7 deletions(-) diff --git a/frontend/components/dashboard/scan-terminal/AiPinnedCityCard.tsx b/frontend/components/dashboard/scan-terminal/AiPinnedCityCard.tsx index 0aaa23d0..57a10829 100644 --- a/frontend/components/dashboard/scan-terminal/AiPinnedCityCard.tsx +++ b/frontend/components/dashboard/scan-terminal/AiPinnedCityCard.tsx @@ -651,11 +651,12 @@ export function AiPinnedCityCard({ /> - {detail?.amos ? ( + {(detail?.amos || detail?.airport_current) ? ( ) : null} diff --git a/frontend/components/dashboard/scan-terminal/AmosRunwayPanel.tsx b/frontend/components/dashboard/scan-terminal/AmosRunwayPanel.tsx index 36b16302..bb7142a7 100644 --- a/frontend/components/dashboard/scan-terminal/AmosRunwayPanel.tsx +++ b/frontend/components/dashboard/scan-terminal/AmosRunwayPanel.tsx @@ -13,16 +13,70 @@ export function AmosRunwayPanel({ amos, isEn, tempSymbol, + airportCurrent, }: { - amos: AmosData; + amos?: AmosData | null; isEn: boolean; tempSymbol: string; + airportCurrent?: { + temp?: number | null; + wind_speed_kt?: number | null; + wind_dir?: number | null; + pressure_hpa?: number | null; + visibility_mi?: number | null; + raw_metar?: string | null; + source_label?: string | null; + obs_time?: string | null; + stale_for_today?: boolean | null; + } | null; }) { - const runwayPairs = amos.runway_obs?.runway_pairs; - const runwayTemps = amos.runway_obs?.temperatures ?? amos.runway_temps; - const runwayWinds = amos.runway_obs?.wind_speeds; - const runwayVis = amos.runway_obs?.visibility_mor; - const runwayRvr = amos.runway_obs?.rvr; + const runwayPairs = amos?.runway_obs?.runway_pairs; + const runwayTemps = amos?.runway_obs?.temperatures ?? amos?.runway_temps; + const runwayWinds = amos?.runway_obs?.wind_speeds; + const runwayVis = amos?.runway_obs?.visibility_mor; + const runwayRvr = amos?.runway_obs?.rvr; + const hasAmosRunway = runwayPairs && runwayPairs.length > 0; + + // Fallback: single-card METAR observation for non-AMOS airports + if (!hasAmosRunway) { + if (!airportCurrent?.temp && !airportCurrent?.wind_speed_kt) return null; + const sourceLabel = airportCurrent?.source_label || (isEn ? "METAR" : "机场报文"); + const staleNote = airportCurrent?.stale_for_today + ? isEn ? " (stale)" : "(过旧)" + : ""; + return ( +
+
+ {isEn ? "Airport Observation" : "机场观测"} · {sourceLabel}{staleNote} +
+
+
+
+ {airportCurrent.temp != null ? `${airportCurrent.temp.toFixed(1)}${tempSymbol}` : "--"} +
+ {airportCurrent.wind_speed_kt != null ? ( +
+ {isEn ? "Wind " : "风 "} + {airportCurrent.wind_dir != null ? `${airportCurrent.wind_dir}° ` : ""} + {airportCurrent.wind_speed_kt}kt +
+ ) : null} + {airportCurrent.pressure_hpa != null ? ( +
+ QNH {airportCurrent.pressure_hpa.toFixed(1)} hPa +
+ ) : null} + {airportCurrent.visibility_mi != null ? ( +
+ {isEn ? "Vis " : "能见度 "} + {(airportCurrent.visibility_mi * 1609).toFixed(0)}m +
+ ) : null} +
+
+
+ ); + } if (!runwayPairs || runwayPairs.length === 0) return null; diff --git a/frontend/lib/dashboard-types.ts b/frontend/lib/dashboard-types.ts index 88525375..94d87acb 100644 --- a/frontend/lib/dashboard-types.ts +++ b/frontend/lib/dashboard-types.ts @@ -102,6 +102,7 @@ export interface AirportCurrentConditions { is_official?: boolean; is_settlement_anchor?: boolean; stale_for_today?: boolean; + pressure_hpa?: number | null; last_observation_local_date?: string | null; current_local_date?: string | null; }