Browse Source

集体保存

master
maochaoying 2 years ago
parent
commit
195d62bb72
  1. 4
      src/components/Operator.vue
  2. 4
      src/components/Progress.vue
  3. 3
      src/components/Setting/components/User.vue
  4. 2
      src/components/Test.vue
  5. 106
      src/components/UpdatePreSetting.vue
  6. 8
      src/mock/command.js

4
src/components/Operator.vue

@ -410,6 +410,10 @@
? '未开始' ? '未开始'
: operatorStore.estimatedRemainingTimeS == 0 : operatorStore.estimatedRemainingTimeS == 0
? '已结束' ? '已结束'
: operatorStore.disinfectStatus == 1
? `${time_To_hhmmss(operatorStore.estimatedRemainingTimeS)}`
: operatorStore.estimatedRemainingTimeS < 0
? '评估中'
: `${time_To_hhmmss(operatorStore.estimatedRemainingTimeS)}` : `${time_To_hhmmss(operatorStore.estimatedRemainingTimeS)}`
}} }}
</div> </div>

4
src/components/Progress.vue

@ -6,6 +6,10 @@
{{ {{
operatorStore.estimatedRemainingTimeS == 0 operatorStore.estimatedRemainingTimeS == 0
? '已结束' ? '已结束'
: operatorStore.disinfectStatus == 1
? `${time_To_hhmmss(operatorStore.estimatedRemainingTimeS)}`
: operatorStore.estimatedRemainingTimeS < 0
? '评估中'
: `${time_To_hhmmss(operatorStore.estimatedRemainingTimeS)}` : `${time_To_hhmmss(operatorStore.estimatedRemainingTimeS)}`
}} }}
</p> </p>

3
src/components/Setting/components/User.vue

@ -149,7 +149,6 @@
:input="newUserUserName" :input="newUserUserName"
/> />
</div> </div>
<div class="key_wrap" v-if="showkeyboard3"> <div class="key_wrap" v-if="showkeyboard3">
<SimpleKeyboard <SimpleKeyboard
:hideKeyBoard="hideKeyBoard3" :hideKeyBoard="hideKeyBoard3"
@ -223,6 +222,7 @@ const hiddenLogVisible = () => {
} }
const showAddPasswordKey = () => { const showAddPasswordKey = () => {
newUserUserName.value = ''
showkeyboard3.value = false showkeyboard3.value = false
showkeyboard2.value = true showkeyboard2.value = true
} }
@ -243,6 +243,7 @@ const onChange2 = a => {
} }
const showAddMewPasswordKey = () => { const showAddMewPasswordKey = () => {
newUserPassword.value = ''
showkeyboard2.value = false showkeyboard2.value = false
showkeyboard3.value = true showkeyboard3.value = true
} }

2
src/components/Test.vue

@ -211,7 +211,7 @@
? 0 ? 0
: deviceStore.disinfectantCapacity : deviceStore.disinfectantCapacity
}} }}
kPa/100g
g
</p> </p>
<div class="btn_wrap style-btn" @click="handleUpdate" style="opacity: 0"> <div class="btn_wrap style-btn" @click="handleUpdate" style="opacity: 0">
更新读取液位状态 更新读取液位状态

106
src/components/UpdatePreSetting.vue

@ -116,7 +116,7 @@
:show="addLiquidConfigValShow" :show="addLiquidConfigValShow"
@input="val => handleInput(val, 1)" @input="val => handleInput(val, 1)"
theme="custom" theme="custom"
close-button-text="配置"
close-button-text="确定"
@close="setAddliquidVal" @close="setAddliquidVal"
@blur="addLiquidConfigValShow = false" @blur="addLiquidConfigValShow = false"
/> />
@ -127,7 +127,7 @@
:show="sprayLiquidConfigValShow" :show="sprayLiquidConfigValShow"
theme="custom" theme="custom"
@close="setSprayLiquidVal" @close="setSprayLiquidVal"
close-button-text="配置"
close-button-text="确定"
@blur="sprayLiquidConfigValShow = false" @blur="sprayLiquidConfigValShow = false"
/> />
<van-number-keyboard <van-number-keyboard
@ -137,7 +137,7 @@
:show="stoped_gsShow" :show="stoped_gsShow"
theme="custom" theme="custom"
@close="setStopedGsVal" @close="setStopedGsVal"
close-button-text="配置"
close-button-text="确定"
@blur="stoped_gsShow = false" @blur="stoped_gsShow = false"
/> />
<van-number-keyboard <van-number-keyboard
@ -147,7 +147,7 @@
@close="setcontinuedGsVal" @close="setcontinuedGsVal"
:show="continued_gsShow" :show="continued_gsShow"
theme="custom" theme="custom"
close-button-text="配置"
close-button-text="确定"
@blur="continued_gsShow = false" @blur="continued_gsShow = false"
/> />
<van-number-keyboard <van-number-keyboard
@ -157,7 +157,7 @@
@close="setstopedSaturVal" @close="setstopedSaturVal"
:show="stoped_saturShow" :show="stoped_saturShow"
theme="custom" theme="custom"
close-button-text="配置"
close-button-text="确定"
@blur="stoped_saturShow = false" @blur="stoped_saturShow = false"
/> />
<van-number-keyboard <van-number-keyboard
@ -167,7 +167,7 @@
@close="setContinuedSaturVal" @close="setContinuedSaturVal"
:show="continued_saturShow" :show="continued_saturShow"
theme="custom" theme="custom"
close-button-text="配置"
close-button-text="确定"
@blur="continued_saturShow = false" @blur="continued_saturShow = false"
/> />
<van-number-keyboard <van-number-keyboard
@ -177,12 +177,12 @@
@close="setMaxHumidityVal" @close="setMaxHumidityVal"
:show="max_humidityShow" :show="max_humidityShow"
theme="custom" theme="custom"
close-button-text="配置"
close-button-text="确定"
@blur="max_humidityShow = false" @blur="max_humidityShow = false"
/> />
<van-number-keyboard <van-number-keyboard
theme="custom" theme="custom"
close-button-text="配置"
close-button-text="确定"
@input="val => handleInput(val, 8)" @input="val => handleInput(val, 8)"
@close="setHeat_timeVal" @close="setHeat_timeVal"
v-model="pre_heat_time_s" v-model="pre_heat_time_s"
@ -193,7 +193,7 @@
<van-number-keyboard <van-number-keyboard
@input="val => handleInput(val, 9)" @input="val => handleInput(val, 9)"
theme="custom" theme="custom"
close-button-text="配置"
close-button-text="确定"
@close="setstoped_humiVal" @close="setstoped_humiVal"
v-model="stoped_humi" v-model="stoped_humi"
:title="stoped_humi" :title="stoped_humi"
@ -203,7 +203,7 @@
<van-number-keyboard <van-number-keyboard
theme="custom" theme="custom"
@input="val => handleInput(val, 10)" @input="val => handleInput(val, 10)"
close-button-text="配置"
close-button-text="确定"
@close="setcontinued_humiVal" @close="setcontinued_humiVal"
v-model="continued_humi" v-model="continued_humi"
:title="continued_humi" :title="continued_humi"
@ -217,7 +217,7 @@
:logVal="logVal" :logVal="logVal"
/> />
<div class="btns"> <div class="btns">
<!-- <div class="btn" @click="save">保存</div> -->
<div class="btn" @click="save">修改</div>
<div class="btn ml" @click="hiddleSettingModal">返回</div> <div class="btn ml" @click="hiddleSettingModal">返回</div>
</div> </div>
<div class="key_wrap" v-show="showkeyboard" id="keyboard_formula"> <div class="key_wrap" v-show="showkeyboard" id="keyboard_formula">
@ -241,6 +241,7 @@ import {
setSettingValJSON, setSettingValJSON,
addFormulaJSON, addFormulaJSON,
getAllFormulaJSON, getAllFormulaJSON,
updateAllFormulaJSON,
updateFormulaJSON, updateFormulaJSON,
} from '@/mock/command' } from '@/mock/command'
import LogPicker from 'cpns/dialogs/LogPicker' import LogPicker from 'cpns/dialogs/LogPicker'
@ -278,9 +279,9 @@ const formula_id = ref(props.formulaInfo.formula_id)
watch(formula_id, (newValue, oldValue) => { watch(formula_id, (newValue, oldValue) => {
if (newValue != '') { if (newValue != '') {
webSocketStore.sendCommandMsg(
updateFormulaJSON('formula_id', newValue, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('formula_id', newValue, props.formulaInfo.id),
// )
} }
}) })
@ -289,29 +290,29 @@ const save = () => {
showFailToast('配方名称不能为空') showFailToast('配方名称不能为空')
return return
} }
// const data = {
// formula_id: formula_id.value,
// loglevel: logVal.value,
// injection_pump_speed: sprayLiquidConfigVal.value,
// stoped_gs: stoped_gs.value,
// continued_gs: continued_gs.value,
// stoped_satur: stoped_satur.value,
// continued_satur: continued_satur.value,
// stoped_humi: stoped_humi.value,
// continued_humi: continued_humi.value,
// }
// console.log(data)
// webSocketStore.sendCommandMsg(addFormulaJSON(data))
// webSocketStore.sendCommandMsg(getAllFormulaJSON)
const data = {
formula_id: formula_id.value,
loglevel: parseInt(logVal.value),
injection_pump_speed: parseInt(sprayLiquidConfigVal.value),
stoped_gs: parseInt(stoped_gs.value),
continued_gs: parseInt(continued_gs.value),
stoped_satur: parseInt(stoped_satur.value),
continued_satur: parseInt(continued_satur.value),
stoped_humi: parseInt(stoped_humi.value),
continued_humi: parseInt(continued_humi.value),
}
console.log(data)
webSocketStore.sendCommandMsg(updateAllFormulaJSON(data))
webSocketStore.sendCommandMsg(getAllFormulaJSON)
props.hideSettingModal() props.hideSettingModal()
} }
const changeLogVal = val => { const changeLogVal = val => {
logVal.value = val logVal.value = val
logVisible.value = false logVisible.value = false
webSocketStore.sendCommandMsg(
updateFormulaJSON('loglevel', val, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('loglevel', val, props.formulaInfo.id),
// )
} }
const hiddenLogVisible = () => { const hiddenLogVisible = () => {
logVisible.value = false logVisible.value = false
@ -658,9 +659,9 @@ const setStopedGsVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} else { } else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('stoped_gs', val, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('stoped_gs', val, props.formulaInfo.id),
// )
} }
} }
@ -670,9 +671,9 @@ const setcontinuedGsVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} else { } else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('continued_gs', val, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('continued_gs', val, props.formulaInfo.id),
// )
} }
} }
@ -682,9 +683,9 @@ const setstopedSaturVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} else { } else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('stoped_satur', val, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('stoped_satur', val, props.formulaInfo.id),
// )
} }
} }
@ -694,9 +695,9 @@ const setContinuedSaturVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} else { } else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('continued_satur', val, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('continued_satur', val, props.formulaInfo.id),
// )
} }
} }
@ -722,9 +723,9 @@ const setstoped_humiVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} else { } else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('stoped_humi', val, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('stoped_humi', val, props.formulaInfo.id),
// )
} }
} }
@ -734,9 +735,9 @@ const setcontinued_humiVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} else { } else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('continued_humi', val, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('continued_humi', val, props.formulaInfo.id),
// )
} }
} }
@ -746,15 +747,14 @@ const setSprayLiquidVal = () => {
showFailToast('设置失败,请填写正确参数') showFailToast('设置失败,请填写正确参数')
return return
} else { } else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('injection_pump_speed', val, props.formulaInfo.id),
)
// webSocketStore.sendCommandMsg(
// updateFormulaJSON('injection_pump_speed', val, props.formulaInfo.id),
// )
} }
} }
const showkeyboard = ref(false) const showkeyboard = ref(false)
const onChange = a => { const onChange = a => {
console.log(a)
formula_id.value = a formula_id.value = a
} }
const handleShowKeyBoard = () => { const handleShowKeyBoard = () => {

8
src/mock/command.js

@ -294,3 +294,11 @@ export const getDisinfectionConfigJSON = {
command: 'getDisinfectionConfig', command: 'getDisinfectionConfig',
messageId: 'getDisinfectionConfig', messageId: 'getDisinfectionConfig',
} }
export const updateAllFormulaJSON = data => {
return {
command: 'updateFormula2',
messageId: 'updateFormula2',
...data,
}
}
Loading…
Cancel
Save