handleInput(val, 10)"
- close-button-text="配置"
+ close-button-text="确定"
@close="setcontinued_humiVal"
v-model="continued_humi"
:title="continued_humi"
@@ -217,7 +217,7 @@
:logVal="logVal"
/>
@@ -241,6 +241,7 @@ import {
setSettingValJSON,
addFormulaJSON,
getAllFormulaJSON,
+ updateAllFormulaJSON,
updateFormulaJSON,
} from '@/mock/command'
import LogPicker from 'cpns/dialogs/LogPicker'
@@ -278,9 +279,9 @@ const formula_id = ref(props.formulaInfo.formula_id)
watch(formula_id, (newValue, oldValue) => {
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('配方名称不能为空')
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()
}
const changeLogVal = val => {
logVal.value = val
logVisible.value = false
- webSocketStore.sendCommandMsg(
- updateFormulaJSON('loglevel', val, props.formulaInfo.id),
- )
+ // webSocketStore.sendCommandMsg(
+ // updateFormulaJSON('loglevel', val, props.formulaInfo.id),
+ // )
}
const hiddenLogVisible = () => {
logVisible.value = false
@@ -658,9 +659,9 @@ const setStopedGsVal = () => {
showFailToast('设置失败,请填写正确参数')
return
} 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('设置失败,请填写正确参数')
return
} 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('设置失败,请填写正确参数')
return
} 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('设置失败,请填写正确参数')
return
} 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('设置失败,请填写正确参数')
return
} 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('设置失败,请填写正确参数')
return
} 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('设置失败,请填写正确参数')
return
} 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 onChange = a => {
- console.log(a)
formula_id.value = a
}
const handleShowKeyBoard = () => {
diff --git a/src/mock/command.js b/src/mock/command.js
index 7b87a0f..54d3e6e 100644
--- a/src/mock/command.js
+++ b/src/mock/command.js
@@ -294,3 +294,11 @@ export const getDisinfectionConfigJSON = {
command: 'getDisinfectionConfig',
messageId: 'getDisinfectionConfig',
}
+
+export const updateAllFormulaJSON = data => {
+ return {
+ command: 'updateFormula2',
+ messageId: 'updateFormula2',
+ ...data,
+ }
+}