feat: 配方卡片编辑按钮跳转到管理配方统一编辑器
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 14s
Test / e2e-test (push) Failing after 52s
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 14s
Test / e2e-test (push) Failing after 52s
- 点击配方卡片的编辑按钮,跳转到管理配方页面打开同一个编辑器 - 不再维护两套编辑器,确保界面完全一致 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="canEditThisRecipe"
|
v-if="canEditThisRecipe"
|
||||||
class="action-btn action-btn-sm"
|
class="action-btn action-btn-sm"
|
||||||
@click="viewMode = 'editor'"
|
@click="goEditInManager"
|
||||||
>编辑</button>
|
>编辑</button>
|
||||||
<button class="detail-close-btn" @click="handleClose">✕</button>
|
<button class="detail-close-btn" @click="handleClose">✕</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -739,6 +739,14 @@ function addEoRow() {
|
|||||||
editIngredients.value.push({ oil: '', drops: 1 })
|
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(() =>
|
const editPriceInfo = computed(() =>
|
||||||
oilsStore.fmtCostWithRetail(editIngredients.value.filter(i => i.oil))
|
oilsStore.fmtCostWithRetail(editIngredients.value.filter(i => i.oil))
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -946,6 +946,13 @@ onMounted(async () => {
|
|||||||
if (res.ok) reviewHistory.value = await res.json()
|
if (res.ok) reviewHistory.value = await res.json()
|
||||||
} catch {}
|
} 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) {
|
function editDiaryRecipe(diary) {
|
||||||
|
|||||||
Reference in New Issue
Block a user