diff --git a/src/components/home/config.vue b/src/components/home/config.vue index f05b049..d5c8726 100644 --- a/src/components/home/config.vue +++ b/src/components/home/config.vue @@ -97,7 +97,6 @@ const onChooseFormula = () => { * @description 重置配方数据为默认配置 */ const onDefaultFormula = () => { - // formulaStore.updateSelectedFormulaDataByList() formulaStore.initFormulaData() } diff --git a/src/stores/formulaStore.ts b/src/stores/formulaStore.ts index 3969616..b78a61b 100644 --- a/src/stores/formulaStore.ts +++ b/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 }