From 2beb5b47fbac9b6795fbb72606cc9e7d116b53d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=A2=A6=E8=BF=9C?= <1063331231@qq.com> Date: Sat, 5 Jul 2025 22:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E8=AF=B7=E6=B1=82=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=85=8D=E6=96=B9=E4=BF=A1=E6=81=AF=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E8=B5=8B=E5=80=BC=E4=B8=BA=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/config.vue | 1 - src/stores/formulaStore.ts | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) 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 }