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)