feat: connect template editor to APIs

This commit is contained in:
zwt13703
2026-07-01 21:48:11 +08:00
parent 60bdd5f268
commit 5a24edc3b0
4 changed files with 98 additions and 7 deletions
+12
View File
@@ -152,3 +152,15 @@
8. `TopToolbar.vue` 接入模板信息和保存状态。
9. 执行前端构建验证。
- **执行结果**: 完成任务 067-073,基础 MVP 任务清单 001-073 已全部标注完成。
## 会话 ID: 20260701-frontend-api-integration
- [2026-07-01 21:47:57]
- **执行原因**: 用户要求提交当前代码后继续推进项目实现。
- **执行过程**:
1. 检查 git 工作区,确认上一轮代码已提交且无未提交变更,因此不创建空提交。
2. 新增前端模板 API 模块,封装 `GET /api/templates/{id}``POST /api/templates/{id}/blocks/{blockId}/config`
3. 改造 `templateStore`,从后端模板详情接口加载模板、预览 HTML、blocks、tree 和 configs。
4. 改造配置保存逻辑,保存时调用后端 block config upsert 接口。
5. 改造 `TemplateEdit.vue`,从路由参数读取模板 ID 后加载对应模板。
6. 执行前端生产构建验证。
- **执行结果**: 前端模板编辑页已从纯 mock 数据推进到后端接口驱动,构建验证通过。