Browse Source

test draught

master
maochaoying 2 years ago
parent
commit
0edf487523
  1. 73
      src/components/Setting/components/Device.vue
  2. 20
      src/components/Test.vue
  3. 4
      src/store/modules/setting.js

73
src/components/Setting/components/Device.vue

@ -119,6 +119,20 @@
/>
</p>
</div>
<div class="row_wrap">
<p class="title">风机速度</p>
<p class="num">
<van-field
class="field_font"
type="number"
:formatter="formatter12"
v-model="draughtFanValue"
:clickable="true"
readonly
@click.stop="hideClickKey(12)"
/>
</p>
</div>
<div class="row_wrap" v-if="[0, 5].includes(operatorStore.disinfectStatus)">
<p class="title">允许消毒最大湿度(%RH)</p>
<p class="num">
@ -257,6 +271,16 @@
:show="proportionalValveDefaultValueShow"
@blur="proportionalValveDefaultValueShow = false"
/>
<van-number-keyboard
theme="custom"
@input="val => handleInput(val, 12)"
close-button-text="配置"
@close="setDraughtFanValue"
v-model="draughtFanValue"
:title="draughtFanValue"
:show="draughtFanShow"
@blur="draughtFanShow = false"
/>
</div>
</template>
@ -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)) {

20
src/components/Test.vue

@ -236,16 +236,28 @@
</div>
<div class="common_set update_wrap pressure">
<p class="title">
压力1 <span>{{ sealStore.allPressure[0] }}</span>
压力1
<span>{{
(sealStore?.allPressure && sealStore?.allPressure[0]) || 0
}}</span>
</p>
<p class="title">
压力2 <span>{{ sealStore.allPressure[1] }}</span>
压力2
<span>{{
(sealStore?.allPressure && sealStore?.allPressure[1]) || 0
}}</span>
</p>
<p class="title">
压力3 <span>{{ sealStore.allPressure[2] }}</span>
压力3
<span>{{
(sealStore?.allPressure && sealStore?.allPressure[2]) || 0
}}</span>
</p>
<p class="title">
压力4 <span>{{ sealStore.allPressure[3] }}</span>
压力4
<span>{{
(sealStore?.allPressure && sealStore?.allPressure[3]) || 0
}}</span>
</p>
</div>
<div class="common_set info_wrap">

4
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
},

Loading…
Cancel
Save