|
|
@ -1,7 +1,7 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
import { syncSendCmd } from 'apis/system' |
|
|
|
import { ElMessageBox } from 'element-plus' |
|
|
|
import { onMounted, ref, watch, watchEffect } from 'vue' |
|
|
|
import { onMounted, ref, watch } from 'vue' |
|
|
|
|
|
|
|
import { FtMessage } from '@/libs/message' |
|
|
|
import { FtMessageBox } from '@/libs/messageBox' |
|
|
@ -9,7 +9,7 @@ import { convertValuesToInt } from '@/libs/utils' |
|
|
|
import { useFormulaStore } from '@/stores/formulaStore' |
|
|
|
|
|
|
|
const formulaStore = useFormulaStore() |
|
|
|
const selectedIndex = ref<number | null>(0) |
|
|
|
const selectedIndex = ref<number | null>(formulaStore.selectedIndex) |
|
|
|
const recipes = ref<Formula.FormulaItem[]>([]) |
|
|
|
const currectFormula = ref<Formula.FormulaItem>() |
|
|
|
|
|
|
@ -28,7 +28,7 @@ onMounted(() => { |
|
|
|
initFormulaList() |
|
|
|
}) |
|
|
|
|
|
|
|
watchEffect(() => { |
|
|
|
watch(() => formulaStore.formulaList.length, () => { |
|
|
|
recipes.value = formulaStore.formulaList |
|
|
|
if (formulaStore.formulaList && formulaStore.formulaList.length > 0) { |
|
|
|
selectedIndex.value = formulaStore.formulaList.length - 1 |
|
|
@ -37,7 +37,7 @@ watchEffect(() => { |
|
|
|
selectedIndex.value = null |
|
|
|
} |
|
|
|
}) |
|
|
|
watch(selectedIndex, () => { |
|
|
|
watch(() => selectedIndex.value, () => { |
|
|
|
if (selectedIndex.value != null) { |
|
|
|
const currentIndex: number = selectedIndex.value |
|
|
|
const selectItem: Formula.FormulaItem = recipes.value[currentIndex] |
|
|
|