From e8a6c8dca2f3cc4ce03720be199711741d5ad9ff Mon Sep 17 00:00:00 2001 From: zqm Date: Mon, 20 Oct 2025 11:26:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=80=E5=B0=8F=E5=8C=96?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=AD=98=E5=82=A8=E6=96=B9=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E4=BB=8E=E4=BF=9D=E5=AD=98=E5=AE=8C=E6=95=B4=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=8F=AA=E4=BF=9D=E5=AD=98ID=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=BB=A5=E5=87=8F=E5=B0=91=E5=AD=98=E5=82=A8=E5=92=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E9=87=8D=E5=A4=8D=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Web/src/components/LayoutPersistence.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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