From e9f3c00fd530a93428dcce0113a942e57b000158 Mon Sep 17 00:00:00 2001 From: zqm Date: Wed, 5 Nov 2025 08:59:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9addFloatingPanel=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E5=AE=9E=E7=8E=B0=E4=B8=89=E6=AD=A5=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=EF=BC=9A=E6=B7=BB=E5=8A=A0Area=EF=BC=8C=E5=9C=A8Area?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0TabPage=EF=BC=8C=E5=9C=A8TabPage?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0Panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Robot/Web/src/DockLayout/DockLayout.vue | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue b/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue index 223d355..dfa05eb 100644 --- a/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue +++ b/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue @@ -90,7 +90,7 @@ const addFloatingPanel = () => { y = Math.floor((containerRect.height - height) / 2) } - // 创建新的Area组件配置 + // 1. 添加一个Area。使用Area的初始设置 const newArea = { id: `floating-area-${areaIdCounter++}`, title: `浮动区域 ${areaIdCounter - 1}`, @@ -100,19 +100,29 @@ const addFloatingPanel = () => { height: 250, WindowState: '正常', showTitleBar: true, - // 添加一个Panel,填充满父容器 - panels: [ - { - id: `panel-${areaIdCounter - 1}-1`, - title: `面板 1`, - x: 0, - y: 0, - width: 100, - height: 100, - collapsed: false, - toolbarExpanded: false - } - ] + // 2. 向Area添加一个TabPage。TabPage的初始设置为填充满父容器 + tabPages: [ + { + id: `tabpage-${areaIdCounter - 1}-1`, + title: `标签页 1`, + // TabPage填充满父容器 + width: 100, + height: 100, + // 3. 向TabPage添加一个Panel。Panel的初始设置为填充满父容器 + panels: [ + { + id: `panel-${areaIdCounter - 1}-1-1`, + title: `面板 1`, + x: 0, + y: 0, + width: 100, + height: 100, + collapsed: false, + toolbarExpanded: false + } + ] + } + ] } floatingAreas.value.push(newArea) }