From 5997fe86dc7a5eeb869e1192b26b089f1d24f68a Mon Sep 17 00:00:00 2001 From: guoapeng Date: Fri, 18 Jul 2025 15:13:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8C=BA=E5=9F=9F=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=8F=96=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/spray/trayGraph/index.vue | 7 +++++-- src/views/main/index.vue | 6 ++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/spray/trayGraph/index.vue b/src/components/spray/trayGraph/index.vue index 5ea1b95..ecc50f9 100644 --- a/src/components/spray/trayGraph/index.vue +++ b/src/components/spray/trayGraph/index.vue @@ -99,6 +99,7 @@ const addSelect = () => { const height = newHeight const stageWidth = stage.value.width() const stageHeight = stage.value.height() + console.log(width, height, stageWidth, stageHeight) // 计算边界约束 // 1. 左上角不超出画布左/上边界 @@ -121,6 +122,8 @@ const addSelect = () => { boundBoxFunc(oldBoundBox, newBoundBox) { const stageWidth = stage.value.width() const stageHeight = stage.value.height() + console.log('oldBoundBox', oldBoundBox) + console.log('newBoundBox', newBoundBox) // 新边界必须满足以下条件: // 1. 左上角不超出画布左/上边界 @@ -129,8 +132,8 @@ const addSelect = () => { if ( newBoundBox.x < 0 || newBoundBox.y < 0 - || newBoundBox.x + newBoundBox.width > stageWidth - || newBoundBox.y + newBoundBox.height > stageHeight + || newBoundBox.x + Math.floor(newBoundBox.width) > stageWidth + || newBoundBox.y + Math.floor(newBoundBox.height) > stageHeight || oldBoundBox.width - (newBoundBox.x - oldBoundBox.x) < 25 || newBoundBox.width < 25 || oldBoundBox.height - (newBoundBox.y - oldBoundBox.y) < 25 diff --git a/src/views/main/index.vue b/src/views/main/index.vue index 5ddc137..afb6b0e 100644 --- a/src/views/main/index.vue +++ b/src/views/main/index.vue @@ -56,12 +56,12 @@ const ok = () => { } const statusMessage = (data: any) => { // 更新 systemStore 的 systemStatus - console.log(data) + const stopPressed = systemStore.systemStatus.stopPressed if (stopPressed !== data.stopPressed && data.stopPressed === false) { getStatus() } - console.log(data) + systemStore.updateSystemStatus(data) } @@ -93,13 +93,11 @@ const status = computed(() => { return !['suspendable', 'selfTestCompleted', 'deviceHumidity', 'nozzleTemperature', 'slideTemperature'].includes(key) }) let str = '' - console.log(keys) keys.forEach((key) => { if (systemStore.systemStatus[key as keyof typeof systemStore.systemStatus]) { str += `${ingObj[key as keyof typeof ingObj]} | ` } }) - console.log(str) if (str === '') { return '空闲' }