Browse Source

给请求到的默认配方信息名称赋值为 默认配置

master
王梦远 2 weeks ago
parent
commit
2beb5b47fb
  1. 1
      src/components/home/config.vue
  2. 28
      src/stores/formulaStore.ts

1
src/components/home/config.vue

@ -97,7 +97,6 @@ const onChooseFormula = () => {
* @description 重置配方数据为默认配置
*/
const onDefaultFormula = () => {
// formulaStore.updateSelectedFormulaDataByList()
formulaStore.initFormulaData()
}
</script>

28
src/stores/formulaStore.ts

@ -30,21 +30,21 @@ const createDefaultFormulaInfo = (): Formula.FormulaItem => ({
stoped_gs: 300,
stoped_humi: 85,
stoped_satur: 85,
name: '',
name: '默认配方',
})
// 清空配方函数
const createResetFormulaInfo = (): Formula.FormulaItem => ({
continued_gs: 0,
continued_humi: 0,
continued_satur: 0,
injection_pump_speed: 0,
loglevel: 0,
max_humidity: 0,
pre_heat_time_s: 0,
proportional_valve_default_value: 0,
stoped_gs: 0,
stoped_humi: 0,
stoped_satur: 0,
continued_gs: '',
continued_humi: '',
continued_satur: '',
injection_pump_speed: '',
loglevel: '',
max_humidity: '',
pre_heat_time_s: '',
proportional_valve_default_value: '',
stoped_gs: '',
stoped_humi: '',
stoped_satur: '',
name: '',
})
@ -71,7 +71,7 @@ export const useFormulaStore = defineStore('formula', () => {
},
{ deep: true },
)
// 计算属性
// 计算属性 todo bug 不能通过名字来判断
const isDefaultFormula = computed(() => selectedFormulaInfo.value?.name === defaultFormulaInfo.value.name)
/**
@ -87,7 +87,7 @@ export const useFormulaStore = defineStore('formula', () => {
updateLogLevels(item)
}
})
formulaMap.name = ''
formulaMap.name = '默认配置'
return formulaMap as Formula.FormulaItem
}

Loading…
Cancel
Save