Browse Source

运行中更改

master
maochaoying 2 years ago
parent
commit
44ca0d0a35
  1. 2
      src/components/DisinfectionSetting.vue
  2. 2
      src/components/LoginForm.vue
  3. 41
      src/components/Setting/components/Device.vue
  4. 8
      src/mock/command.js

2
src/components/DisinfectionSetting.vue

@ -1,6 +1,6 @@
<template>
<div class="disinfection_setting_container">
<Device />
<Device :runInfection="true" />
</div>
</template>

2
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;
}

41
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
}
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
}
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 = () => {

8
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,
}
}
Loading…
Cancel
Save