diff --git a/docs/AI文档模板系统-像素级任务清单-20260701.md b/docs/AI文档模板系统-像素级任务清单-20260701.md index 0aef80e..bf0a92a 100644 --- a/docs/AI文档模板系统-像素级任务清单-20260701.md +++ b/docs/AI文档模板系统-像素级任务清单-20260701.md @@ -74,10 +74,10 @@ | 052 | 显示/隐藏标签 toggle 开关 | 前端 | 0.25d | ✅ 已完成 | | 053 | 缩放控制(70%/100%/150% scale 切换) | 前端 | 0.25d | ✅ 已完成 | | | **结构树** | | | | -| 054 | 递归树组件 + 数据绑定 | 前端 | 0.5d | ⏳ 未完成 | -| 055 | 展开/折叠交互 + 图标 | 前端 | 0.25d | ⏳ 未完成 | -| 056 | 状态圆点(已配置绿/待审核黄/已禁用红/未配置灰) | 前端 | 0.25d | ⏳ 未完成 | -| 057 | 点击树节点 → 预览区 scrollIntoView + 闪烁高亮 | 前端 | 0.5d | ⏳ 未完成 | +| 054 | 递归树组件 + 数据绑定 | 前端 | 0.5d | ✅ 已完成 | +| 055 | 展开/折叠交互 + 图标 | 前端 | 0.25d | ✅ 已完成 | +| 056 | 状态圆点(已配置绿/待审核黄/已禁用红/未配置灰) | 前端 | 0.25d | ✅ 已完成 | +| 057 | 点击树节点 → 预览区 scrollIntoView + 闪烁高亮 | 前端 | 0.5d | ✅ 已完成 | | | **配置面板** | | | | | 058 | 区域名称 input(默认取 text_preview) | 前端 | 0.25d | ⏳ 未完成 | | 059 | 区域类型 select | 前端 | 0.25d | ⏳ 未完成 | diff --git a/docs/tasks/task_detail_2026_07_01.md b/docs/tasks/task_detail_2026_07_01.md index d0c056d..0473340 100644 --- a/docs/tasks/task_detail_2026_07_01.md +++ b/docs/tasks/task_detail_2026_07_01.md @@ -108,3 +108,16 @@ 7. 增加 70%、100%、150% 缩放控制。 8. 执行前端构建和浏览器 DOM/点击选中检查。 - **执行结果**: 完成任务 047-053,Word 预览区支持渲染、选中、标签、颜色和缩放。 + +## 会话 ID: 20260701-structure-tree +- [2026-07-01 20:41:24] +- **执行原因**: 按任务清单继续完成结构树 054-057。 +- **执行过程**: + 1. 新增 `StructureTreeNode.vue` 递归树节点组件。 + 2. 将结构树改为层级数据绑定,支持 children 递归渲染。 + 3. 增加展开/折叠按钮和箭头旋转状态。 + 4. 增加已配置、待审核、已禁用、未配置四类状态圆点。 + 5. 点击树节点后更新高亮,并滚动到预览区对应 `data-block-id` 元素。 + 6. 增加全局 `tree-flash` 动画用于预览区闪烁提示。 + 7. 执行前端构建和浏览器 DOM 检查。 +- **执行结果**: 完成任务 054-057,结构树支持递归展示、状态、折叠和预览定位。 diff --git a/frontend/src/components/TemplateEdit/StructureTree.vue b/frontend/src/components/TemplateEdit/StructureTree.vue index d1a8148..83c9332 100644 --- a/frontend/src/components/TemplateEdit/StructureTree.vue +++ b/frontend/src/components/TemplateEdit/StructureTree.vue @@ -1,9 +1,47 @@ @@ -53,7 +93,7 @@ header { line-height: 18px; } -ul { +.tree-list { flex: 1; min-height: 0; margin: 0; @@ -61,48 +101,4 @@ ul { overflow: auto; list-style: none; } - -button { - display: grid; - width: 100%; - grid-template-columns: 8px minmax(0, 1fr); - gap: 8px; - align-items: center; - padding: 7px 12px; - border: 0; - background: transparent; - cursor: pointer; - text-align: left; -} - -button:hover { - background: var(--c-surface-soft); -} - -.dot { - width: 7px; - height: 7px; - border-radius: 50%; - background: var(--c-text-muted); -} - -.dot.done { - background: var(--c-success); -} - -.dot.pending { - background: var(--c-warn); -} - -.node-name { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.node-id { - grid-column: 2; - color: var(--c-text-muted); - font-size: 11px; -} diff --git a/frontend/src/components/TemplateEdit/StructureTreeNode.vue b/frontend/src/components/TemplateEdit/StructureTreeNode.vue new file mode 100644 index 0000000..fafea30 --- /dev/null +++ b/frontend/src/components/TemplateEdit/StructureTreeNode.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/frontend/src/styles/global.css b/frontend/src/styles/global.css index 9c021b0..b2ee0f6 100644 --- a/frontend/src/styles/global.css +++ b/frontend/src/styles/global.css @@ -21,3 +21,19 @@ textarea, select { font: inherit; } + +.doc-block.tree-flash { + animation: tree-flash 1.6s ease; +} + +@keyframes tree-flash { + 0%, + 100% { + outline-color: var(--c-primary); + } + + 50% { + background: #fff7d6; + outline-color: var(--c-warn); + } +}