From 131d16b3012cb00eca947ae0797ee1ec361bde62 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Sat, 26 Aug 2023 12:24:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B9=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Setting/components/Device.vue | 102 +++++++++++++++++++++++++++ src/store/modules/setting.js | 18 +++++ 2 files changed, 120 insertions(+) diff --git a/src/components/Setting/components/Device.vue b/src/components/Setting/components/Device.vue index 68b221e..892eb48 100644 --- a/src/components/Setting/components/Device.vue +++ b/src/components/Setting/components/Device.vue @@ -57,6 +57,34 @@

+

消毒停止相对湿度(%RH)

+

+ +

+
+
+

消毒继续相对湿度(%RH)

+

+ +

+
+

消毒停止过氧化氢相对饱和度(%RS)

+ +

@@ -210,6 +256,8 @@ const { stoped_gs, addLiquidConfigVal, sprayLiquidConfigVal, + stoped_humi, + continued_humi, allSettingList, pre_heat_time_s, } = storeToRefs(settingStore) @@ -222,8 +270,12 @@ const continued_gsShow = ref(false) const stoped_saturShow = ref(false) const continued_saturShow = ref(false) const max_humidityShow = ref(false) +const stoped_humiShow = ref(false) +const continued_humiShow = ref(false) const hideClickKey = flag => { + stoped_humiShow.value = false + continued_humiShow.value = false pre_heat_time_sShow.value = false addLiquidConfigValShow.value = false sprayLiquidConfigValShow.value = false @@ -256,6 +308,12 @@ const hideClickKey = flag => { if (flag == 8) { pre_heat_time_sShow.value = true } + if (flag == 9) { + stoped_humiShow.value = true + } + if (flag == 10) { + continued_humiShow.value = true + } } const formatter1 = value => { @@ -376,6 +434,36 @@ const formatter8 = value => { return value } +const formatter9 = value => { + let arr = settingStore.allSettingList.filter( + item => item.name == 'stoped_humi', + ) + if (arr && arr.length > 0) { + if (parseInt(value) > arr[0].val_upper_limit) { + return arr[0].val_upper_limit + '' + } + if (parseInt(value) < arr[0].val_lower_limit) { + return arr[0].val_lower_limit + '' + } + } + return value +} + +const formatter10 = value => { + let arr = settingStore.allSettingList.filter( + item => item.name == 'continued_humi', + ) + if (arr && arr.length > 0) { + if (parseInt(value) > arr[0].val_upper_limit) { + return arr[0].val_upper_limit + '' + } + if (parseInt(value) < arr[0].val_lower_limit) { + return arr[0].val_lower_limit + '' + } + } + return value +} + const setAddliquidVal = () => { const val = parseInt(addLiquidConfigVal.value) settingStore.changeAddLiquidConfigVal(val) @@ -425,6 +513,20 @@ const setHeat_timeVal = () => { showSuccessToast('设置成功') } +const setstoped_humiVal = () => { + const val = parseInt(stoped_humi.value) + settingStore.updateStopedHumi(val) + webSocketStore.sendCommandMsg(setSettingValJSON('stoped_humi', val)) + showSuccessToast('设置成功') +} + +const setcontinued_humiVal = () => { + const val = parseInt(continued_humi.value) + settingStore.updateContinuedHumi(val) + webSocketStore.sendCommandMsg(setSettingValJSON('continued_humi', val)) + showSuccessToast('设置成功') +} + const setSprayLiquidVal = () => { const val = parseInt(sprayLiquidConfigVal.value) settingStore.changeSprayLiquidConfigVal(val) diff --git a/src/store/modules/setting.js b/src/store/modules/setting.js index 9397b44..29ca260 100644 --- a/src/store/modules/setting.js +++ b/src/store/modules/setting.js @@ -19,6 +19,10 @@ export const useSettingStore = defineStore({ pre_heat_time_s: 0, continued_gs: 0, stoped_gs: 0, + // 消毒停止相对湿度 + stoped_humi: 0, + // 消毒继续相对湿度 + continued_humi: 0, // 首屏初始化 initLoading: true, // 所有setting的对象数据 @@ -28,6 +32,12 @@ export const useSettingStore = defineStore({ }, // actions actions: { + updateStopedHumi(stoped_humi) { + this.stoped_humi = stoped_humi + }, + updateContinuedHumi(continued_humi) { + this.continued_humi = continued_humi + }, updatePre_heat_time_s(pre_heat_time_s) { this.pre_heat_time_s = pre_heat_time_s }, @@ -50,6 +60,14 @@ export const useSettingStore = defineStore({ this.stoped_gs = stoped_gs }, updateAllSettingList(allSettingList) { + const stoped_humiObj = allSettingList.filter( + item => item.name == 'stoped_humi', + )[0] + const continued_humiObj = allSettingList.filter( + item => item.name == 'continued_humi', + )[0] + this.stoped_humi = stoped_humiObj.val + this.continued_humi = continued_humiObj.val const stoped_gsObj = allSettingList.filter( item => item.name == 'stoped_gs', )[0]