From 0edf487523e981f1e5482e88a602c143e18bfddc Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Tue, 26 Dec 2023 20:00:57 +0800 Subject: [PATCH] test draught --- src/components/Setting/components/Device.vue | 73 ++++++++++++++++++++++++++++ src/components/Test.vue | 20 ++++++-- src/store/modules/setting.js | 4 ++ 3 files changed, 93 insertions(+), 4 deletions(-) diff --git a/src/components/Setting/components/Device.vue b/src/components/Setting/components/Device.vue index b5d2027..0a59dc3 100644 --- a/src/components/Setting/components/Device.vue +++ b/src/components/Setting/components/Device.vue @@ -119,6 +119,20 @@ />

+
+

风机速度

+

+ +

+

允许消毒最大湿度(%RH)

@@ -257,6 +271,16 @@ :show="proportionalValveDefaultValueShow" @blur="proportionalValveDefaultValueShow = false" /> +

@@ -299,6 +323,7 @@ const { allSettingList, pre_heat_time_s, proportionalValveDefaultValue, + draughtFanValue, } = storeToRefs(settingStore) const props = defineProps({ @@ -318,6 +343,7 @@ const continued_saturShow = ref(false) const max_humidityShow = ref(false) const stoped_humiShow = ref(false) const continued_humiShow = ref(false) +const draughtFanShow = ref(false) const isFirstClick = ref(true) @@ -333,6 +359,7 @@ const hideClickKey = flag => { stoped_saturShow.value = false continued_saturShow.value = false max_humidityShow.value = false + draughtFanShow.value = false if (flag == 1) { addLiquidConfigValShow.value = true } @@ -366,6 +393,9 @@ const hideClickKey = flag => { if (flag == 11) { proportionalValveDefaultValueShow.value = true } + if (flag == 12) { + draughtFanShow.value = true + } } const handleInput = (value, index) => { @@ -425,6 +455,11 @@ const handleInput = (value, index) => { proportionalValveDefaultValue.value = value + '' }) } + if (index == 12) { + setTimeout(() => { + draughtFanValue.value = value + '' + }) + } isFirstClick.value = false } } @@ -511,6 +546,27 @@ const formatter11 = value => { return value.replace(/^0+/gi, '') } +const formatter12 = value => { + if (parseInt(value) == 0) { + return '0' + } + let arr = settingStore.allSettingList.filter( + item => item.name == 'draughtFanValue', + ) + 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 + '' + } + } + if (value == '') { + return '0' + } + return value.replace(/^0+/gi, '') +} + const formatter4 = value => { if (parseInt(value) == 0) { return '0' @@ -813,6 +869,23 @@ const setProportionalValveDefaultValue = () => { showSuccessToast('设置成功') } +const setDraughtFanValue = () => { + const val = parseInt(draughtFanValue.value) + if (isNaN(val)) { + showFailToast('设置失败,请填写正确参数') + return + } + if (props.runInfection) { + webSocketStore.sendCommandMsg( + updateSettingInRunInfectionJSON('draughtFanValue', val), + ) + } else { + settingStore.updateDraughtFanValue(val) + webSocketStore.sendCommandMsg(setSettingValJSON('draughtFanValue', val)) + } + showSuccessToast('设置成功') +} + const setSprayLiquidVal = () => { const val = parseInt(sprayLiquidConfigVal.value) if (isNaN(val)) { diff --git a/src/components/Test.vue b/src/components/Test.vue index 819f425..47507bd 100644 --- a/src/components/Test.vue +++ b/src/components/Test.vue @@ -236,16 +236,28 @@

- 压力1 {{ sealStore.allPressure[0] }} + 压力1 + {{ + (sealStore?.allPressure && sealStore?.allPressure[0]) || 0 + }}

- 压力2 {{ sealStore.allPressure[1] }} + 压力2 + {{ + (sealStore?.allPressure && sealStore?.allPressure[1]) || 0 + }}

- 压力3 {{ sealStore.allPressure[2] }} + 压力3 + {{ + (sealStore?.allPressure && sealStore?.allPressure[2]) || 0 + }}

- 压力4 {{ sealStore.allPressure[3] }} + 压力4 + {{ + (sealStore?.allPressure && sealStore?.allPressure[3]) || 0 + }}

diff --git a/src/store/modules/setting.js b/src/store/modules/setting.js index a8288b9..b817f68 100644 --- a/src/store/modules/setting.js +++ b/src/store/modules/setting.js @@ -35,10 +35,14 @@ export const useSettingStore = defineStore({ exportLoading: false, exportText: '', proportionalValveDefaultValue: 0, + draughtFanValue: 0, } }, // actions actions: { + updateDraughtFanValue(draughtFanValue) { + this.draughtFanValue = draughtFanValue + }, updateProportionalValveDefaultValue(proportionalValveDefaultValue) { this.proportionalValveDefaultValue = proportionalValveDefaultValue },