|
|
@ -185,7 +185,7 @@ export const useFormulaStore = defineStore('formula', () => { |
|
|
|
* @function initFormulaList |
|
|
|
* @desc 初始化配方列表,从服务器获取所有配方 |
|
|
|
*/ |
|
|
|
const initFormulaList = async (flag: 'add' | 'edit') => { |
|
|
|
const initFormulaList = async (flag?: 'add' | 'edit') => { |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
className: 'SettingMgrService', |
|
|
@ -197,8 +197,10 @@ export const useFormulaStore = defineStore('formula', () => { |
|
|
|
formulaList.value = res.rely |
|
|
|
if (res.rely.length > 0) { |
|
|
|
console.log('selectedIndex.value--', currentSelectedIndex.value) |
|
|
|
flag === 'add' && (currentSelectedFormulaInfo.value = res.rely[res.rely.length - 1]) |
|
|
|
flag === 'add' && (currentSelectedIndex.value = res.rely.length - 1) |
|
|
|
if (flag !== 'edit') { |
|
|
|
currentSelectedFormulaInfo.value = res.rely[res.rely.length - 1] |
|
|
|
currentSelectedIndex.value = res.rely.length - 1 |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
currentSelectedIndex.value = null |
|
|
|