From 2d8452ac4f41c4f64d8651c57700baf3e3b00072 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Mon, 24 Mar 2025 23:27:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=80=A5=E5=81=9C=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E5=90=8E=E8=87=AA=E6=A3=80;=E5=8F=82=E6=95=B0=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main/index.vue | 4 ++++ src/views/spray/index.vue | 30 ++++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/views/main/index.vue b/src/views/main/index.vue index cb17264..331c7b4 100644 --- a/src/views/main/index.vue +++ b/src/views/main/index.vue @@ -48,6 +48,10 @@ const ok = () => { const statusMessage = (data: any) => { // 更新 systemStore 的 systemStatus console.log(data) + const stopPressed = systemStore.systemStatus.stopPressed + if (stopPressed !== data.stopPressed && data.stopPressed === false) { + getStatus() + } systemStore.updateSystemStatus(data) } diff --git a/src/views/spray/index.vue b/src/views/spray/index.vue index f7ab225..a766d06 100644 --- a/src/views/spray/index.vue +++ b/src/views/spray/index.vue @@ -99,18 +99,24 @@ const updateParam = () => { infoVisible.value = true } +const updateFormRef = ref() const submitParam = async () => { - const params = { - cmdCode: 'matrix_spray_change_param', - cmdId: '', - params: updateForm.value, - } - form.value = { - ...form.value, - ...updateForm.value, - } - await sendControl(params) - infoVisible.value = false + updateFormRef.value.validate(async (valid: boolean) => { + if (!valid) { + return + } + const params = { + cmdCode: 'matrix_spray_change_param', + cmdId: '', + params: updateForm.value, + } + form.value = { + ...form.value, + ...updateForm.value, + } + await sendControl(params) + infoVisible.value = false + }) } const form = ref({ @@ -533,7 +539,7 @@ const addCraft = () => { - +