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 = () => { - +