Browse Source

消毒中设置

master
maochaoying 2 years ago
parent
commit
41e4d806cd
  1. 100
      src/components/Setting/components/Device.vue
  2. 9
      src/mock/command.js
  3. 13
      src/pages/Home.vue

100
src/components/Setting/components/Device.vue

@ -228,6 +228,7 @@ import { storeToRefs } from 'pinia'
import { import {
setSettingValJSON, setSettingValJSON,
changeDisinfectionParameterJSON, changeDisinfectionParameterJSON,
updateSettingInRunInfectionJSON,
} from '@/mock/command' } from '@/mock/command'
const settingStore = useSettingStore() const settingStore = useSettingStore()
@ -550,24 +551,8 @@ const setAddliquidVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return 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))
}
settingStore.changeAddLiquidConfigVal(val)
webSocketStore.sendCommandMsg(setSettingValJSON('drainage_pump_speed', val))
showSuccessToast('设置成功') showSuccessToast('设置成功')
} }
@ -578,22 +563,14 @@ const setStopedGsVal = () => {
return return
} }
if (props.runInfection) { 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))
webSocketStore.sendCommandMsg(
updateSettingInRunInfectionJSON('stoped_gs', val),
)
} else { } else {
settingStore.updateStopedGs(val) settingStore.updateStopedGs(val)
webSocketStore.sendCommandMsg(setSettingValJSON('stoped_gs', val)) webSocketStore.sendCommandMsg(setSettingValJSON('stoped_gs', val))
showSuccessToast('设置成功')
} }
showSuccessToast('设置成功')
} }
const setcontinuedGsVal = () => { const setcontinuedGsVal = () => {
@ -602,8 +579,15 @@ const setcontinuedGsVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} }
settingStore.updateContinuedGs(val)
webSocketStore.sendCommandMsg(setSettingValJSON('continued_gs', val))
if (props.runInfection) {
webSocketStore.sendCommandMsg(
updateSettingInRunInfectionJSON('continued_gs', val),
)
} else {
settingStore.updateContinuedGs(val)
webSocketStore.sendCommandMsg(setSettingValJSON('continued_gs', val))
}
showSuccessToast('设置成功') showSuccessToast('设置成功')
} }
@ -613,8 +597,14 @@ const setstopedSaturVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} }
settingStore.updateStopedSatur(val)
webSocketStore.sendCommandMsg(setSettingValJSON('stoped_satur', val))
if (props.runInfection) {
webSocketStore.sendCommandMsg(
updateSettingInRunInfectionJSON('stoped_satur', val),
)
} else {
settingStore.updateStopedSatur(val)
webSocketStore.sendCommandMsg(setSettingValJSON('stoped_satur', val))
}
showSuccessToast('设置成功') showSuccessToast('设置成功')
} }
@ -624,8 +614,14 @@ const setContinuedSaturVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} }
settingStore.updateContinuedSatur(val)
webSocketStore.sendCommandMsg(setSettingValJSON('continued_satur', val))
if (props.runInfection) {
webSocketStore.sendCommandMsg(
updateSettingInRunInfectionJSON('continued_satur', val),
)
} else {
settingStore.updateContinuedSatur(val)
webSocketStore.sendCommandMsg(setSettingValJSON('continued_satur', val))
}
showSuccessToast('设置成功') showSuccessToast('设置成功')
} }
@ -657,8 +653,14 @@ const setstoped_humiVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} }
settingStore.updateStopedHumi(val)
webSocketStore.sendCommandMsg(setSettingValJSON('stoped_humi', val))
if (props.runInfection) {
webSocketStore.sendCommandMsg(
updateSettingInRunInfectionJSON('stoped_humi', val),
)
} else {
settingStore.updateStopedHumi(val)
webSocketStore.sendCommandMsg(setSettingValJSON('stoped_humi', val))
}
showSuccessToast('设置成功') showSuccessToast('设置成功')
} }
@ -668,8 +670,14 @@ const setcontinued_humiVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} }
settingStore.updateContinuedHumi(val)
webSocketStore.sendCommandMsg(setSettingValJSON('continued_humi', val))
if (props.runInfection) {
webSocketStore.sendCommandMsg(
updateSettingInRunInfectionJSON('continued_humi', val),
)
} else {
settingStore.updateContinuedHumi(val)
webSocketStore.sendCommandMsg(setSettingValJSON('continued_humi', val))
}
showSuccessToast('设置成功') showSuccessToast('设置成功')
} }
@ -679,8 +687,16 @@ const setSprayLiquidVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} }
settingStore.changeSprayLiquidConfigVal(val)
webSocketStore.sendCommandMsg(setSettingValJSON('injection_pump_speed', val))
if (props.runInfection) {
webSocketStore.sendCommandMsg(
updateSettingInRunInfectionJSON('injection_pump_speed', val),
)
} else {
settingStore.changeSprayLiquidConfigVal(val)
webSocketStore.sendCommandMsg(
setSettingValJSON('injection_pump_speed', val),
)
}
showSuccessToast('设置成功') showSuccessToast('设置成功')
} }
</script> </script>

9
src/mock/command.js

@ -281,3 +281,12 @@ export const addFormulaJSON = data => {
export const startFormulaJSON = id => { export const startFormulaJSON = id => {
return { command: 'startFormula', messageId: 'startFormula', id } return { command: 'startFormula', messageId: 'startFormula', id }
} }
export const updateSettingInRunInfectionJSON = (column, val) => {
return {
command: 'updateFormula',
messageId: 'updateFormula',
column,
val,
}
}

13
src/pages/Home.vue

@ -83,6 +83,10 @@
activeTab == 7 ? 'tab_btn style-btn active_btn' : 'style-btn tab_btn' activeTab == 7 ? 'tab_btn style-btn active_btn' : 'style-btn tab_btn'
" "
@click="changeTab(7)" @click="changeTab(7)"
v-if="
userStore.loginUserPermission != 3 &&
[0, 5].includes(operatorStore.disinfectStatus)
"
> >
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@ -138,10 +142,7 @@
activeTab == 5 ? 'tab_btn style-btn active_btn' : 'style-btn tab_btn' activeTab == 5 ? 'tab_btn style-btn active_btn' : 'style-btn tab_btn'
" "
@click="changeTab(5)" @click="changeTab(5)"
v-if="
userStore.loginUserPermission != 3 &&
[0, 5].includes(operatorStore.disinfectStatus)
"
v-if="userStore.loginUserPermission != 3"
> >
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@ -210,11 +211,11 @@
<Setting <Setting
v-if="activeTab == 5 && [0, 5].includes(operatorStore.disinfectStatus)" v-if="activeTab == 5 && [0, 5].includes(operatorStore.disinfectStatus)"
/> />
<!-- <DisinfectionSetting
<DisinfectionSetting
v-if=" v-if="
activeTab == 5 && [1, 2, 3, 4].includes(operatorStore.disinfectStatus) activeTab == 5 && [1, 2, 3, 4].includes(operatorStore.disinfectStatus)
" "
/> -->
/>
<Audit v-if="activeTab == 6" /> <Audit v-if="activeTab == 6" />
<Formula v-if="activeTab == 7" /> <Formula v-if="activeTab == 7" />
<div class="other_info"> <div class="other_info">

Loading…
Cancel
Save