diff --git a/AutoRobot/Windows/Robot/Web/src/components/LayoutPersistence.js b/AutoRobot/Windows/Robot/Web/src/components/LayoutPersistence.js index 3ecaadd..0bb5368 100644 --- a/AutoRobot/Windows/Robot/Web/src/components/LayoutPersistence.js +++ b/AutoRobot/Windows/Robot/Web/src/components/LayoutPersistence.js @@ -166,6 +166,8 @@ export class LayoutPersistence { // 浮动窗口数据 floatingWindows: this.panelCollections.floatingWindows || [], + // 最小化窗口数据 - 只保存ID列表以优化存储 + minimizedWindowsIds: (this.panelCollections.minimizedWindows || []).map(w => w.id) || [], activeCenterTab: this.layoutState.activeCenterTab, timestamp: new Date().toISOString() @@ -275,6 +277,20 @@ export class LayoutPersistence { this.panelCollections.floatingWindows = layout.floatingWindows; } + if (Array.isArray(layout.minimizedWindowsIds) && this.panelCollections.minimizedWindows && this.panelCollections.floatingWindows) { + // 清空现有最小化窗口列表 + this.panelCollections.minimizedWindows = []; + + // 根据保存的ID列表,从浮动窗口中找到对应的窗口并添加到最小化列表 + layout.minimizedWindowsIds.forEach(windowId => { + const window = this.panelCollections.floatingWindows.find(w => w.id === windowId); + if (window) { + window.minimized = true; // 确保窗口标记为最小化 + this.panelCollections.minimizedWindows.push(window); + } + }); + } + // 应用激活标签 if (layout.activeCenterTab !== undefined) { // 现在layoutState是store对象,直接更新其中的activeCenterTab