feat: implement PolyWeather dashboard core components, state management, and API integration

This commit is contained in:
2569718930@qq.com
2026-04-23 19:40:38 +08:00
parent 73eeb11b88
commit 4f57d4ed1a
6 changed files with 296 additions and 129 deletions
+5 -2
View File
@@ -570,15 +570,18 @@ export function DashboardStoreProvider({
};
const ensureCityMarketScan = async (cityName: string, force = false) => {
const cached = cityDetailsByName[cityName];
let cached = cityDetailsByName[cityName];
try {
if (!cached) {
cached = await ensureCityDetail(cityName, false, "panel");
}
const payload = await dashboardClient.getCityMarketScan(cityName, {
force,
targetDate: cached?.local_date || selectedForecastDate || null,
});
if (!payload.market_scan) return null;
setCityDetailsByName((current) => {
const detail = current[cityName];
const detail = current[cityName] || cached;
if (!detail) return current;
return {
...current,