From 886f4be951d68d4221bf067ee0b9d1d42f8e00ff Mon Sep 17 00:00:00 2001 From: zqm Date: Thu, 30 Oct 2025 21:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Panel=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=AE=A1=E7=AE=97=EF=BC=9A=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E5=80=BC=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E3=80=81=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E8=BE=B9=E6=A1=86=E5=8F=AF=E8=A7=81=E6=80=A7=E3=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0flex=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Windows/Robot/Web/src/DockLayout/Panel.js | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/AutoRobot/Windows/Robot/Web/src/DockLayout/Panel.js b/AutoRobot/Windows/Robot/Web/src/DockLayout/Panel.js index a99ce7f..962a822 100644 --- a/AutoRobot/Windows/Robot/Web/src/DockLayout/Panel.js +++ b/AutoRobot/Windows/Robot/Web/src/DockLayout/Panel.js @@ -43,12 +43,13 @@ export default defineComponent({ // 计算面板样式 const panelStyle = computed(() => { - // 确保从props.panel获取最新值,而不仅仅依赖内部ref - const posX = props.panel.x !== undefined ? props.panel.x : panelPosition.value.x; - const posY = props.panel.y !== undefined ? props.panel.y : panelPosition.value.y; - const width = props.panel.width !== undefined ? props.panel.width : panelSize.value.width; - const height = props.panel.height !== undefined ? props.panel.height : panelSize.value.height; + // 直接使用props.panel中的值,确保与父组件状态同步 + const posX = props.panel.x || 100; + const posY = props.panel.y || 100; + const width = props.panel.width || 300; + const height = props.panel.height || 180; + // 始终创建新对象,避免Vue响应式系统无法检测变化 const style = { position: 'absolute', top: `${posY}px`, @@ -56,11 +57,13 @@ export default defineComponent({ width: `${width}px`, height: `${height}px`, backgroundColor: 'white', - border: '1px solid #e5e7eb', + border: '1px solid #435d9c', // 更深的边框颜色以增强可见性 borderRadius: '4px', - boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1)', + boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.15)', overflow: 'hidden', - zIndex: 10 + zIndex: 10, + display: 'flex', + flexDirection: 'column' }; // 最大化状态 @@ -75,11 +78,6 @@ export default defineComponent({ style.left = '0px'; style.width = `${rect.width - 2}px`; style.height = `${rect.height - 2}px`; - } else { - style.top = '0px'; - style.left = '0px'; - style.width = '800px'; - style.height = '600px'; } }