Browse Source

更新配方

master
maochaoying 2 years ago
parent
commit
49ed0a267a
  1. 9
      src/components/Formula.vue
  2. 53
      src/components/UpdatePreSetting.vue

9
src/components/Formula.vue

@ -4,7 +4,10 @@
<AddPreSetting :hideSettingModal="hideAddSettingModal" />
</div>
<div v-else-if="isUpdatePreSettingVisible">
<UpdatePreSetting :hideSettingModal="hideUpdateSettingModal" />
<UpdatePreSetting
:formulaInfo="formulaInfo"
:hideSettingModal="hideUpdateSettingModal"
/>
</div>
<div v-else>
<div class="header_wrap">
@ -137,12 +140,16 @@ const hideDelModal = () => {
const isAddPreSettingVisible = ref(false)
const isUpdatePreSettingVisible = ref(false)
const formulaInfo = ref({})
const showUpdateSetting = item => {
formulaInfo.value = item
console.log(item)
formulaStore.updateCurrentFormula(item)
isUpdatePreSettingVisible.value = true
}
const hideUpdateSettingModal = () => {
formulaInfo.value = {}
isUpdatePreSettingVisible.value = false
}

53
src/components/UpdatePreSetting.vue

@ -250,17 +250,15 @@ const webSocketStore = useWebSocketStore()
const operatorStore = useOperatorStore()
const formulaStore = useFormulaStore()
const { currentFormula } = storeToRefs(formulaStore)
const max_humidity = ref('0')
const continued_satur = ref('0')
const stoped_satur = ref('0')
const continued_gs = ref('0')
const stoped_gs = ref('0')
const continued_satur = ref(props.formulaInfo.continued_satur)
const stoped_satur = ref(props.formulaInfo.stoped_satur)
const continued_gs = ref(props.formulaInfo.continued_gs)
const stoped_gs = ref(props.formulaInfo.stoped_gs)
const addLiquidConfigVal = ref('0')
const sprayLiquidConfigVal = ref('0')
const stoped_humi = ref('0')
const continued_humi = ref('0')
const sprayLiquidConfigVal = ref(props.formulaInfo.injection_pump_speed)
const stoped_humi = ref(props.formulaInfo.stoped_humi)
const continued_humi = ref(props.formulaInfo.continued_humi)
const pre_heat_time_s = ref('0')
const pre_heat_time_sShow = ref(false)
@ -275,25 +273,13 @@ const stoped_humiShow = ref(false)
const continued_humiShow = ref(false)
const logVisible = ref(false)
const logVal = ref('6')
const formula_id = ref('')
watch(currentFormula, (newValue, oldValue) => {
formula_id.value = newValue.formula_id
logVal.value = newValue.loglevel
stoped_gs.value = newValue?.stoped_gs
continued_gs.value = newValue?.continued_gs
stoped_satur.value = newValue?.stoped_satur
continued_satur.value = newValue?.continued_satur
stoped_humi.value = newValue?.stoped_humi
continued_humi.value = newValue?.continued_humi
injection_pump_speed.value = newValue?.injection_pump_speed
})
const logVal = ref(props.formulaInfo.loglevel)
const formula_id = ref(props.formulaInfo.formula_id)
watch(formula_id, (newValue, oldValue) => {
if (newValue != '') {
webSocketStore.sendCommandMsg(
updateFormulaJSON('formula_id', newValue, currentFormula.id),
updateFormulaJSON('formula_id', newValue, props.formulaInfo.id),
)
}
})
@ -324,7 +310,7 @@ const changeLogVal = val => {
logVal.value = val
logVisible.value = false
webSocketStore.sendCommandMsg(
updateFormulaJSON('loglevel', val, currentFormula.id),
updateFormulaJSON('loglevel', val, props.formulaInfo.id),
)
}
const hiddenLogVisible = () => {
@ -340,6 +326,9 @@ const props = defineProps({
hideSettingModal: {
type: Function,
},
formulaInfo: {
type: Object,
},
})
const hiddleSettingModal = () => {
@ -639,7 +628,7 @@ const setStopedGsVal = () => {
return
} else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('stoped_gs', val, currentFormula.id),
updateFormulaJSON('stoped_gs', val, props.formulaInfo.id),
)
}
}
@ -651,7 +640,7 @@ const setcontinuedGsVal = () => {
return
} else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('continued_gs', val, currentFormula.id),
updateFormulaJSON('continued_gs', val, props.formulaInfo.id),
)
}
}
@ -663,7 +652,7 @@ const setstopedSaturVal = () => {
return
} else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('stoped_satur', val, currentFormula.id),
updateFormulaJSON('stoped_satur', val, props.formulaInfo.id),
)
}
}
@ -675,7 +664,7 @@ const setContinuedSaturVal = () => {
return
} else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('continued_satur', val, currentFormula.id),
updateFormulaJSON('continued_satur', val, props.formulaInfo.id),
)
}
}
@ -703,7 +692,7 @@ const setstoped_humiVal = () => {
return
} else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('stoped_humi', val, currentFormula.id),
updateFormulaJSON('stoped_humi', val, props.formulaInfo.id),
)
}
}
@ -715,7 +704,7 @@ const setcontinued_humiVal = () => {
return
} else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('continued_humi', val, currentFormula.id),
updateFormulaJSON('continued_humi', val, props.formulaInfo.id),
)
}
}
@ -727,7 +716,7 @@ const setSprayLiquidVal = () => {
return
} else {
webSocketStore.sendCommandMsg(
updateFormulaJSON('injection_pump_speed', val, currentFormula.id),
updateFormulaJSON('injection_pump_speed', val, props.formulaInfo.id),
)
}
}

Loading…
Cancel
Save