feat: wire template stores and linkage

This commit is contained in:
zwt13703
2026-07-01 20:48:02 +08:00
parent 04b5536698
commit 60bdd5f268
10 changed files with 304 additions and 110 deletions
+15
View File
@@ -137,3 +137,18 @@
9. 增加未选中区域时的空状态占位。
10. 执行前端构建验证。
- **执行结果**: 完成任务 058-066,配置面板具备完整基础表单能力。
## 会话 ID: 20260701-stores-linkage
- [2026-07-01 20:47:36]
- **执行原因**: 按任务清单继续完成 Pinia Store 和三区联动 067-073。
- **执行过程**:
1. 新增 `templateStore`,集中管理模板信息、预览 HTML、blocks、tree、configs、loading 和 error。
2. 新增 `selectionStore`,集中管理当前选中的 `selectedBlockId`
3. 新增 `uiStore`,集中管理标签显示、缩放比例和保存状态。
4. `TemplateEdit.vue` 接入初始化 loading、加载失败错误页和重新加载按钮。
5. `WordPreview.vue` 接入 store,点击预览块会更新全局选中区域。
6. `StructureTree.vue` 接入 store,选中节点会同步高亮并定位预览区。
7. `ConfigPanel.vue` watch `selectedBlockId`,切换区域时自动加载对应配置。
8. `TopToolbar.vue` 接入模板信息和保存状态。
9. 执行前端构建验证。
- **执行结果**: 完成任务 067-073,基础 MVP 任务清单 001-073 已全部标注完成。