diff --git a/frontend/src/views/RecipeManager.vue b/frontend/src/views/RecipeManager.vue index d208388..6dc5d36 100644 --- a/frontend/src/views/RecipeManager.vue +++ b/frontend/src/views/RecipeManager.vue @@ -229,7 +229,6 @@
-
@@ -369,9 +368,11 @@ @@ -615,8 +616,18 @@ async function applyBatchTags() { } function previewRecipe() { - // TODO: generate card preview - ui.showToast('预览功能开发中') + const eoIngs = formIngredients.value.filter(i => i.oil && i.oil !== '椰子油' && i.drops > 0) + const cleanIngs = eoIngs.map(i => ({ oil: i.oil, drops: i.drops })) + if (formCocoRow.value && cocoActualDrops.value > 0) { + cleanIngs.push({ oil: '椰子油', drops: cocoActualDrops.value }) + } + previewRecipeData.value = { + _id: null, + name: formName.value || '未命名配方', + note: formNote.value || '', + tags: formTags.value, + ingredients: cleanIngs, + } } function doBatch(action) { @@ -1043,6 +1054,7 @@ async function loadContribution() { } catch {} } const previewRecipeIndex = ref(null) +const previewRecipeData = ref(null) const showBatchMenu = ref(false) const showBatchTagPicker = ref(false) const batchTagsSelected = ref([])