精油编辑统一保存到 DB + 导出增加功效列 #41

Merged
fam merged 2 commits from fix/oil-card-persist into main 2026-04-16 11:11:14 +00:00
Contributor

问题

  1. 知识卡片(功效/用法/方法/注意/emoji)只存在内存的静态 JS 对象里,刷新丢失
  2. 基础字段和卡片字段走两套保存逻辑
  3. 价目表导出 Excel 没有功效列

修复

  • 新增 oil_cards 表,持久化知识卡片到 DB
  • POST /api/oils 扩展 card_* 字段,同一事务 upsert
  • 前端 getOilCard 优先查 DB store,再 fallback 静态表
  • saveEditOil 统一走 saveOil 一个入口
  • Excel 导出新增「功效」列
  • 首次部署自动从静态 OIL_CARDS seed 到 oil_cards 表

测试

  • vitest 366/366
  • API round-trip 验证:save → read back 一致
  • cypress oil-reference/smart-paste/price-export 全绿
## 问题 1. 知识卡片(功效/用法/方法/注意/emoji)只存在内存的静态 JS 对象里,刷新丢失 2. 基础字段和卡片字段走两套保存逻辑 3. 价目表导出 Excel 没有功效列 ## 修复 - 新增 `oil_cards` 表,持久化知识卡片到 DB - POST /api/oils 扩展 card_* 字段,同一事务 upsert - 前端 `getOilCard` 优先查 DB store,再 fallback 静态表 - `saveEditOil` 统一走 `saveOil` 一个入口 - Excel 导出新增「功效」列 - 首次部署自动从静态 OIL_CARDS seed 到 oil_cards 表 ## 测试 - vitest 366/366 - API round-trip 验证:save → read back 一致 - cypress oil-reference/smart-paste/price-export 全绿
fam added 1 commit 2026-04-16 10:56:42 +00:00
fix: 精油编辑统一保存到 DB + 导出 Excel 增加功效列
Some checks failed
Test / unit-test (push) Successful in 7s
Test / build-check (push) Successful in 4s
PR Preview / teardown-preview (pull_request) Has been skipped
Test / e2e-test (push) Failing after 1m12s
PR Preview / test (pull_request) Successful in 7s
PR Preview / deploy-preview (pull_request) Successful in 19s
c04bb53ddd
- 新增 oil_cards 表,持久化知识卡片(功效/用法/方法/注意/emoji)
- POST /api/oils 扩展接受 card_* 字段,在同一事务里 upsert oil_cards
- GET /api/oil-cards 返回全部卡片
- 前端 getOilCard 优先查 DB,再 fallback 静态表
- saveEditOil 统一走 saveOil,不再分两套保存
- 精油价目 Excel 导出增加「功效」列
- 首次部署自动从静态 OIL_CARDS 播种到 oil_cards 表

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner

🚀 Preview: https://pr-41.oil.oci.euphon.net

DB is a copy of production.

🚀 **Preview**: https://pr-41.oil.oci.euphon.net DB is a copy of production.
fam added 1 commit 2026-04-16 11:01:20 +00:00
fix: Excel 导出英文名也直接取 DB meta.enName
All checks were successful
PR Preview / test (pull_request) Has been skipped
Deploy Production / test (push) Successful in 7s
PR Preview / teardown-preview (pull_request) Successful in 14s
PR Preview / deploy-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 4s
Deploy Production / deploy (push) Successful in 6s
Test / e2e-test (push) Successful in 3m2s
e8af6e2565
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner

🚀 Preview: https://pr-41.oil.oci.euphon.net

DB is a copy of production.

🚀 **Preview**: https://pr-41.oil.oci.euphon.net DB is a copy of production.
fam merged commit e8af6e2565 into main 2026-04-16 11:11:14 +00:00
Owner

🗑️ Preview torn down.

🗑️ Preview torn down.
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hera/oil-formula-calculator#41