From 65ac0b688b1e361864a64c42fa30d01356f7a3a8 Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Fri, 10 Apr 2026 14:06:56 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=85=8D=E6=96=B9=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E8=B7=B3=E8=BD=AC=E5=88=B0?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=85=8D=E6=96=B9=E7=BB=9F=E4=B8=80=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 点击配方卡片的编辑按钮,跳转到管理配方页面打开同一个编辑器 - 不再维护两套编辑器,确保界面完全一致 Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/RecipeDetailOverlay.vue | 10 +++++++++- frontend/src/views/RecipeManager.vue | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/RecipeDetailOverlay.vue b/frontend/src/components/RecipeDetailOverlay.vue index 3c325c4..ded3695 100644 --- a/frontend/src/components/RecipeDetailOverlay.vue +++ b/frontend/src/components/RecipeDetailOverlay.vue @@ -17,7 +17,7 @@ @@ -739,6 +739,14 @@ function addEoRow() { editIngredients.value.push({ oil: '', drops: 1 }) } +function goEditInManager() { + const r = recipe.value + // Store recipe id for manager to pick up + localStorage.setItem('oil_edit_recipe_id', String(r._id)) + emit('close') + router.push('/manage') +} + const editPriceInfo = computed(() => oilsStore.fmtCostWithRetail(editIngredients.value.filter(i => i.oil)) ) diff --git a/frontend/src/views/RecipeManager.vue b/frontend/src/views/RecipeManager.vue index 9d93173..0ecafc3 100644 --- a/frontend/src/views/RecipeManager.vue +++ b/frontend/src/views/RecipeManager.vue @@ -946,6 +946,13 @@ onMounted(async () => { if (res.ok) reviewHistory.value = await res.json() } catch {} } + // Open recipe editor if redirected from card view + const editId = localStorage.getItem('oil_edit_recipe_id') + if (editId) { + localStorage.removeItem('oil_edit_recipe_id') + const recipe = recipeStore.recipes.find(r => String(r._id) === editId) + if (recipe) editRecipe(recipe) + } }) function editDiaryRecipe(diary) {