From db778e0bacfa461511185bb85ba6c1d6cc4ccb6a Mon Sep 17 00:00:00 2001 From: Huarch Date: Thu, 24 Sep 2026 14:52:56 +0800 Subject: [PATCH] fix(workbench): reuse system reconnect notice --- src/features/workbench/map-workbench-page.tsx | 29 +++++++++++++------ .../browser/operational-task-approval.e2e.ts | 11 +++++++ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/features/workbench/map-workbench-page.tsx b/src/features/workbench/map-workbench-page.tsx index c65859f..04fa4fb 100644 --- a/src/features/workbench/map-workbench-page.tsx +++ b/src/features/workbench/map-workbench-page.tsx @@ -26,6 +26,7 @@ import { MapSourceStatusNotice, MapToolbar, MapZoom, + dismissMapNotice, showMapNotice, type MapToolbarItem, type MapSourceStatus @@ -166,6 +167,25 @@ export function MapWorkbenchPage({ ScheduledConditionRecord[] >([]); const workbenchSync = useWorkbenchSync(getAccessToken); + const workbenchSyncReconnecting = + workbenchSync.status === "reconnecting" && workbenchSync.snapshot !== null; + useEffect(() => { + const noticeId = "workbench-sync-reconnecting"; + if (!workbenchSyncReconnecting) { + dismissMapNotice(noticeId); + return; + } + + showMapNotice({ + id: noticeId, + tone: "warning", + title: "业务同步正在重连", + message: "当前数据可能陈旧,连接恢复后将自动更新。", + duration: Infinity + }); + + return () => dismissMapNotice(noticeId); + }, [workbenchSyncReconnecting]); const { headerDataTime, scheduledConditions: runtimeScheduledConditions, @@ -1166,15 +1186,6 @@ export function MapWorkbenchPage({ onLogout={onLogout} /> - {workbenchSync.status === "reconnecting" && workbenchSync.snapshot ? ( -
- 正在重连,业务数据可能陈旧 -
- ) : null} - {analysisResultsPanelOpen || peripheralSamplePanelOpen ? (