fix: 配方成分显示和导出使用动态单位,重复提示改为"修改用量"
All checks were successful
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 5s
PR Preview / deploy-preview (pull_request) Successful in 13s
Test / e2e-test (push) Successful in 52s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 16:25:14 +00:00
parent eeb9b0aa88
commit 42993d47ee

View File

@@ -872,7 +872,7 @@ function selectOil(ing, name) {
// Check for duplicate oil in current recipe
const existing = formIngredients.value.find(i => i !== ing && i.oil === name)
if (existing) {
ui.showToast(`已有「${name}」,请直接修改滴数`)
ui.showToast(`已有「${name}」,请直接修改用量`)
ing._open = false
return
}
@@ -1568,7 +1568,7 @@ function recipesIdentical(a, b) {
}
function formatIngsCompare(ings) {
return (ings || []).map(i => `${i.oil} ${i.drops}`).join('、')
return (ings || []).map(i => `${i.oil} ${i.drops}${oils.unitLabel(i.oil)}`).join('、')
}
async function approveRecipe(recipe) {
@@ -1650,7 +1650,7 @@ async function exportExcel() {
return list.map(r => ({
'配方名称': r.name,
'标签': (r.tags || []).join('/'),
'精油成分': r.ingredients.map(i => `${i.oil}${i.drops}`).join('、'),
'精油成分': r.ingredients.map(i => `${i.oil}${i.drops}${oils.unitLabel(i.oil)}`).join('、'),
'成本': oils.fmtPrice(oils.calcCost(r.ingredients)),
'备注': r.note || '',
}))