From 44ca0d0a356fcb00cec080711339bb7f8aeca06d Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Tue, 5 Sep 2023 14:59:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E4=B8=AD=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DisinfectionSetting.vue | 2 +- src/components/LoginForm.vue | 2 +- src/components/Setting/components/Device.vue | 51 ++++++++++++++++++++++++---- src/mock/command.js | 8 +++++ 4 files changed, 55 insertions(+), 8 deletions(-) diff --git a/src/components/DisinfectionSetting.vue b/src/components/DisinfectionSetting.vue index a0d09d1..1209ffd 100644 --- a/src/components/DisinfectionSetting.vue +++ b/src/components/DisinfectionSetting.vue @@ -1,6 +1,6 @@ diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index 7c923fa..9c06337 100644 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -149,7 +149,7 @@ const handleLogin = () => { left: 120px; top: 142px; font-family: Source Han Sans CN; - font-size: 18px; + font-size: 22px; font-weight: 350; letter-spacing: 0.06em; } diff --git a/src/components/Setting/components/Device.vue b/src/components/Setting/components/Device.vue index 1134c99..05be91d 100644 --- a/src/components/Setting/components/Device.vue +++ b/src/components/Setting/components/Device.vue @@ -225,7 +225,10 @@ import { ref } from 'vue' import { showSuccessToast, showFailToast } from 'vant' import { useSettingStore, useWebSocketStore, useOperatorStore } from '@/store' import { storeToRefs } from 'pinia' -import { setSettingValJSON } from '@/mock/command' +import { + setSettingValJSON, + changeDisinfectionParameterJSON, +} from '@/mock/command' const settingStore = useSettingStore() const webSocketStore = useWebSocketStore() @@ -244,6 +247,12 @@ const { pre_heat_time_s, } = storeToRefs(settingStore) +const props = defineProps({ + runInfection: { + type: Boolean, + }, +}) + const pre_heat_time_sShow = ref(false) const addLiquidConfigValShow = ref(false) const sprayLiquidConfigValShow = ref(false) @@ -541,8 +550,24 @@ const setAddliquidVal = () => { showFailToast('设置失败,请填写正确参数') return } - settingStore.changeAddLiquidConfigVal(val) - webSocketStore.sendCommandMsg(setSettingValJSON('drainage_pump_speed', val)) + if (props.runInfection) { + // 运行中消毒 + settingStore.changeAddLiquidConfigVal(val) + console.log(settingStore.sprayLiquidConfigVal) + const data = { + injection_pump_speed: settingStore.sprayLiquidConfigVal.value, + stoped_gs: stoped_gs, + continued_gs: continued_gs.value, + stoped_satur: settingStore.stoped_satur.value, + continued_satur: settingStore.continued_satur.value, + stoped_humi: settingStore.stoped_humi.value, + continued_humi: settingStore.continued_humi.value, + } + webSocketStore.sendCommandMsg(changeDisinfectionParameterJSON(data)) + } else { + settingStore.changeAddLiquidConfigVal(val) + webSocketStore.sendCommandMsg(setSettingValJSON('drainage_pump_speed', val)) + } showSuccessToast('设置成功') } @@ -552,9 +577,23 @@ const setStopedGsVal = () => { showFailToast('设置失败,请填写正确参数') return } - settingStore.updateStopedGs(val) - webSocketStore.sendCommandMsg(setSettingValJSON('stoped_gs', val)) - showSuccessToast('设置成功') + if (props.runInfection) { + settingStore.changeAddLiquidConfigVal(val) + const data = { + injection_pump_speed: sprayLiquidConfigVal, + stoped_gs, + continued_gs, + stoped_satur, + continued_satur, + stoped_humi, + continued_humi, + } + webSocketStore.sendCommandMsg(changeDisinfectionParameterJSON(data)) + } else { + settingStore.updateStopedGs(val) + webSocketStore.sendCommandMsg(setSettingValJSON('stoped_gs', val)) + showSuccessToast('设置成功') + } } const setcontinuedGsVal = () => { diff --git a/src/mock/command.js b/src/mock/command.js index 5e353a6..d6bf1fe 100644 --- a/src/mock/command.js +++ b/src/mock/command.js @@ -177,3 +177,11 @@ export const updateTimeJSON = (hour, min, second) => { second, } } + +export const changeDisinfectionParameterJSON = data => { + return { + command: 'changeDisinfectionParameter', + messageId: 'changeDisinfectionParameter', + ...data, + } +}