136 lines
4.8 KiB
Markdown
136 lines
4.8 KiB
Markdown
# 实现方案 - 2026-04-29-21-27-10
|
||
|
||
## 对应需求
|
||
- 需求分析文档: `需求分析-2026-04-29-21-27-10.md`
|
||
|
||
## 方案概述
|
||
将 `src/components/` 下 7 个子目录共 11 个 `.tsx` 组件文件全部移动到 `src/components/` 根目录,并更新所有相关 import 路径。这是一个纯路径重构,不涉及任何业务逻辑变更。
|
||
|
||
## 当前目录结构
|
||
|
||
```
|
||
src/components/
|
||
├── ai/
|
||
│ └── AISegmentation.tsx
|
||
├── auth/
|
||
│ └── Login.tsx
|
||
├── dashboard/
|
||
│ └── Dashboard.tsx
|
||
├── layout/
|
||
│ └── Sidebar.tsx
|
||
├── projects/
|
||
│ └── ProjectLibrary.tsx
|
||
├── templates/
|
||
│ └── TemplateRegistry.tsx
|
||
└── workspace/
|
||
├── CanvasArea.tsx
|
||
├── FrameTimeline.tsx
|
||
├── OntologyInspector.tsx
|
||
├── ToolsPalette.tsx
|
||
└── VideoWorkspace.tsx
|
||
```
|
||
|
||
## 目标目录结构
|
||
|
||
```
|
||
src/components/
|
||
├── AISegmentation.tsx
|
||
├── Login.tsx
|
||
├── Dashboard.tsx
|
||
├── Sidebar.tsx
|
||
├── ProjectLibrary.tsx
|
||
├── TemplateRegistry.tsx
|
||
├── CanvasArea.tsx
|
||
├── FrameTimeline.tsx
|
||
├── OntologyInspector.tsx
|
||
├── ToolsPalette.tsx
|
||
└── VideoWorkspace.tsx
|
||
```
|
||
|
||
## 修改文件清单
|
||
|
||
### 文件 1-11: 组件文件移动(11 个文件)
|
||
- **修改类型**: 移动(mv)
|
||
- **文件列表**:
|
||
- `src/components/ai/AISegmentation.tsx` → `src/components/AISegmentation.tsx`
|
||
- `src/components/auth/Login.tsx` → `src/components/Login.tsx`
|
||
- `src/components/dashboard/Dashboard.tsx` → `src/components/Dashboard.tsx`
|
||
- `src/components/layout/Sidebar.tsx` → `src/components/Sidebar.tsx`
|
||
- `src/components/projects/ProjectLibrary.tsx` → `src/components/ProjectLibrary.tsx`
|
||
- `src/components/templates/TemplateRegistry.tsx` → `src/components/TemplateRegistry.tsx`
|
||
- `src/components/workspace/CanvasArea.tsx` → `src/components/CanvasArea.tsx`
|
||
- `src/components/workspace/FrameTimeline.tsx` → `src/components/FrameTimeline.tsx`
|
||
- `src/components/workspace/OntologyInspector.tsx` → `src/components/OntologyInspector.tsx`
|
||
- `src/components/workspace/ToolsPalette.tsx` → `src/components/ToolsPalette.tsx`
|
||
- `src/components/workspace/VideoWorkspace.tsx` → `src/components/VideoWorkspace.tsx`
|
||
|
||
### 文件 12: `src/App.tsx`(修改)
|
||
- **修改类型**: 修改 import 路径
|
||
- **修改内容**:
|
||
- `./components/layout/Sidebar` → `./components/Sidebar`
|
||
- `./components/dashboard/Dashboard` → `./components/Dashboard`
|
||
- `./components/projects/ProjectLibrary` → `./components/ProjectLibrary`
|
||
- `./components/workspace/VideoWorkspace` → `./components/VideoWorkspace`
|
||
- `./components/templates/TemplateRegistry` → `./components/TemplateRegistry`
|
||
- `./components/ai/AISegmentation` → `./components/AISegmentation`
|
||
- `./components/auth/Login` → `./components/Login`
|
||
|
||
### 文件 13: `src/components/AISegmentation.tsx`(修改)
|
||
- **修改类型**: 修改 import 路径
|
||
- **修改内容**:
|
||
- `../../lib/utils` → `../lib/utils`
|
||
- `../workspace/OntologyInspector` → `./OntologyInspector`
|
||
|
||
### 文件 14: `src/components/Login.tsx`(修改)
|
||
- **修改类型**: 修改 import 路径
|
||
- **修改内容**:
|
||
- `../../lib/utils` → `../lib/utils`
|
||
|
||
### 文件 15: `src/components/Sidebar.tsx`(修改)
|
||
- **修改类型**: 修改 import 路径
|
||
- **修改内容**:
|
||
- `../../lib/utils` → `../lib/utils`
|
||
- `../../App` → `../App`
|
||
|
||
### 文件 16: `src/components/ToolsPalette.tsx`(修改)
|
||
- **修改类型**: 修改 import 路径
|
||
- **修改内容**:
|
||
- `../../lib/utils` → `../lib/utils`
|
||
|
||
### 文件 17: `src/components/FrameTimeline.tsx`(修改)
|
||
- **修改类型**: 修改 import 路径
|
||
- **修改内容**:
|
||
- `../../lib/utils` → `../lib/utils`
|
||
|
||
### 文件 18: `src/components/VideoWorkspace.tsx`(修改)
|
||
- **修改类型**: 修改 import 路径
|
||
- **修改内容**:
|
||
- `./CanvasArea` → `./CanvasArea`(不变,已在同目录)
|
||
- `./ToolsPalette` → `./ToolsPalette`(不变,已在同目录)
|
||
- `./OntologyInspector` → `./OntologyInspector`(不变,已在同目录)
|
||
- `./FrameTimeline` → `./FrameTimeline`(不变,已在同目录)
|
||
- 注:VideoWorkspace 原本在 workspace 子目录内引用同级文件,移动到根目录后路径格式不变
|
||
|
||
### 文件 19-21: 清理空目录(7 个目录)
|
||
- **修改类型**: 删除空目录
|
||
- **目录列表**:
|
||
- `src/components/ai/`
|
||
- `src/components/auth/`
|
||
- `src/components/dashboard/`
|
||
- `src/components/layout/`
|
||
- `src/components/projects/`
|
||
- `src/components/templates/`
|
||
- `src/components/workspace/`
|
||
|
||
## 新增依赖
|
||
无
|
||
|
||
## 兼容性分析
|
||
- 与现有功能冲突: 无,纯路径重构
|
||
- 回滚策略: 通过 git 回滚到上一个 commit 即可
|
||
|
||
## 预估工作量
|
||
- 文件移动: 5 分钟
|
||
- 路径更新: 10 分钟
|
||
- 验证构建: 5 分钟
|