Load nearby stations before opening intraday analysis

This commit is contained in:
2569718930@qq.com
2026-04-12 20:49:51 +08:00
parent a0adf05d1e
commit a27ae564fb
6 changed files with 64 additions and 24 deletions
+5 -3
View File
@@ -29,8 +29,10 @@ function normalizeCityName(cityName: string) {
return encodeURIComponent(String(cityName).replace(/\s/g, "-"));
}
function normalizeDetailDepth(depth?: "panel" | "full") {
return depth === "full" ? "full" : "panel";
function normalizeDetailDepth(depth?: "panel" | "nearby" | "full") {
if (depth === "full") return "full";
if (depth === "nearby") return "nearby";
return "panel";
}
async function fetchJson<T>(url: string): Promise<T> {
@@ -161,7 +163,7 @@ export const dashboardClient = {
async getCityDetail(
cityName: string,
options?: { force?: boolean; depth?: "panel" | "full" },
options?: { force?: boolean; depth?: "panel" | "nearby" | "full" },
) {
const force = options?.force ?? false;
const depth = normalizeDetailDepth(options?.depth);
+1 -1
View File
@@ -327,7 +327,7 @@ export interface AiAnalysisStructured {
export interface CityDetail {
name: string;
display_name: string;
detail_depth?: "panel" | "full";
detail_depth?: "panel" | "nearby" | "full";
lat: number;
lon: number;
temp_symbol: string;