From 1a2346568f6288197eba1a333b9a99a54dc49b3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E6=A2=A6=E8=BF=9C?= <1063331231@qq.com>
Date: Tue, 1 Jul 2025 19:33:21 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=85=8D=E6=96=B9=E7=AC=AC?=
=?UTF-8?q?=E4=B8=80=E8=A1=8C=E7=82=B9=E5=87=BB=E4=B8=8D=E8=83=BD=E9=80=89?=
=?UTF-8?q?=E4=B8=AD=E7=9A=84bug=20=E5=8E=BB=E6=8E=89=E5=8F=96=E6=B6=88?=
=?UTF-8?q?=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/formula/FormulaConfig.vue | 9 +++------
src/components/formula/FormulaTable.vue | 8 ++++----
src/stores/formulaStore.ts | 2 +-
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/components/formula/FormulaConfig.vue b/src/components/formula/FormulaConfig.vue
index d280994..0cb4cf6 100644
--- a/src/components/formula/FormulaConfig.vue
+++ b/src/components/formula/FormulaConfig.vue
@@ -316,9 +316,9 @@ const openKeyboard = (e: any, item: Formula.FormulaItem) => {
/**
* 取消操作,重置配方数据
*/
-const handleCancel = () => {
- formulaStore.initFormulaData()
-}
+// const handleCancel = () => {
+// formulaStore.initFormulaData()
+// }
/**
* 恢复默认设置
@@ -456,9 +456,6 @@ defineExpose({
恢复默认值
-
- 取消
-
确定
diff --git a/src/components/formula/FormulaTable.vue b/src/components/formula/FormulaTable.vue
index 51b3aad..f7c777a 100644
--- a/src/components/formula/FormulaTable.vue
+++ b/src/components/formula/FormulaTable.vue
@@ -31,7 +31,7 @@ onMounted(() => {
watchEffect(() => {
recipes.value = formulaStore.formulaList
if (formulaStore.formulaList) {
- selectedIndex.value = formulaStore.selectedIndex || formulaStore.formulaList.length - 1
+ selectedIndex.value = formulaStore.selectedIndex || formulaStore.formulaList.length
}
})
@@ -45,8 +45,8 @@ const initFormulaList = () => {
}
const selectRecipe = (item: Formula.FormulaItem, index: number) => {
- formulaStore.updateSelectedIndex(index)
selectedIndex.value = selectedIndex.value === index ? null : index
+ formulaStore.updateSelectedIndex(index)
console.log('selectedIndex--', selectedIndex)
item = convertValuesToInt(item) as Formula.FormulaItem
formulaStore.updateSelectedFormulaData(item)
@@ -109,7 +109,7 @@ const deleteRecipe = (item: Formula.FormulaItem) => {
-
@@ -122,7 +122,7 @@ const deleteRecipe = (item: Formula.FormulaItem) => {
删除
-
+
diff --git a/src/stores/formulaStore.ts b/src/stores/formulaStore.ts
index 60bc70a..3d9f896 100644
--- a/src/stores/formulaStore.ts
+++ b/src/stores/formulaStore.ts
@@ -46,7 +46,7 @@ export const useFormulaStore = defineStore('formula', () => {
const formulaList = ref([])
const loglevel = ref('1')
const flip = ref(true)
- const selectedIndex = ref(0)
+ const selectedIndex = ref(0)
watch(defaultFormulaInfo, (newVal) => {
currentSelectedFormulaInfo.value = cloneDeep(newVal)