From f248a914a84cc0b1949a8445be1607c71ed68501 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Fri, 4 Jul 2025 16:18:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E6=B6=88=E6=AF=92?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=8D=E5=8F=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/formula/FormulaConfig.vue | 23 ++++++++++++++++++----- src/components/home/LineChart.vue | 11 ++++------- src/stores/homeStore.ts | 2 +- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/components/formula/FormulaConfig.vue b/src/components/formula/FormulaConfig.vue index 2b4322a..2c08afe 100644 --- a/src/components/formula/FormulaConfig.vue +++ b/src/components/formula/FormulaConfig.vue @@ -227,7 +227,8 @@ const deviceState = computed(() => { * 根据是否有formula_id决定是添加新配方还是编辑已有配方 */ const onSaveFormula = () => { - if (formData.value.formula_id) { // 修改配方 + if (formData.value.formula_id) { + // 修改配方 // 判断消毒是否正在执行 且正在执行配方是当前修改配方 if (!deviceState.value && formulaStore.selectedFormulaInfo?.formula_id === formData.value.formula_id) { ElMessage.warning('禁止修改正在执行的配方信息!') @@ -236,7 +237,8 @@ const onSaveFormula = () => { const formulaForm: Record = convertValuesToString(formData.value, 'name') onEditFormula(formulaForm.formula_id, formulaForm as Formula.FormulaItem) } - else { // 新增配方 + else { + // 新增配方 onAddFormula() } } @@ -318,7 +320,10 @@ const onEditFormula = (formula_id: string, formulaForm: Formula.FormulaItem) => formulaStore.initFormulaList() // formData.value = formulaForm formulaStore.updateSelectedFormulaData(formulaForm) - if (formulaStore.selectedFormulaInfo !== null && formulaStore.selectedFormulaInfo.formula_id === formulaForm.formula_id) { + if ( + formulaStore.selectedFormulaInfo !== null + && formulaStore.selectedFormulaInfo.formula_id === formulaForm.formula_id + ) { formulaStore.updateSelectedFormulaDataByList(formulaForm) } }) @@ -415,8 +420,16 @@ defineExpose({