Commit Graph

9 Commits

Author SHA1 Message Date
cf77d40569 本轮新增:
PPT 对象选择和绿色选中框。
双击编辑文本框、表格单元格。
文字字体、字号、加粗、颜色、对齐属性。
Ctrl/Cmd+Z、Ctrl/Cmd+Shift+Z 撤销重做。
PPT 缩略图/网格总览切换。
历史版本只读查看。
历史版本“恢复为新版本”,不覆盖旧文件。
海报区块显示/隐藏。
长图区块上移、下移排序。
新背景候选确认,可选择使用新背景或保留原背景。
合规问题“一键采用建议”。
新增 warn 合规级别。
解析失败人工填写入口。
展示解析方法和低质量页诊断。
同步更新了[API 接口文档](/D:/work/code/python/coding/baodanagent/docs/保险智能客服系统_API接口文档.md)。
验证结果:
相关后端测试:28 passed, 1 skipped
Python 编译检查:通过
前端生产构建:通过
git diff --check:通过
2026-07-31 15:41:58 +08:00
25c6f2a3b7 阶段 3 剩余:编辑与版本化
功能	文件	说明
幻灯片显隐	routes.py, PptResult.vue, ppt-api.ts	每页可点击隐藏/恢复,隐藏页在缩略图中半透明显示,页码标注隐藏数量
DeckContract 快照	renderer.py, celery_tasks.py, ppt_session.py	生成时保存完整 deck JSON 到文件系统,供版本化回溯
版本化生成	celery_tasks.py, task_service.py, routes.py	POST /preview/:id/regenerate → 递增版本号 → 用 deck 重新渲染 → 追加到版本历史,不覆盖旧版
版本历史 UI	PptResult.vue	右栏显示版本列表(版本号/页数/时间),当前版本高亮标记
数据库迁移	migrate_025.py	新增 deck_contract_path、versions_json 字段
阶段 4:UI 重构
功能	文件	说明
保险绿主题	PptPage.vue, PptGenerate.vue, PptResult.vue, PptSlideCanvas.vue	主色从 #2563eb 蓝改为 #3B7A57 保险绿,背景暖灰 #f0f7f3
生成决策展示	PptGenerate.vue	新增"系统决策"区域,展示检测场景、选用模板、计划书数量、险种类型、保司
骨架屏加载	PptResult.vue	preview_status=none/generating 时显示骨架屏 + 加载动画,不再显示静态 fallback
新增后端接口(本轮)
方法	路径	功能
POST	/ppt/preview/:id/regenerate	基于编辑内容生成新版本
PUT	/ppt/preview/:id/slide/:index	增加 hidden 字段支持
新增 Celery 任务
任务名	说明
insurance.regenerate_ppt	读取 DeckContract → 应用编辑 → 重新渲染 → 保存新版本
2026-07-29 21:41:28 +08:00
f23b08eec6 07-29 PPT生成优化第一阶段完成:
已完成约 40%(阶段 1 + 阶段 2 + 阶段 3 基础编辑),覆盖了计划书中最核心的 P0 需求:

 真实预览(Canvas 方案替代了 LibreOffice 方案)
 质量检查(6 自动 + 4 人工)
 三栏结果工作台
 基础文字编辑
2026-07-29 21:26:48 +08:00
bf90801f28 07-29 修复一版问题PPT 能够上传了 2026-07-29 17:24:34 +08:00
74dbb32028 07-29 修复一版问题 2026-07-29 12:19:26 +08:00
1debd7df39 feat(ppt): upgrade renderer from 5 fixed slides to 10+ configurable pages
Rewrite fast_pptx_renderer.py to read requiredPageTypes from template
config instead of hardcoding 5 slides. Add 10 slide builder functions
(cover, company, narrative, chart, timeline, table, compare, synergy,
conclusion, closing) with python-pptx native charts.

Key changes:
- Renderer reads templateConfig.requiredPageTypes and slidesConfig
  from DeckContract to determine slide sequence and per-slide metadata
- routes.py loads PptTemplate and PptCompany from DB, normalizes all
  PDF extractions (not just the first), passes full context to renderer
- renderer.py injects templateConfig, company info, and multi-product
  data into DeckContract
- Add slides_config_json column to PptTemplate (migrate_017) for
  per-slide title/narrative/chartType configuration via admin UI
- Admin template editor now supports drag-reorder slides, per-slide
  title/narrative hint, chart/table type selection
- Add requiredPageTypes to savings/ink, savings/minimal, savings/business
  templates (were missing, causing fallback to defaults)
- Fix IUL normalizer: add payYears and totalPremium to policy dict
- Fix CI/IUL normalizer: add totalSurrenderValue alias to benefitRows
  so charts render correctly for all product types
- Port calculation functions from baodanppt: decade_rows, paid_premium,
  simple_return, compound_return, find_payback_year

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 17:49:09 +08:00
a4d458c978 fix: map unsupported themes to renderer-compatible themes
- Map broker/modern/fresh to deepblue
- Map warm to caramel
- Keep chinese as is
- Fix 'invalid choice: broker' error
2026-07-24 16:55:09 +08:00
071f08d84a fix: use current Python interpreter for subprocess
- Prefer sys.executable for subprocess calls
- Add fallback to virtual environment Python
- Fix 'No module named pptx' error in Docker
2026-07-24 16:46:12 +08:00
4a556a1cc7 0723 PPT功能初步融合 2026-07-23 13:10:50 +08:00