feat(portal-shell): 学生域全页面迁移与规范合规修复

- 学生域 32 页全量迁移(含作答/自动保存/提交/诊断)

- 补齐 4 个 MSW mock 缺口,修 diagnostic case 名

- 修 4 处 Tailwind 任意值;新增共享组件与路由
This commit is contained in:
SpecialX
2026-08-31 11:25:21 +08:00
parent 039db5efdd
commit 04b7a40bdc
493 changed files with 70985 additions and 2112 deletions

View File

@@ -0,0 +1,678 @@
# 教师域功能迁移差异分析报告
> 对比基准CICD 项目(`E:\Desktop\CICD` → portal-shell 项目(`apps/portal-shell`
> 生成日期2026-07-27
> 用途:后续迁移工作的依据清单
## 对比范围说明
| 维度 | CICD | portal-shell |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| 教师页面入口 | `src/app/(dashboard)/teacher/` | `src/app/shell/teacher/` |
| 教师域模块 | `src/modules/{exams,grades,homework,lesson-preparation,attendance,classes,diagnostic,elective,error-book,course-plans,leave-requests,questions,textbooks,ai,proctoring,adaptive-practice,dashboard}/` | `src/features/teacher/{对应模块}/` |
| 数据层 | Server Actions + data-access | `src/lib/api/` GraphQL hooks + MSW 兜底 |
| 路由结构 | `(dashboard)` 路由组 | `shell` 路由组 |
> **架构差异说明**portal-shell 采用 GraphQL hooks`useXxx`)替代 CICD 的 Server Actions`actions*.ts`+ data-access 层(`data-access*.ts`)。因此 CICD 中的 `actions*.ts` / `data-access*.ts` / `schema.ts` / `types.ts` 等非组件文件在 portal-shell 中**按设计未迁移**,对应能力由 `lib/api/*.ts` + `features/*/transformations.ts` 承担。本报告对这类"按架构设计未迁移"的文件不予标记为缺失,仅关注**组件/UI 能力**层面的缺失与简化。
---
## 第一部分缺失页面清单CICD 有但 portal-shell 没有的路由)
### 1.1 真正缺失的路由
| CICD 路由 | 对应文件 | portal-shell 状态 | 备注 |
| -------------------- | ---------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/teacher/dashboard` | `teacher/dashboard/page.tsx` | ⚠️ 功能合并 | portal-shell 将仪表盘合并进 `/teacher/page.tsx``TeacherDashboardPage`功能保留但路由路径不同。CICD 的 `/teacher/page.tsx`773B是入口跳转`/teacher/dashboard/page.tsx`835B是实际仪表盘 |
**结论**portal-shell 无完全缺失的教师路由。`/teacher/dashboard` 被合并到 `/teacher` 根路由,属结构性调整而非缺失。
### 1.2 路由名称变更(非缺失,但路径不同)
| CICD 路由 | portal-shell 路由 | 说明 |
| ------------------------------- | -------------------------- | ---------------------------------------------------------- |
| `/teacher/exams/[id]/edit-rich` | `/teacher/exams/[id]/edit` | 重命名;实现由 Tiptap 简化为 contentEditable见第二部分 |
### 1.3 portal-shell 新增的路由CICD 没有)
| portal-shell 路由 | 说明 |
| ------------------------------------------------------ | ---------------------------------------------------------- |
| `/teacher/ai/ai-assist` | AI 助教页CICD 中 ai 模块以 widget 形式嵌入,无独立路由) |
| `/teacher/ai/ai-lesson-plan` | AI 教案页 |
| `/teacher/ai/ai-report` | AI 报告页 |
| `/teacher/analytics``/teacher/analytics/[studentId]` | 学情分析页CICD 中归属 grades/analytics |
| `/teacher/knowledge-graph` | 知识图谱页CICD 中归属 textbooks 模块的 graph 组件) |
| `/teacher/students` | 学生列表页 |
| `/teacher/homework/[id]` | 作业详情CICD 用 `assignments/[id]` |
| `/teacher/homework/new` | 新建作业CICD 用 `assignments/create` |
| `/teacher/classes/[id]` | 班级详情顶层路由CICD 仅 `my/[id]` |
---
## 第二部分简化迁移页面清单portal-shell 实现是简化版,需补全功能)
| 页面路由 | CICD 实现 | portal-shell 实现 | 简化点 | 补全建议 |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `/teacher/exams/[id]/edit`(原 edit-rich | Tiptap 富文本编辑器(`exam-rich-editor.tsx` 懒加载 `exam-rich-editor-inner.tsx`,含 7 个扩展节点blank-node / dotted-mark / group-block / image-node / question-block / section-block`selection-toolbar.tsx`;双向转换 3 文件) | `exam-rich-form.tsx` 使用 `contentEditable` + `document.execCommand`(见文件头注释:"移除 ExamRichEditor 依赖,使用 contentEditable 简化实现" | 缺失整个 Tiptap 编辑器基础设施、自定义节点扩展、结构与编辑器双向转换、选区工具栏 | 迁移 `editor/` 目录全部文件 + `@tiptap/*` 依赖 |
| `/teacher/lesson-plans/[planId]/edit` | `paper-editor.tsx` 基于 Tiptap依赖 `useLessonPlanEditor` hook+ `textbook-tiptap-editor.tsx` | `paper-editor.tsx` 使用 `contentEditable` + `document.execCommand`(见文件头注释:"使用 contentEditable 替代 Tiptapprop-driven" | 富文本能力退化,无法支持复杂块级结构 | 引入 Tiptap迁移 `textbook-tiptap-editor.tsx` |
| `/teacher/exams/[id]/proctoring` | 独立 `proctoring` 模块(`anti-cheat-monitor.tsx` / `exam-mode-config.tsx` / `proctoring-dashboard.tsx`+ WebSocket 实时推送 | `proctoring-client.tsx` 使用 5s 轮询模拟实时刷新(见文件头注释:"WS 契约未就绪...通过内置 5s 轮询模拟实时刷新" | 缺反作弊监控、考试模式配置、WS 实时推送 | 待 WS 契约就绪后改接实时推送;补 `anti-cheat-monitor` / `exam-mode-config` 组件 |
| `/teacher/exams/[id]/build` | 组卷工作台 + `exam-assembly.tsx` 完整子组件 | `exam-build-client.tsx` 三栏布局存在,但 `@contract-pending` 全 MSW 兜底 | 契约未接通,数据为 mock | 接通 `examBuild` / `questionsLibrary` / `saveExamBuild` 真实契约 |
| `/teacher/homework/submissions/[submissionId]/scan-grading` | `homework-scan-grading-view.tsx` | `scan-grading-client.tsx`(重命名),`@contract-pending` MSW 兜底 | 契约未接通 | 接通 `submissionDetail` / `saveScanGrading` 真实契约 |
| `/teacher/grades/entry` | `batch-grade-entry.tsx` + 独立 `hooks/use-batch-grade-entry-undo.ts` + `hooks/use-draft-lock.ts` | `batch-grade-entry.tsx` 存在但 undo hook **内联为本地实现** | 撤销逻辑内联,未独立 Hook 化 | 当前功能完整,若需复用可抽出 hook |
| `/teacher/attendance/*`sheet/stats/report | 独立 10+ 子组件(`attendance-sheet.tsx` / `attendance-trend-chart.tsx` / `attendance-report-print.tsx` / `attendance-warnings-card.tsx` / `attendance-grade-correlation-card.tsx` / `class-comparison-card.tsx` / `student-attendance-view.tsx` / `attendance-rules-form.tsx` / `attendance-stats-class-selector.tsx` / `attendance-record-list.tsx` / `attendance-page-layout.tsx` | 4 个 client 文件,子组件内联或缺失 | 缺趋势图、成绩相关性卡、预警卡、班级对比卡、打印、规则表单、记录列表等 | 至少补 `attendance-trend-chart` / `attendance-report-print` / `attendance-warnings-card` |
| `/teacher/error-book` | 13 个子组件(含 5 个图表 + 2 个对话框 + `grouped-student-error-table` / `subject-tabs` / `class-filter` / `review-buttons` / `error-book-item-card` / `error-book-list` | 仅 `error-book-list-client.tsx` 1 个 client无 components 子目录 | 图表与对话框全缺,列表能力退化 | 补齐图表组件与详情对话框 |
| `/teacher/textbooks/[id]` | 22 个组件(含知识图谱 9 个 + 教材阅读器 3 个 + 章节管理 2 个 + 知识点 2 个 + 表单 6 个)+ 8 个 hooks + `graph-layout.ts` | 仅 `textbook-detail-client.tsx` + `textbooks-list-client.tsx` + `transformations.ts`;图谱能力拆到独立 `knowledge-graph` feature仅 1 个 client | 阅读器、章节管理、知识点 CRUD、图谱交互层全缺 | 补齐教材阅读器与章节管理 |
| `/teacher/questions` | 12 个组件(`create-question-dialog` / `create-question-button` / `knowledge-point-selector` / `options-editor` / `question-bank-results-client` / `question-columns` / `question-data-table` 等) | 6 个组件(`batch-operations` / `import-export-buttons` / `question-actions` / `question-cascade-filter` / `question-content-renderer` / `index` | 缺题目创建对话框、知识点选择器、选项编辑器、题目数据表 | 补齐 `create-question-dialog` / `knowledge-point-selector` / `options-editor` / `question-data-table` |
| `/teacher/ai/*`3 页面) | 15+ 组件(`ai-assistant-widget` / `ai-chat-panel` / `ai-chat-input` / `ai-chat-messages` / `ai-chart-renderer` / `ai-markdown-renderer` / `ai-provider-selector` / `ai-usage-dashboard` / `ai-lesson-content-generator` / `ai-grading-assist` / `ai-error-book-analysis` / `ai-question-variant-generator` 等)+ context + 5 hooks + services | 仅 3 个 client`ai-assist-client.tsx` / `ai-lesson-plan-client.tsx` / `ai-report-client.tsx`+ `transformations.ts` | AI 聊天面板、图表渲染、Markdown 渲染、Provider 选择器、用量看板等全缺 | 至少补 `ai-chat-panel` / `ai-markdown-renderer` / `ai-provider-selector` / `ai-usage-dashboard` |
---
## 第三部分:每个模块的缺失组件清单
> 标注规则:✅ 已迁移;❌ 缺失;⚠️ 存在但简化/重命名;➖ 按架构设计未迁移Server Actions / data-access / schema 等非组件文件portal-shell 用 GraphQL hooks 替代)
### 3.1 exams 模块
#### 组件components/
| CICD 文件 | portal-shell 状态 | 备注 |
| ------------------------------------- | ----------------- | --------------------------- |
| `assembly/exam-paper-preview.tsx` | ❌ 缺失 | assembly/ 下未迁移此文件 |
| `assembly/question-bank-list.tsx` | ✅ 已迁移 | |
| `assembly/selected-question-list.tsx` | ✅ 已迁移 | |
| `assembly/structure-editor.tsx` | ✅ 已迁移 | |
| `exam-actions.tsx` | ✅ 已迁移 | |
| `exam-ai-generator.tsx` | ✅ 已迁移 | AI 出题 |
| `exam-analytics-dashboard.tsx` | ✅ 已迁移 | |
| `exam-assembly-config.tsx` | ✅ 已迁移 | |
| `exam-assembly-question-pool.tsx` | ✅ 已迁移 | |
| `exam-assembly-selected.tsx` | ✅ 已迁移 | |
| `exam-assembly.tsx` | ✅ 已迁移 | 试卷组装 |
| `exam-basic-info-form.tsx` | ✅ 已迁移 | |
| `exam-boundaries.tsx` | ❌ 缺失 | 分数边界组件 |
| `exam-card.tsx` | ✅ 已迁移 | |
| `exam-columns.tsx` | ❌ 缺失 | 表格列定义 |
| `exam-data-table.tsx` | ✅ 已迁移 | |
| `exam-form-types.ts` | ✅ 已迁移 | |
| `exam-form.tsx` | ✅ 已迁移 | |
| `exam-grid.tsx` | ✅ 已迁移 | |
| `exam-mode-selector.tsx` | ✅ 已迁移 | |
| `exam-preview-dialog.tsx` | ✅ 已迁移 | |
| `exam-preview-question-editor.tsx` | ✅ 已迁移 | |
| `exam-preview-utils.ts` | ✅ 已迁移 | |
| `exam-preview.tsx` | ✅ 已迁移 | |
| `exam-rich-form.tsx` | ⚠️ 简化 | contentEditable 替代 Tiptap |
| `exam-viewer.tsx` | ✅ 已迁移 | |
| `question-options-editor.tsx` | ✅ 已迁移 | |
| `question-sub-questions-editor.tsx` | ✅ 已迁移 | |
#### Tiptap 编辑器editor/)—— 整目录缺失17 文件)
`exam-rich-editor.tsx`(懒加载入口)/ `exam-rich-editor-inner.tsx`Tiptap 实现)/ `exam-rich-editor-types.ts` / `editor-to-structure.ts` / `structure-to-editor.ts` / `exam-nodes-to-editor-doc.ts` / `selection-toolbar.tsx` / `types.ts` / `index.ts` / `extensions/`blank-node / dotted-mark / group-block / image-node / index / question-block / section-block 共 7 文件)/ `utils/count-questions.ts` —— **全部 ❌ 缺失**
#### Hookshooks/)—— 整目录缺失4 文件)
`use-exam-preview.ts` / `use-exam-preview-rewrite.ts` / `use-exam-preview-state.ts` / `use-exam-preview-tasks.ts` —— **全部 ❌ 缺失**
#### AI Pipelineai-pipeline/)—— 整目录缺失5 文件)
`auto-mark.ts` / `index.ts` / `parse.ts` / `request.ts` / `structure.ts` —— **全部 ❌ 缺失**
#### Services / Config / Utils
`services/exam-service-context.tsx` / `services/exam-service-port.ts` / `services/index.ts` / `config/exam-widgets.ts` / `utils/exam-structure-tree.ts` / `utils/normalize-structure.ts` / `lib/type-guards.ts` —— **全部 ❌ 缺失**
#### 非组件文件(按架构设计未迁移)
`actions.ts` / `actions-helpers.ts` / `actions-rich-editor.ts` / `data-access.ts` / `data-access-cross-module.ts` / `data-access-error-collection.ts` / `stats-service.ts` / `types.ts` `lib/api/exams.ts` + `transformations.ts` 替代
### 3.2 grades 模块
#### 组件components/)—— 全部已迁移30+ 文件)
`batch-grade-entry.tsx` + 5 子组件dialog/selectors/stats/table/toolbar/ `class-comparison-chart.tsx` / `class-grade-report.tsx` / `draft-lock-banner.tsx` / `excel-import-dialog.tsx` / `export-button.tsx` / `grade-distribution-chart.tsx` / `grade-record-detail.tsx` / `grade-record-form.tsx` / `grade-record-list.tsx` / `grade-record-row.tsx` / `grade-trend-card.tsx` / `grade-trend-chart.tsx` / `growth-archive-chart.tsx` / `knowledge-point-mastery-chart.tsx` / `ranking-trend-card.tsx` / `report-card-print-action.tsx` / `report-card-print-button.tsx` / `report-card-view.tsx` / `school-wide-summary-card.tsx` / `score-cell.tsx` / `stats-class-selector.tsx` / `student-grade-summary.tsx` / `subject-comparison-chart.tsx` —— **全部 ✅ 已迁移**
#### Hooks / Lib
| CICD 文件 | portal-shell 状态 |
| -------------------------------------------- | ---------------------------------------- |
| `hooks/use-batch-grade-entry-undo.ts` | ⚠️ 内联到 `batch-grade-entry.tsx` |
| `hooks/use-draft-lock.ts` | ⚠️ 内联 |
| `lib/grade-utils.ts` | ❌ 缺失 |
| `lib/notify.ts` | ❌ 缺失(用 `@/shared/lib/notify` 替代) |
| `lib/report-card.ts` | ❌ 缺失 |
| `lib/scope-check.ts` / `lib/scope-filter.ts` | ❌ 缺失(权限范围校验) |
#### 非组件文件(按架构设计未迁移)
`actions*.ts`6 个)/ `data-access*.ts`10 个)/ `export.ts` / `import-export.ts` / `stats-service.ts` / `schema.ts` / `types.ts` `lib/api/grades.ts` 替代
### 3.3 homework 模块
#### 组件components/
| CICD 文件 | portal-shell 状态 | 备注 |
| ------------------------------------------------------ | ----------------- | ------------------------------ |
| `excellent-submissions.tsx` | ❌ 缺失 | 优秀提交展示 |
| `homework-assignment-exam-content-card.tsx` | ❌ 缺失 | 作业关联试卷内容卡 |
| `homework-assignment-exam-error-explorer.tsx` | ❌ 缺失 | 作业试卷错误探索 |
| `homework-assignment-exam-error-explorer-lazy.tsx` | ❌ 缺失 | 懒加载版本 |
| `homework-assignment-exam-preview-pane.tsx` | ❌ 缺失 | 作业试卷预览面板 |
| `homework-assignment-form.tsx` | ❌ 缺失 | 作业表单 |
| `homework-assignment-question-error-detail-panel.tsx` | ❌ 缺失 | 题目错误详情面板 |
| `homework-assignment-question-error-overview-card.tsx` | ❌ 缺失 | 题目错误概览卡 |
| `homework-batch-grading-view.tsx` | ✅ 已迁移 | 批量批改 |
| `homework-grading-panel.tsx` | ✅ 已迁移 | |
| `homework-grading-toolbar.tsx` | ✅ 已迁移 | |
| `homework-grading-view.tsx` | ✅ 已迁移 | |
| `homework-scan-grading-view.tsx` | ⚠️ 重命名 | 改为 `scan-grading-client.tsx` |
| `homework-submission-result.tsx` | ✅ 已迁移 | |
| `homework-take-confirm-dialog.tsx` | ✅ 已迁移 | |
| `homework-take-question.tsx` | ✅ 已迁移 | |
| `homework-take-sidebar.tsx` | ✅ 已迁移 | |
| `homework-take-toolbar.tsx` | ✅ 已迁移 | |
| `homework-take-view.tsx` | ✅ 已迁移 | |
| `question-renderer.tsx` | ✅ 已迁移 | |
| `scan-image-viewer.tsx` | ✅ 已迁移 | |
| `scan-uploader.tsx` | ✅ 已迁移 | |
| `student-homework-review-view.tsx` | ❌ 缺失 | 学生作业复习视图 |
#### 非组件文件(按架构设计未迁移)
`actions.ts` / `data-access*.ts`7 个)/ `stats-service.ts` / `schema.ts` / `types.ts` `lib/api/homework.ts` 替代
### 3.4 lesson-plans 模块CICD: lesson-preparation
#### 组件 —— 大部分已迁移,编辑器简化
| CICD 文件 | portal-shell 状态 | 备注 |
| ---------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `paper-editor/paper-editor.tsx` | ⚠️ 简化 | contentEditable 替代 Tiptap |
| `paper-editor/textbook-tiptap-editor.tsx` | ❌ 缺失 | Tiptap 编辑器 |
| `paper-editor/paper-toolbar.tsx` | ✅ 已迁移 | |
| `paper-editor/paper-context-menu.tsx` | ✅ 已迁移 | |
| `paper-editor/inline-node.tsx` | ✅ 已迁移 | |
| `paper-editor/inline-qa-dialog.tsx` | ✅ 已迁移 | |
| `blocks/` 目录14 个块组件) | ✅ 已迁移 | objective/exercise/homework/import/interaction/key-point/new-teaching/reflection/rich-text/summary/text-study/blackboard + types + type-guards |
| `detail-panel/` 目录5 个文件) | ✅ 已迁移 | detail-head/panel/props/qa-editor |
| `structure-tree/` 目录2 个文件) | ✅ 已迁移 | structure-tree/tree-node-row |
| `ai-feedback-dialog.tsx` | ✅ 已迁移 | AI 反馈 |
| `ai-differentiation-dialog.tsx` | ✅ 已迁移 | |
| `anchor-migration-banner.tsx` | ✅ 已迁移 | |
| `attachment-picker.tsx` | ✅ 已迁移 | |
| `consistency-check-dialog.tsx` | ✅ 已迁移 | |
| `inline-question-editor.tsx` | ✅ 已迁移 | |
| `knowledge-point-picker.tsx` | ✅ 已迁移 | |
| `lesson-plan-calendar-client.tsx` | ✅ 已迁移 | 日历视图 |
| `lesson-plan-card.tsx` | ✅ 已迁移 | |
| `lesson-plan-dialogs.tsx` | ✅ 已迁移 | |
| `lesson-plan-edit-client.tsx` | ✅ 已迁移 | |
| `lesson-plan-heatmap-client.tsx` | ✅ 已迁移 | 热力图 |
| `lesson-plan-library-client.tsx` | ✅ 已迁移 | |
| `lesson-plan-list-client.tsx` | ✅ 已迁移 | |
| `lesson-plan-mobile-view.tsx` | ✅ 已迁移 | |
| `lesson-plan-outline-tree.tsx` | ✅ 已迁移 | |
| `lesson-plan-publish-button.tsx` | ✅ 已迁移 | |
| `lesson-plan-readonly-view.tsx` | ✅ 已迁移 | |
| `lesson-plan-toolbar.tsx` | ✅ 已迁移 | |
| `new-lesson-plan-client.tsx` | ✅ 已迁移 | |
| `version-diff-view.tsx` / `version-diff-viewer.tsx` / `version-history-drawer.tsx` | ✅ 已迁移 | 版本对比 |
#### 非组件文件(按架构设计未迁移)
`actions*.ts`12 个)/ `data-access*.ts`13 个)/ `publish-service.ts` / `ai-suggest.ts` / `seed-templates.ts` / `constants.ts` / `schema.ts` / `types.ts` `lib/api/lesson-plans.ts` 替代
### 3.5 attendance 模块
#### 组件components/)—— 大量缺失
| CICD 文件 | portal-shell 状态 | 备注 |
| --------------------------------------- | ----------------- | ------------------ |
| `attendance-grade-correlation-card.tsx` | ❌ 缺失 | 考勤成绩相关性卡 |
| `attendance-page-layout.tsx` | ❌ 缺失 | 页面布局 |
| `attendance-record-list.tsx` | ❌ 缺失 | 记录列表 |
| `attendance-report-print.tsx` | ❌ 缺失 | 报告打印 |
| `attendance-rules-form.tsx` | ❌ 缺失 | 规则表单 |
| `attendance-sheet.tsx` | ❌ 缺失 | 考勤表(独立组件) |
| `attendance-stats-class-selector.tsx` | ❌ 缺失 | 统计班级选择器 |
| `attendance-trend-chart.tsx` | ❌ 缺失 | 趋势图 |
| `attendance-warnings-card.tsx` | ❌ 缺失 | 预警卡 |
| `class-comparison-card.tsx` | ❌ 缺失 | 班级对比卡 |
| `student-attendance-view.tsx` | ❌ 缺失 | 学生考勤视图 |
#### portal-shell 已有
`attendance-list-client.tsx` / `attendance-sheet-client.tsx` / `attendance-stats-client.tsx` / `attendance-report-client.tsx` / `transformations.ts`4 个 client 整合了部分能力,但子组件未拆分)
#### 非组件文件(按架构设计未迁移)
`actions.ts` / `data-access*.ts`3 个)/ `correlation-compute.ts` / `trend-compute.ts` / `warning-compute.ts` / `export.ts` / `notifications.ts` / `constants.ts` / `schema.ts` / `types.ts` 部分计算逻辑(`trend-compute` / `warning-compute` / `correlation-compute`)应迁入 `transformations.ts`
### 3.6 classes 模块
#### 组件 —— 全部已迁移
| CICD 文件 | portal-shell 状态 |
| ---------------------------------------------------------------------------------------- | ----------------------------------- |
| `class-detail/` 目录7 个 widget + edit-class-dialog | ✅ 已迁移 |
| `class-delete-dialog.tsx` | ✅ 已迁移 |
| `class-form-dialog.tsx` | ❌ 缺失(合并入 edit-class-dialog |
| `class-form-utils.ts` | ❌ 缺失 |
| `class-invitation-manager.tsx` | ✅ 已迁移 |
| `class-list-table.tsx` | ✅ 已迁移 |
| `class-list-toolbar.tsx` | ✅ 已迁移 |
| `admin-classes-view.tsx` | 管理员视图(非教师域) |
| `grade-classes-view.tsx` | 年级视图(非教师域) |
| `my-classes-grid.tsx` | ✅ 已迁移 |
| `schedule-create-dialog.tsx` / `schedule-delete-dialog.tsx` / `schedule-edit-dialog.tsx` | ✅ 已迁移 |
| `schedule-utils.ts` | ✅ 已迁移 |
| `schedule-view.tsx` | ✅ 已迁移 |
| `students-table.tsx` | ✅ 已迁移 |
#### Hooks / Lib
| CICD 文件 | portal-shell 状态 |
| ---------------------------- | ------------------------- |
| `hooks/use-class-data.ts` | ❌ 缺失 |
| `hooks/use-class-filters.ts` | ❌ 缺失 |
| `lib/admin-class-mappers.ts` | 管理员映射(非教师域) |
### 3.7 diagnostic 模块
#### 组件 / Services
| CICD 文件 | portal-shell 状态 | 备注 |
| ------------------------------------------ | ----------------- | ---------------------------------------------------- |
| `components/class-diagnostic-view.tsx` | ⚠️ 整合 | portal-shell 用 `diagnostic-class-detail-client.tsx` |
| `components/student-diagnostic-view.tsx` | ⚠️ 整合 | portal-shell 用 `student-diagnostic-client.tsx` |
| `components/confidence-utils.ts` | ❌ 缺失 | 置信度工具 |
| `components/mastery-radar-chart.tsx` | ❌ 缺失 | 掌握度雷达图 |
| `components/report-list.tsx` | ❌ 缺失 | 报告列表 |
| `services/default-diagnostic-service.ts` | ❌ 缺失 | |
| `services/diagnostic-monitor-context.tsx` | ❌ 缺失 | |
| `services/diagnostic-monitor.ts` | ❌ 缺失 | |
| `services/diagnostic-service-context.tsx` | ❌ 缺失 | |
| `services/diagnostic-service.ts` | ❌ 缺失 | |
| `services/monitored-diagnostic-service.ts` | ❌ 缺失 | |
#### 非组件文件(按架构设计未迁移)
`actions.ts` / `data-access*.ts`2 个)/ `export.ts` / `role-config.ts` / `stats-service.ts` / `schema.ts` / `types.ts` `lib/api/diagnostic.ts` 替代
### 3.8 elective 模块
#### 组件
| CICD 文件 | portal-shell 状态 | 备注 |
| ---------------------------- | ----------------------- | ------------------------------------------------------------------------- |
| `elective-course-detail.tsx` | ❌ 缺失 | 课程详情 |
| `elective-course-form.tsx` | ⚠️ 整合 | portal-shell 用 `elective-create-client.tsx` / `elective-edit-client.tsx` |
| `elective-course-list.tsx` | ⚠️ 整合 | portal-shell 用 `elective-list-client.tsx` |
| `elective-page-layout.tsx` | ❌ 缺失 | 页面布局 |
| `parent-selection-view.tsx` | 家长视图(非教师域) |
| `student-selection-view.tsx` | 学生视图(非教师域) |
#### Lib
| CICD 文件 | portal-shell 状态 |
| -------------------------- | ----------------------- |
| `lib/lottery.ts` | ❌ 缺失(抽签算法) |
| `lib/schedule-conflict.ts` | ❌ 缺失(课表冲突检测) |
### 3.9 error-book 模块
#### 组件components/)—— 几乎全缺
| CICD 文件 | portal-shell 状态 | 备注 |
| ------------------------------------ | ----------------- | ---------------------------------- |
| `add-error-book-dialog.tsx` | ❌ 缺失 | 添加错题对话框 |
| `chapter-weakness-chart.tsx` | ❌ 缺失 | 章节薄弱图 |
| `class-error-bar-chart.tsx` | ❌ 缺失 | 班级错题柱状图 |
| `class-filter.tsx` | ❌ 缺失 | 班级筛选 |
| `error-book-detail-dialog.tsx` | ❌ 缺失 | 错题详情对话框 |
| `error-book-item-card.tsx` | ❌ 缺失 | 错题卡片 |
| `error-book-list.tsx` | ❌ 缺失 | 列表portal-shell 内联到 client |
| `grouped-student-error-table.tsx` | ❌ 缺失 | 分组学生错题表 |
| `knowledge-point-weakness-chart.tsx` | ❌ 缺失 | 知识点薄弱图 |
| `review-buttons.tsx` | ❌ 缺失 | 复习按钮 |
| `subject-distribution-chart.tsx` | ❌ 缺失 | 学科分布图 |
| `subject-tabs.tsx` | ❌ 缺失 | 学科 Tab |
| `top-wrong-questions.tsx` | ❌ 缺失 | 高频错题 |
#### portal-shell 已有
`error-book-list-client.tsx` + `transformations.ts`
#### 非组件文件(按架构设计未迁移)
`actions.ts` / `data-access*.ts`3 个)/ `sm2-algorithm.ts`SM2 复习算法)/ `schema.ts` / `types.ts` `sm2-algorithm.ts` 是核心算法,建议迁入 `transformations.ts` 或独立 lib
### 3.10 course-plans 模块
#### 组件components/)—— 全缺
| CICD 文件 | portal-shell 状态 | 备注 |
| ----------------------------- | ----------------- | ----------------------------------------------- |
| `course-plan-calendar.tsx` | ❌ 缺失 | 日历组件 |
| `course-plan-detail.tsx` | ⚠️ 整合 | portal-shell 用 `course-plan-detail-client.tsx` |
| `course-plan-form.tsx` | ❌ 缺失 | 表单 |
| `course-plan-item-editor.tsx` | ❌ 缺失 | 条目编辑器 |
| `course-plan-list.tsx` | ⚠️ 整合 | portal-shell 用 `course-plan-list-client.tsx` |
| `course-plan-progress.tsx` | ❌ 缺失 | 进度组件 |
| `sortable-week-row.tsx` | ❌ 缺失 | 可排序周行 |
| `template-picker-dialog.tsx` | ❌ 缺失 | 模板选择对话框 |
#### Lib
| CICD 文件 | portal-shell 状态 |
| ----------------------- | ----------------- |
| `lib/calendar-utils.ts` | ❌ 缺失 |
| `lib/export-utils.ts` | ❌ 缺失 |
| `lib/track-event.ts` | ❌ 缺失 |
### 3.11 leave-requests 模块portal-shell: leave
#### 组件
| CICD 文件 | portal-shell 状态 | 备注 |
| ------------------------- | ----------------- | --------------------------------------- |
| `leave-request-form.tsx` | ❌ 缺失 | 请假表单 |
| `leave-request-list.tsx` | ⚠️ 整合 | portal-shell 用 `leave-list-client.tsx` |
| `leave-review-dialog.tsx` | ❌ 缺失 | 审批对话框 |
| `leave-review-list.tsx` | ❌ 缺失 | 审批列表 |
### 3.12 questions 模块
#### 组件components/
| CICD 文件 | portal-shell 状态 | 备注 |
| ---------------------------------- | ----------------- | -------------- |
| `batch-operations.tsx` | ✅ 已迁移 | |
| `create-question-button.tsx` | ❌ 缺失 | 创建题目按钮 |
| `create-question-dialog.tsx` | ❌ 缺失 | 创建题目对话框 |
| `import-export-buttons.tsx` | ✅ 已迁移 | |
| `knowledge-point-selector.tsx` | ❌ 缺失 | 知识点选择器 |
| `options-editor.tsx` | ❌ 缺失 | 选项编辑器 |
| `question-actions.tsx` | ✅ 已迁移 | |
| `question-bank-results-client.tsx` | ❌ 缺失 | 题库结果客户端 |
| `question-cascade-filter.tsx` | ✅ 已迁移 | |
| `question-columns.tsx` | ❌ 缺失 | 表格列定义 |
| `question-content-renderer.tsx` | ✅ 已迁移 | |
| `question-data-table.tsx` | ❌ 缺失 | 题目数据表 |
#### Utils
| CICD 文件 | portal-shell 状态 |
| ------------------------ | ----------------- |
| `utils/parse-content.ts` | ❌ 缺失 |
| `utils/track-event.ts` | ❌ 缺失 |
### 3.13 textbooks 模块
#### 组件components/)—— 几乎全缺
| CICD 文件 | portal-shell 状态 | 备注 |
| ------------------------------ | ----------------- | ---------------- |
| `chapter-sidebar-list.tsx` | ❌ 缺失 | 章节侧边栏 |
| `create-chapter-dialog.tsx` | ❌ 缺失 | 创建章节对话框 |
| `force-graph.tsx` | ❌ 缺失 | 力导向图 |
| `graph-kp-node.tsx` | ❌ 缺失 | 图谱知识点节点 |
| `graph-node-detail-panel.tsx` | ❌ 缺失 | 图谱节点详情面板 |
| `graph-prerequisite-edge.tsx` | ❌ 缺失 | 图谱前置依赖边 |
| `graph-toolbar.tsx` | ❌ 缺失 | 图谱工具栏 |
| `knowledge-graph-controls.tsx` | ❌ 缺失 | 图谱控制 |
| `knowledge-graph-inner.tsx` | ❌ 缺失 | 图谱内部 |
| `knowledge-graph-node.tsx` | ❌ 缺失 | 图谱节点 |
| `knowledge-graph.tsx` | ❌ 缺失 | 图谱主组件 |
| `knowledge-point-dialogs.tsx` | ❌ 缺失 | 知识点对话框 |
| `knowledge-point-list.tsx` | ❌ 缺失 | 知识点列表 |
| `textbook-card.tsx` | ❌ 缺失 | 教材卡片 |
| `textbook-content-panel.tsx` | ❌ 缺失 | 教材内容面板 |
| `textbook-form-dialog.tsx` | ❌ 缺失 | 教材表单对话框 |
| `textbook-form-fields.tsx` | ❌ 缺失 | 教材表单字段 |
| `textbook-reader-content.tsx` | ❌ 缺失 | 阅读器内容 |
| `textbook-reader-toc.tsx` | ❌ 缺失 | 阅读器目录 |
| `textbook-reader.tsx` | ❌ 缺失 | 阅读器主组件 |
| `textbook-settings-dialog.tsx` | ❌ 缺失 | 教材设置对话框 |
#### Hookshooks/)—— 全缺
`use-graph-data.ts` / `use-knowledge-point-actions.ts` / `use-kp-create.ts` / `use-kp-crud.ts` / `use-kp-delete.ts` / `use-kp-dialog-state.ts` / `use-kp-update.ts` / `use-text-selection.ts` —— **全部 ❌ 缺失**
#### Lib / Utils
| CICD 文件 | portal-shell 状态 |
| -------------------- | ----------------------- |
| `lib/type-guards.ts` | ❌ 缺失 |
| `graph-layout.ts` | ❌ 缺失(图谱布局算法) |
| `utils.ts` | ❌ 缺失 |
| `analytics.tsx` | ❌ 缺失 |
| `constants.ts` | ❌ 缺失 |
#### portal-shell 已有
`textbook-detail-client.tsx` + `textbooks-list-client.tsx` + `transformations.ts`;图谱能力拆到独立 `knowledge-graph` feature`knowledge-graph-client.tsx` + `transformations.ts`
### 3.14 ai 模块
#### 组件components/)—— 大量缺失
| CICD 文件 | portal-shell 状态 | 备注 |
| ------------------------------------------------------------------ | --------------------- | --------------- |
| `ai-assistant-widget.tsx` / `ai-assistant-widget-inner.tsx` | ❌ 缺失 | AI 助手浮窗 |
| `ai-chart-renderer.tsx` | ❌ 缺失 | 图表渲染 |
| `ai-chat-input.tsx` / `ai-chat-messages.tsx` / `ai-chat-panel.tsx` | ❌ 缺失 | 聊天面板三件套 |
| `ai-child-summary.tsx` | 家长域(非教师域) |
| `ai-error-book-analysis.tsx` | ❌ 缺失 | 错题分析 |
| `ai-grading-assist.tsx` | ❌ 缺失 | 批改助手 |
| `ai-lesson-content-generator.tsx` | ❌ 缺失 | 教案内容生成 |
| `ai-markdown-renderer.tsx` | ❌ 缺失 | Markdown 渲染 |
| `ai-provider-selector.tsx` | ❌ 缺失 | Provider 选择器 |
| `ai-question-variant-generator.tsx` | ❌ 缺失 | 题目变体生成 |
| `ai-study-path.tsx` | 学生域(非教师域) |
| `ai-usage-dashboard.tsx` | ❌ 缺失 | 用量看板 |
#### Context / Hooks / Services
| CICD 文件 | portal-shell 状态 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
| `context/ai-client-provider.tsx` | ❌ 缺失 |
| `context/create-ai-client-service.ts` | ❌ 缺失 |
| `hooks/stream-utils.ts` / `use-ai-chat-stream.ts` / `use-ai-suggestion.ts` / `use-drag-position.ts` / `use-floating-ball.ts` / `use-position-persistence.ts` | ❌ 缺失 |
| `services/ai-service.ts` / `content-safety.ts` / `prompt-templates.ts` / `usage-tracker.ts` | ❌ 缺失 |
#### portal-shell 已有
`ai-assist-client.tsx` / `ai-lesson-plan-client.tsx` / `ai-report-client.tsx` / `transformations.ts`3 个 client 是页面级整合,但底层聊天/流式/Provider 能力全缺)
### 3.15 proctoring 模块CICD 独立模块portal-shell 并入 exams
| CICD 文件 | portal-shell 状态 | 备注 |
| -------------------------------------------- | ---------------------------------- | -------------------------------------------------- |
| `components/anti-cheat-monitor.tsx` | ❌ 缺失 | 反作弊监控 |
| `components/exam-mode-config.tsx` | ❌ 缺失 | 考试模式配置 |
| `components/proctoring-dashboard.tsx` | ⚠️ 整合 | portal-shell 用 `exams/proctoring-client.tsx` 替代 |
| `actions.ts` / `data-access.ts` / `types.ts` | `lib/api/proctoring.ts` 替代 |
### 3.16 adaptive-practice 模块CICD 有portal-shell 并入 practice
#### 组件 —— 全缺
`answer-input.tsx` / `answer-result.tsx` / `question-card.tsx` / `question-content.tsx`(答题核心)/ `class-knowledge-point-weakness-chart.tsx` / `class-practice-comparison-table.tsx` / `inactive-students-alert.tsx` / `practice-type-breakdown-chart.tsx` / `student-practice-ranking-table.tsx`(教师域分析图表)/ `practice-history.tsx` / `practice-result-view.tsx` / `practice-session-view.tsx` / `practice-starter.tsx` / `practice-starter-with-nav.tsx`(练习流程)/ `services/practice-service.tsx` / `lib/answer-utils.ts` / `lib/errors.ts` / `lib/grading.ts` / `lib/source-meta.ts` / `lib/type-guards.ts` —— **全部 ❌ 缺失**
#### portal-shell 已有
`practice/practice-list-client.tsx` + `transformations.ts`(仅列表页,练习流程与分析图表全缺)
### 3.17 dashboard 模块teacher-dashboard 子目录)
| CICD 文件 | portal-shell 状态 | 备注 |
| ---------------------------------------------- | ----------------- | --------------------------------------- |
| `teacher-dashboard/recent-submissions.tsx` | ❌ 缺失 | 最近提交 |
| `teacher-dashboard/teacher-classes-card.tsx` | ❌ 缺失 | 班级卡 |
| `teacher-dashboard/teacher-dashboard-view.tsx` | ⚠️ 整合 | portal-shell 内联到 `/teacher/page.tsx` |
| `teacher-dashboard/teacher-grade-trends.tsx` | ❌ 缺失 | 成绩趋势卡 |
| `teacher-dashboard/teacher-homework-card.tsx` | ❌ 缺失 | 作业卡 |
| `teacher-dashboard/teacher-quick-actions.tsx` | ❌ 缺失 | 快捷操作 |
| `teacher-dashboard/teacher-schedule.tsx` | ❌ 缺失 | 课表卡 |
| `teacher-dashboard/teacher-todo-card.tsx` | ❌ 缺失 | 待办卡 |
portal-shell 的 `/teacher/page.tsx``useTeacherDashboard` 接 data-ana 真实聚合查询,但仅展示 4 个 StatCard + 班级概览 + 预警,缺上述 7 个子组件卡片。
---
## 第四部分:核心功能完整性检查结果
### 4.1 exams 模块4 项)
| 核心功能 | 完整性 | 详细说明 |
| ------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Tiptap 富文本编辑器exam-rich-editor** | ❌ **不完整** | portal-shell `exam-rich-form.tsx``contentEditable` + `document.execCommand` 替代 Tiptap。CICD 的整个 `editor/` 目录17 个文件,含 7 个 Tiptap 扩展节点、双向转换、选区工具栏)未迁移。`/teacher/exams/[id]/edit` 路由对应 CICD 的 `edit-rich`,但实现退化。**影响**:无法支持试卷的题块/分节/分组/填空下划线/打点标记等结构化编辑 |
| **AI 出题exam-ai-generator** | ✅ **完整** | `exam-ai-generator.tsx` 已迁移,改为 prop-driven原版依赖 react-hook-form Control。AI Provider 选择、预览、后台任务列表能力保留 |
| **试卷组装exam-assembly** | ⚠️ **简化** | `exam-assembly.tsx` + `exam-assembly-config.tsx` + `exam-assembly-question-pool.tsx` + `exam-assembly-selected.tsx` + `assembly/` 3 子组件已迁移;但 `exam-build-client.tsx` 全 MSW 兜底(`@contract-pending``exam-boundaries.tsx` / `exam-columns.tsx` 缺失,`hooks/use-exam-preview*.ts`4 个)缺 |
| **监考proctoring** | ⚠️ **简化** | `proctoring-client.tsx` 存在(三栏布局:考试信息/学生状态/事件流),但用 5s 轮询模拟 WS 实时推送。CICD 独立 `proctoring` 模块的 `anti-cheat-monitor.tsx` / `exam-mode-config.tsx` 未迁移 |
### 4.2 grades 模块3 项)
| 核心功能 | 完整性 | 详细说明 |
| --------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **批量录入batch-grade-entry** | ✅ **完整** | `batch-grade-entry.tsx` + 5 子组件dialog/selectors/stats/table/toolbar全部迁移。undo hook 内联为本地 token + `useUndoGradeEntry` 调用(功能保留) |
| **Excel 导入** | ✅ **完整** | `excel-import-dialog.tsx` 已迁移,用 `useDownloadGradeImportTemplate` + `useImportGradesFromExcel` hooks 替代 Server Actions。原生元素替代 shadcn Dialog/Select |
| **报表打印report-card-print** | ✅ **完整** | `report-card-print-action.tsx` + `report-card-print-button.tsx` + `report-card-view.tsx` + `report-card-client.tsx` 全部迁移 |
### 4.3 homework 模块2 项)
| 核心功能 | 完整性 | 详细说明 |
| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **扫描批改scan-grading** | ⚠️ **简化** | `scan-grading-client.tsx`(重命名自 `homework-scan-grading-view.tsx`)存在,三栏布局保留,但 `@contract-pending` MSW 兜底。`scan-image-viewer.tsx` + `scan-uploader.tsx` 已迁移 |
| **批量批改batch-grading** | ✅ **完整** | `homework-batch-grading-view.tsx` 已迁移,用 `useBatchAutoGrade` hook 替代 Server Action原生 table + input 替代 shadcn Table/Checkbox |
### 4.4 lesson-plans 模块5 项)
| 核心功能 | 完整性 | 详细说明 |
| ------------------------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **教案编辑器lesson-plan-editor** | ❌ **不完整** | `paper-editor.tsx``contentEditable` 替代 Tiptap见文件头注释`textbook-tiptap-editor.tsx` 未迁移。blocks/ 目录 14 个块组件已迁移,但编辑器内核退化。**影响**:复杂块级结构编辑能力受限 |
| **AI 反馈ai-feedback** | ✅ **完整** | `ai-feedback-dialog.tsx` 已迁移,改为 prop-driven原版依赖 `useLessonPlanAi` hook`ai-differentiation-dialog.tsx` 也已迁移 |
| **版本对比version-diff** | ✅ **完整** | `version-diff-viewer.tsx` + `version-diff-view.tsx` + `version-history-drawer.tsx` 全部迁移 |
| **日历视图calendar** | ✅ **完整** | `lesson-plan-calendar-client.tsx` 已迁移 |
| **热力图heatmap** | ✅ **完整** | `lesson-plan-heatmap-client.tsx` 已迁移 |
### 4.5 attendance 模块3 项)
| 核心功能 | 完整性 | 详细说明 |
| ------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **考勤表sheet** | ⚠️ **简化** | `attendance-sheet-client.tsx` 存在,但 CICD 独立 `attendance-sheet.tsx` 组件未迁移(能力内联或缺失) |
| **统计stats** | ⚠️ **简化** | `attendance-stats-client.tsx` 存在,但 `attendance-trend-chart.tsx` / `attendance-stats-class-selector.tsx` / `class-comparison-card.tsx` / `attendance-grade-correlation-card.tsx` 未迁移 |
| **报告report** | ⚠️ **简化** | `attendance-report-client.tsx` 存在,但 `attendance-report-print.tsx`(打印)/ `attendance-warnings-card.tsx`(预警)未迁移 |
### 4.6 classes 模块3 项)
| 核心功能 | 完整性 | 详细说明 |
| ------------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **班级详情** | ✅ **完整** | `class-detail-client.tsx` + `class-detail/` 7 个 widgetheader/overview-stats/quick-actions/schedule-widget/students-widget/assignments-widget/trends-widget全部迁移 |
| **学生管理** | ✅ **完整** | `students-table.tsx` 已迁移 |
| **课表** | ✅ **完整** | `class-schedule-client.tsx` + `schedule-view.tsx` + 3 个 schedule dialogcreate/edit/delete+ `schedule-utils.ts` 全部迁移 |
### 4.7 diagnostic 模块2 项)
| 核心功能 | 完整性 | 详细说明 |
| ------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| **班级诊断** | ⚠️ **简化** | `diagnostic-class-detail-client.tsx` 存在,但 CICD `class-diagnostic-view.tsx` / `mastery-radar-chart.tsx`(掌握度雷达图)/ `report-list.tsx` 未迁移 |
| **学生诊断** | ⚠️ **简化** | `student-diagnostic-client.tsx` + `student-diagnostic-transformations.ts` 存在,但 `student-diagnostic-view.tsx` 独立组件未迁移 |
### 4.8 ai 模块3 项)
| 核心功能 | 完整性 | 详细说明 |
| ----------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **AI 助教** | ⚠️ **简化** | `ai-assist-client.tsx` 存在(页面级),但 CICD `ai-assistant-widget` / `ai-chat-panel` / `ai-chat-input` / `ai-chat-messages` / `ai-markdown-renderer` / `ai-provider-selector` 等底层组件全缺,流式聊天能力缺失(`use-ai-chat-stream` / `stream-utils` 未迁移) |
| **AI 报告** | ⚠️ **简化** | `ai-report-client.tsx` 存在(页面级),但 `ai-chart-renderer.tsx` / `ai-usage-dashboard.tsx` 未迁移 |
| **AI 教案** | ⚠️ **简化** | `ai-lesson-plan-client.tsx` 存在(页面级),但 `ai-lesson-content-generator.tsx` 未迁移 |
### 4.9 核心功能完整性汇总
| 完整性 | 数量 | 功能列表 |
| --------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ✅ 完整 | 10 项 | exams AI 出题、grades 批量录入、grades Excel 导入、grades 报表打印、homework 批量批改、lesson-plans AI 反馈、lesson-plans 版本对比、lesson-plans 日历视图、lesson-plans 热力图、classes详情/学生/课表 3 项) |
| ⚠️ 简化 | 11 项 | exams 试卷组装、exams 监考、homework 扫描批改、attendance考勤表/统计/报告 3 项、diagnostic班级/学生 2 项、ai助教/报告/教案 3 项) |
| ❌ 不完整 | 2 项 | **exams Tiptap 富文本编辑器**、**lesson-plans 教案编辑器** |
---
## 第五部分:迁移优先级建议
### P0阻断核心教学流程建议优先补全
1. **exams Tiptap 富文本编辑器**:迁移 `editor/` 全目录17 文件)+ `@tiptap/*` 依赖,恢复试卷结构化编辑能力。涉及 7 个自定义节点扩展blank-node / dotted-mark / group-block / image-node / question-block / section-block+ 双向转换 + 选区工具栏
2. **lesson-plans Tiptap 编辑器**:迁移 `textbook-tiptap-editor.tsx`,恢复教案块级编辑能力。当前 `paper-editor.tsx` 用 contentEditable 退化blocks/ 14 个块组件已就绪但内核简化
3. **attendance 趋势图与预警卡**:补 `attendance-trend-chart.tsx` / `attendance-warnings-card.tsx` / `attendance-report-print.tsx`,恢复考勤统计可视化与打印
### P1影响功能完整性
4. **error-book 图表与对话框**:补 5 个图表组件(`chapter-weakness-chart` / `class-error-bar-chart` / `knowledge-point-weakness-chart` / `subject-distribution-chart` / `top-wrong-questions`+ 2 个对话框 + `sm2-algorithm.ts` 复习算法
5. **questions 创建与编辑**:补 `create-question-dialog.tsx` / `knowledge-point-selector.tsx` / `options-editor.tsx` / `question-data-table.tsx`,恢复题目 CRUD 完整流程
6. **textbooks 阅读器与章节管理**:补 `textbook-reader*.tsx`3 个)/ `chapter-sidebar-list.tsx` / `create-chapter-dialog.tsx`,恢复教材阅读与章节管理
7. **ai 聊天面板与流式**:补 `ai-chat-panel` 三件套input/messages/panel+ `ai-markdown-renderer` + `use-ai-chat-stream` + `ai-provider-selector`,恢复 AI 流式聊天能力
### P2增强体验
8. **proctoring 反作弊**:补 `anti-cheat-monitor.tsx` / `exam-mode-config.tsx`WS 契约就绪后改接实时推送(当前 5s 轮询)
9. **diagnostic 雷达图**:补 `mastery-radar-chart.tsx` / `confidence-utils.ts` / `report-list.tsx`
10. **dashboard 教师卡片**:补 7 个 teacher-dashboard 子组件卡片recent-submissions / teacher-classes-card / teacher-grade-trends / teacher-homework-card / teacher-quick-actions / teacher-schedule / teacher-todo-card
11. **course-plans 表单与日历**:补 `course-plan-form.tsx` / `course-plan-calendar.tsx` / `sortable-week-row.tsx` / `template-picker-dialog.tsx` / `course-plan-item-editor.tsx` / `course-plan-progress.tsx`
12. **homework 试卷关联**:补 `homework-assignment-exam-*`5 个文件)/ `homework-assignment-form.tsx` / `excellent-submissions.tsx` / `student-homework-review-view.tsx`
### P3按需补全
13. **adaptive-practice 练习流程**补答题核心组件answer-input / answer-result / question-card / question-content与教师分析图表5 个)
14. **leave-requests 审批**:补 `leave-review-dialog.tsx` / `leave-review-list.tsx` / `leave-request-form.tsx`
15. **elective 抽签与冲突检测**:补 `lib/lottery.ts` / `lib/schedule-conflict.ts` / `elective-course-detail.tsx` / `elective-page-layout.tsx`
16. **exams 辅助**:补 `exam-boundaries.tsx` / `exam-columns.tsx` / `hooks/use-exam-preview*.ts`4 个)/ `ai-pipeline/`5 个)/ `services/`3 个)
---
## 附录:架构差异说明
### A.1 数据层架构差异(非缺失)
CICD 采用 Next.js Server Actions 模式,每个模块包含:
- `actions.ts` / `actions-*.ts`Server Actions 入口
- `data-access.ts` / `data-access-*.ts`:数据访问层
- `schema.ts`Zod 验证
- `types.ts`:类型定义
portal-shell 采用 GraphQL hooks 模式,对应能力由:
- `src/lib/api/{module}.ts`GraphQL 查询/mutation hooks`useXxx`
- `src/lib/api/operations/{module}.graphql.ts`GraphQL operations
- `src/features/teacher/{module}/transformations.ts`:数据转换与纯函数
承担。本报告对 `actions*.ts` / `data-access*.ts` / `schema.ts` / `types.ts` 这类非组件文件**不予标记为缺失**,除非包含核心算法(如 `sm2-algorithm.ts` / `graph-layout.ts` / `trend-compute.ts` / `warning-compute.ts` / `correlation-compute.ts` / `lottery.ts` / `schedule-conflict.ts`)。
### A.2 路由结构差异
- CICD`src/app/(dashboard)/teacher/`(路由组 `(dashboard)`
- portal-shell`src/app/shell/teacher/`(路由组 `shell`
路由组差异不影响实际路径,`/teacher/*` 路径在两端一致。
### A.3 共享组件差异
CICD 使用 shadcn/ui 组件库Dialog/Select/Table/Checkbox/ScrollArea/ResizablePanel 等portal-shell 部分组件用原生 HTML 元素替代(见各文件头注释:"使用原生元素替代")。这是 portal-shell 的适配策略,不标记为缺失。
### A.4 核心算法文件迁移建议
以下 CICD 非组件文件包含核心业务算法,建议迁入 portal-shell 对应模块的 `transformations.ts` 或独立 lib
| CICD 文件 | 所属模块 | 建议迁移目标 |
| -------------------------------------------------------------------- | ---------- | -------------------------------------------------------- |
| `sm2-algorithm.ts` | error-book | `features/teacher/error-book/lib/sm2-algorithm.ts` |
| `graph-layout.ts` | textbooks | `features/teacher/knowledge-graph/lib/graph-layout.ts` |
| `trend-compute.ts` / `warning-compute.ts` / `correlation-compute.ts` | attendance | `features/teacher/attendance/transformations.ts`(合并) |
| `lottery.ts` / `schedule-conflict.ts` | elective | `features/teacher/elective/lib/` |
| `ai-pipeline/`5 文件) | exams | `features/teacher/exams/lib/ai-pipeline/` |
| `lib/scope-check.ts` / `lib/scope-filter.ts` | grades | `features/teacher/grades/lib/` |
---
**报告结束。后续迁移工作请基于本报告的"第三部分:每个模块的缺失组件清单"与"第五部分:迁移优先级建议"执行。**