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> </p>
</div> </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)"> <div class="row_wrap" v-if="[0, 5].includes(operatorStore.disinfectStatus)">
<p class="title">允许消毒最大湿度(%RH)</p> <p class="title">允许消毒最大湿度(%RH)</p>
<p class="num"> <p class="num">
@ -257,6 +271,16 @@
:show="proportionalValveDefaultValueShow" :show="proportionalValveDefaultValueShow"
@blur="proportionalValveDefaultValueShow = false" @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> </div>
</template> </template>
@ -299,6 +323,7 @@ const {
allSettingList, allSettingList,
pre_heat_time_s, pre_heat_time_s,
proportionalValveDefaultValue, proportionalValveDefaultValue,
draughtFanValue,
} = storeToRefs(settingStore) } = storeToRefs(settingStore)
const props = defineProps({ const props = defineProps({
@ -318,6 +343,7 @@ const continued_saturShow = ref(false)
const max_humidityShow = ref(false) const max_humidityShow = ref(false)
const stoped_humiShow = ref(false) const stoped_humiShow = ref(false)
const continued_humiShow = ref(false) const continued_humiShow = ref(false)
const draughtFanShow = ref(false)
const isFirstClick = ref(true) const isFirstClick = ref(true)
@ -333,6 +359,7 @@ const hideClickKey = flag => {
stoped_saturShow.value = false stoped_saturShow.value = false
continued_saturShow.value = false continued_saturShow.value = false
max_humidityShow.value = false max_humidityShow.value = false
draughtFanShow.value = false
if (flag == 1) { if (flag == 1) {
addLiquidConfigValShow.value = true addLiquidConfigValShow.value = true
} }
@ -366,6 +393,9 @@ const hideClickKey = flag => {
if (flag == 11) { if (flag == 11) {
proportionalValveDefaultValueShow.value = true proportionalValveDefaultValueShow.value = true
} }
if (flag == 12) {
draughtFanShow.value = true
}
} }
const handleInput = (value, index) => { const handleInput = (value, index) => {
@ -425,6 +455,11 @@ const handleInput = (value, index) => {
proportionalValveDefaultValue.value = value + '' proportionalValveDefaultValue.value = value + ''
}) })
} }
if (index == 12) {
setTimeout(() => {
draughtFanValue.value = value + ''
})
}
isFirstClick.value = false isFirstClick.value = false
} }
} }
@ -511,6 +546,27 @@ const formatter11 = value => {
return value.replace(/^0+/gi, '') 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 => { const formatter4 = value => {
if (parseInt(value) == 0) { if (parseInt(value) == 0) {
return '0' return '0'
@ -813,6 +869,23 @@ const setProportionalValveDefaultValue = () => {
showSuccessToast('设置成功') 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 setSprayLiquidVal = () => {
const val = parseInt(sprayLiquidConfigVal.value) const val = parseInt(sprayLiquidConfigVal.value)
if (isNaN(val)) { if (isNaN(val)) {

20
src/components/Test.vue

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

4
src/store/modules/setting.js

@ -35,10 +35,14 @@ export const useSettingStore = defineStore({
exportLoading: false, exportLoading: false,
exportText: '', exportText: '',
proportionalValveDefaultValue: 0, proportionalValveDefaultValue: 0,
draughtFanValue: 0,
} }
}, },
// actions // actions
actions: { actions: {
updateDraughtFanValue(draughtFanValue) {
this.draughtFanValue = draughtFanValue
},
updateProportionalValveDefaultValue(proportionalValveDefaultValue) { updateProportionalValveDefaultValue(proportionalValveDefaultValue) {
this.proportionalValveDefaultValue = proportionalValveDefaultValue this.proportionalValveDefaultValue = proportionalValveDefaultValue
}, },

Loading…
Cancel
Save