From e2a31a6a9d15f8ebb10b26f38aae9639b72167a7 Mon Sep 17 00:00:00 2001 From: AutoRobot Dev Date: Sun, 2 Nov 2025 17:06:40 +0700 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=8F=90=E4=BA=A4=EF=BC=9A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=AE=E5=8A=A8=E5=8C=BA=E5=9F=9F=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Windows/Robot/Web/src/DockLayout/Area.vue | 16 +--- .../Robot/Web/src/DockLayout/DockLayout.vue | 86 ++++++++++++++++++- 2 files changed, 85 insertions(+), 17 deletions(-) diff --git a/AutoRobot/Windows/Robot/Web/src/DockLayout/Area.vue b/AutoRobot/Windows/Robot/Web/src/DockLayout/Area.vue index 878f5c3..90df47e 100644 --- a/AutoRobot/Windows/Robot/Web/src/DockLayout/Area.vue +++ b/AutoRobot/Windows/Robot/Web/src/DockLayout/Area.vue @@ -46,21 +46,7 @@
-
-
-
- -
-
-
+
diff --git a/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue b/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue index 03320a6..82868bd 100644 --- a/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue +++ b/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue @@ -1,9 +1,91 @@ \ No newline at end of file + +// 浮动区域列表 +const floatingAreas = ref([]) + +// 区域ID计数器 +let areaIdCounter = 1 + +// 添加新的浮动区域 +const addFloatingArea = () => { + const newArea = { + id: `floating-area-${areaIdCounter++}`, + title: `浮动区域 ${areaIdCounter - 1}`, + x: 50 + (areaIdCounter - 2) * 20, // 错开位置 + y: 50 + (areaIdCounter - 2) * 20, + width: 300, + height: 200, + collapsed: false, + toolbarExpanded: false + } + floatingAreas.value.push(newArea) +} + +// 切换折叠状态 +const onToggleCollapse = (id) => { + const area = floatingAreas.value.find(a => a.id === id) + if (area) { + area.collapsed = !area.collapsed + } +} + +// 最大化/还原 +const onMaximize = (id) => { + const area = floatingAreas.value.find(a => a.id === id) + if (area) { + // 简单实现:交换宽高 + const temp = area.width + area.width = area.height + area.height = temp + } +} + +// 关闭浮动区域 +const onCloseFloatingArea = (id) => { + const index = floatingAreas.value.findIndex(a => a.id === id) + if (index !== -1) { + floatingAreas.value.splice(index, 1) + } +} + +// 切换工具栏 +const onToggleToolbar = (id) => { + const area = floatingAreas.value.find(a => a.id === id) + if (area) { + area.toolbarExpanded = !area.toolbarExpanded + } +} + + + \ No newline at end of file