From 0e163e0c32091246417452e2595b585f96961a8c Mon Sep 17 00:00:00 2001 From: zqm Date: Tue, 18 Nov 2025 13:58:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E6=B5=AE=E5=8A=A8=E7=AA=97=E5=8F=A3Ar?= =?UTF-8?q?ea=E6=8B=96=E5=8A=A8=E5=88=B0=E7=8B=AC=E7=AB=8B=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E6=8C=87=E7=A4=BA=E5=99=A8=E5=A4=96=E9=9D=A2=E6=94=BE?= =?UTF-8?q?=E5=BC=80=EF=BC=8C=E6=95=88=E6=9E=9C=E5=92=8C=E5=9C=A8=E7=8B=AC?= =?UTF-8?q?=E7=AB=8B=E4=B8=AD=E5=BF=83=E6=8C=87=E7=A4=BA=E5=99=A8=E4=B8=8A?= =?UTF-8?q?=E6=94=BE=E5=BC=80=E6=98=AF=E4=B8=80=E6=A0=B7=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E9=83=BD=E5=AE=9E=E7=8E=B0=E4=BA=86=E5=81=9C=E9=9D=A0=E3=80=82?= =?UTF-8?q?=E8=BF=99=E4=B8=8D=E5=90=88=E9=80=BB=E8=BE=91=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E5=9C=A8=E7=8B=AC=E7=AB=8B=E4=B8=AD=E5=BF=83=E6=8C=87?= =?UTF-8?q?=E7=A4=BA=E5=99=A8=E4=B8=8A=E6=94=BE=E5=BC=80=E6=89=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=81=9C=E9=9D=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Robot/Web/src/DockLayout/DockLayout.vue | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue b/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue index c172716..994ccd4 100644 --- a/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue +++ b/AutoRobot/Windows/Robot/Web/src/DockLayout/DockLayout.vue @@ -564,7 +564,8 @@ const onPanelDragEnd = () => { panelDragState.value.currentAreaId = null // 3.1 在onPanelDragEnd方法中添加中心停靠检测 - if (activeDockZone.value === 'center' && currentAreaId) { + // 确保只有在独立中心指示器区域内释放才执行停靠 + if (activeDockZone.value === 'center' && currentAreaId && isMouseInCenterIndicator(currentMousePosition.value.x, currentMousePosition.value.y)) { // 处理中心停靠 const result = handleCenterDocking(currentAreaId) if (!result.success) { @@ -642,7 +643,8 @@ const onAreaDragEnd = (areaId, event) => { panelDragState.value.currentAreaId = null // 3.1 在onAreaDragEnd方法中添加中心停靠检测 - if (activeDockZone.value === 'center') { + // 确保只有在独立中心指示器区域内释放才执行停靠 + if (activeDockZone.value === 'center' && isMouseInCenterIndicator(currentMousePosition.value.x, currentMousePosition.value.y)) { // 处理中心停靠 const result = handleCenterDocking(areaId) if (!result.success) { @@ -768,7 +770,8 @@ const onTabDragEnd = () => { tabDragState.value.currentAreaId = null // 3.2 在onTabDragEnd方法中添加中心停靠检测 - if (activeDockZone.value === 'center' && currentAreaId) { + // 确保只有在独立中心指示器区域内释放才执行停靠 + if (activeDockZone.value === 'center' && currentAreaId && isMouseInCenterIndicator(currentMousePosition.value.x, currentMousePosition.value.y)) { // 处理中心停靠 const result = handleCenterDocking(currentAreaId) if (!result.success) { @@ -1004,6 +1007,31 @@ const onPanelMaximizeSync = ({ areaId, maximized }) => { } // 第2步:Area验证逻辑 - 目标Area内容区为空的情况 +/** + * 检查鼠标是否在独立中心指示器区域内 + * @param {number} mouseX - 鼠标X坐标 + * @param {number} mouseY - 鼠标Y坐标 + * @returns {boolean} 是否在独立中心指示器区域内 + */ +const isMouseInCenterIndicator = (mouseX, mouseY) => { + if (!dockLayoutRef.value) return false + + try { + // 查找独立中心指示器元素 + const centerIndicator = dockLayoutRef.value.querySelector('.center-main-indicator') + if (!centerIndicator) return false + + const rect = centerIndicator.getBoundingClientRect() + + // 检查鼠标是否在独立中心指示器的边界框内 + return mouseX >= rect.left && mouseX <= rect.right && + mouseY >= rect.top && mouseY <= rect.bottom + } catch (error) { + console.warn('检查独立中心指示器区域时出错:', error) + return false + } +} + /** * 检查Area是否可以停靠到中心区域 * @param {Object} sourceArea - 源Area对象