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,229 @@
# portal-shell 全角色模块页面核查汇总2026-08-04
> 核查日期2026-08-04
> 核查范围:教师、学生、家长、管理员四个角色域全部页面
> 核查方法:逐页面读取 page.tsx 源码,判断实现状态(完整/占位/缺失)
> 详细报告:见各角色域 NeedTodo.md 文档
---
## 一、总体统计
| 角色域 | 页面总数 | ✅ 完整实现 | 🟡 占位空态 | ❌ 缺失 | 详细报告 |
| -------- | -------- | ----------- | ----------- | ------- | -------------------------------------------- |
| 教师域 | 63 | 60 | 3 | 0 | [teacher-NeedTodo.md](./teacher-NeedTodo.md) |
| 学生域 | 32 | 32 | 0 | 0 | [student-NeedTodo.md](./student-NeedTodo.md) |
| 家长域 | 1 | 1 | 0 | 22 | [parent-NeedTodo.md](./parent-NeedTodo.md) |
| 管理员域 | 49 | 49 | 0 | 0 | [admin-NeedTodo.md](./admin-NeedTodo.md) |
| **合计** | **145** | **142** | **3** | **22** | — |
---
## 二、各角色域核查结论
### 2.1 教师域63 页)
**状态**:基本完成,仅 3 个占位页需处理
**3 个占位页(均为 CICD 重定向路径,有等价实现)**
1. `/shell/teacher/classes/students` → 重定向到 `/shell/teacher/students`
2. `/shell/teacher/exams/grading` → 重定向到 `/shell/teacher/homework/submissions`
3. `/shell/teacher/exams/grading/[submissionId]` → 重定向到 `/shell/teacher/homework/submissions/[submissionId]`
**已有资产**
- 55 个 client 组件features/teacher/
- 20 个 lib/api 模块
- 116 个 mock 数据集
**P1-P2 功能增强 backlog**15 页已集成但与 CICD 有功能差距(详见 teacher-NeedTodo.md §三.B
### 2.2 学生域32 页)
**状态**全部真实业务实现4 页 mock 数据缺口
**4 页 mock 数据缺口**
1. `learning-path` - mockMyLearningPath 缺失
2. `elective/[id]` - mockElectiveCourseDetail 缺失
3. `diagnostic` - mockDiagnosticReports 缺失
4. `elective` - 部分字段缺失
**已有资产**
- 28 页 mock 数据齐全,可完整运行
- 全部页面集成 client 组件 + API hook + 三态处理
### 2.3 家长域1 页 + 22 缺失)
**状态**:严重缺失,仅 dashboard 完成
**当前实现**
- `/shell/parent` - 完整实现useParentDashboard hook + 三态处理 + StatCard×2 + DashboardSection×2
**22 个缺失页面**(按 ARCH §9.3 规划 24 页):
1. dashboard 子页trend趋势详情、weakness薄弱点详情
2. children子女管理列表 + [studentId] 详情
3. grades成绩列表 + [id] 详情
4. exams考试列表 + [id] 详情
5. homework作业列表
6. attendance考勤列表
7. classes班级列表
8. course-plans课程计划列表 + [id] 详情
9. lesson-plans教案列表 + [planId]/view
10. error-book错题本列表
11. diagnostic诊断列表
12. learning-path学习路径列表
13. practice练习列表
14. elective选修列表
15. leave请假列表
16. preferences偏好设置列表
17. notifications通知- 共享路由
18. settings设置- 共享路由
**关键阻塞项**
- `features/parent/` 目录完全不存在,所有 client 组件待建
- `myChildren` 契约缺失(子女详情页前置阻塞)
- 5 个 API hooks 已就绪,其余 18+ 页面 hooks 未建立
- 仅 1 项 mock 数据mockParentDashboard
### 2.4 管理员域49 页)
**状态**全部落地0 占位 0 缺失
**已有资产**
- 49 个 page.tsx 入口
- 44 个 features/admin/*-client.tsx 业务组件
- lib/api hooksadmin.ts 973 行 + admin-p5.ts 3371 行)
- mocks/graphql-data.ts9867 行)兜底数据全覆盖
**契约状态**
- 仅 2 页契约就绪dashboard adminDashboard ✅ + plugins config-service ✅)
- 47 页 schema 未就绪,前端用 MSW 兜底先行(@contract-pending 标注)
---
## 三、按优先级排序的待办事项
### P0 - 必须立即处理
#### P0-1: 教师域 3 个占位页改为重定向
- `/shell/teacher/classes/students/page.tsx` → 改为 redirect 到 `/shell/teacher/students`
- `/shell/teacher/exams/grading/page.tsx` → 改为 redirect 到 `/shell/teacher/homework/submissions`
- `/shell/teacher/exams/grading/[submissionId]/page.tsx` → 改为 redirect 到 `/shell/teacher/homework/submissions/[submissionId]`
#### P0-2: 家长域 22 个缺失页面(核心业务)
按业务重要性排序:
1. children子女列表 + 详情)- 家长域核心功能
2. grades成绩查看- 家长最关注
3. homework作业查看
4. attendance考勤查看
5. exams考试结果
6. course-plans课程计划
7. lesson-plans教案查看
8. error-book错题本
9. diagnostic诊断报告
10. leave请假申请
11. learning-path学习路径
12. practice练习记录
13. elective选修课
14. preferences偏好设置
15. trend趋势详情
16. weakness薄弱点详情
17. notifications + settings共享路由
### P1 - 重要功能补全
#### P1-1: 学生域 4 页 mock 数据缺口
- 补齐 mockMyLearningPath
- 补齐 mockElectiveCourseDetail
- 补齐 mockDiagnosticReports
- 补齐 elective 部分字段
#### P1-2: 教师域 15 页功能增强(与 CICD 对齐)
详见 teacher-NeedTodo.md §三.B包括
- exams 富文本编辑器接入exam-edit + new/create
- lesson-plans Tiptap 编辑器 + blocks + AI + 版本历史
- grades 批量录入 + 高级图表 + 成绩单打印
- classes 详情页 widgets + schedule 组件
- attendance 图表 + report-print
- course-plans calendar/form/progress 组件
- error-book 图表组件
- leave 3 个组件 + questions 4 个组件
- schedule-changes grid/rules/auto + practice 图表
- textbooks reader + content-panel
- elective course-list/form/detail
### P2 - 架构优化
#### P2-1: 管理员域契约补齐
- 47 页 schema 未就绪,需后端补齐 GraphQL 契约
- 前端已用 MSW 兜底先行,可继续开发
#### P2-2: 家长域契约补齐
- `myChildren` 契约缺失是核心阻塞
- 需后端补齐家长域相关 GraphQL schema
---
## 四、关键风险
### 4.1 家长域整体缺失(高风险)
- 仅 1/24 页完成,完成率 4.2%
- features/parent/ 目录不存在,需从零建设
- 影响家长端用户体验,无法上线
### 4.2 契约脱节(中风险)
- 管理员域 47/49 页契约 pending
- 家长域核心契约myChildren缺失
- 前端依赖 MSW 兜底,后端就绪前无法真实数据验证
### 4.3 Mock 数据缺口(低风险)
- 学生域 4 页 mock 缺口影响 dev 环境演示
- 家长域仅 1 项 mock新建页面需同步补 mock
---
## 五、建议执行顺序
1. **立即执行 P0-1**:教师域 3 个占位页改为重定向(工作量小,立即见效)
2. **立即执行 P0-2**:家长域 22 个缺失页面(工作量大,需分配专门 AI/开发者)
- 先建立 features/parent/ 目录结构
- 先实现 children 模块(核心功能)
- 逐步实现其他模块
3. **并行执行 P1-1**:学生域 mock 数据补齐(工作量小)
4. **后续执行 P1-2**:教师域功能增强(工作量中等,可分批进行)
5. **后端协同 P2**:契约补齐需后端团队配合
---
## 六、核查文档清单
| 文档 | 路径 | 核查日期 |
| ---------------- | -------------------------------------------- | ---------- |
| 教师域核查报告 | [teacher-NeedTodo.md](./teacher-NeedTodo.md) | 2026-08-04 |
| 学生域核查报告 | [student-NeedTodo.md](./student-NeedTodo.md) | 2026-08-04 |
| 家长域核查报告 | [parent-NeedTodo.md](./parent-NeedTodo.md) | 2026-08-04 |
| 管理员域核查报告 | [admin-NeedTodo.md](./admin-NeedTodo.md) | 2026-08-04 |
| 本汇总报告 | [SUMMARY-NeedTodo.md](./SUMMARY-NeedTodo.md) | 2026-08-04 |
---
**核查完成。四个角色域共 145 个页面142 个已完整实现3 个占位教师域重定向22 个缺失(家长域待建)。**

View File

@@ -1,582 +1,486 @@
# 管理域Admin待完成功能分析
# 管理域Admin待完成功能分析
> 参考项目:`e:\desktop\CICD\src\app\(dashboard)\admin\`41 个 page.tsx
> 当前项目:`e:\Desktop\Edu\apps\portal-shell\src\app\shell\admin\`1 个 page.tsx
> 规划依据:`apps\portal-shell\ARCHITECTURE.md` §9.4(管理域 24 页B5 批次)
> 分析日期2026-07-24
> 分析方式:逐页面对比 CICD 实现 vs portal-shell 实现,逐个读取 CICD page.tsx + ARCH §9.4 契约
> 当前项目:`e:\Desktop\Edu\apps\portal-shell\src\app\shell\admin\`49 个 page.tsx
> 规划依据:`apps\portal-shell\ARCHITECTURE.md` §9.4(管理域 24 页顶层入口B5 批次)
> 核查日期2026-08-04
> 核查方式:逐个读取 49 个 page.tsx + 44 个 features/admin/*-client.tsx + lib/api/admin.ts(973 行) + lib/api/admin-p5.ts(3371 行) + mocks/graphql-data.ts(9867 行),结合 ARCH §9.4 契约判断实现完整性
---
## 〇、方法论与对比基线
1. CICD 单体Next.js App Router + Server Actions + Drizzle作为**功能基线**,反映"老版单体已实现"的管理员功能完整态。
2. portal-shell 作为**目标态**,遵循 ARCH §9.4 的契约与批次规划B524 页)。
2. portal-shell 作为**目标态**,遵循 ARCH §9.4 的契约与批次规划B524 页顶层入口)。
3. CICD admin/layout.tsx 仅为 `<>{children}</>` passthrough无独立侧边栏/权限逻辑(权限由各 page.tsx 调 `requirePermission` 完成)。
4. ARCH §9.4 规划 24 页 = 1 仪表盘 + 23 管理子页portal-shell 仅完成 `/shell/admin/page.tsx`(仪表盘),其余 23 页全部缺失
5. CICD 中存在但 ARCH §9.4 **未规划**的页面course-plans/curriculum-map/elective/questions/lesson-plans/error-book/scheduling/attendance 等 21 页CICD 历史已实现portal-shell 缺失但**不违反 ARCH §9.4**;这些页面是教师域在管理员视角的"全局只读 + 跨班聚合"版本,可作为 B5 后期/补充批次候选。
6. ARCH §9.4 中存在但 CICD **无对应**的页面4 页):`students``teachers``organization``viewports``plugins`,属 ARCH 新规划,需在 portal-shell 中独立设计
4. ARCH §9.4 规划 24 页顶层入口 = 1 仪表盘 + 23 管理子页portal-shell 在此基础上补充了详情/编辑/创建子页与 redirect 入口,实际落地 **49 个 page.tsx**
5. 判断口径(任务约束):
- **✅ 完整实现**page.tsx 引入 `@/features/admin/*-client.tsx` 并渲染client 组件承担业务逻辑,调用 lib/api hooks处理三态或 page.tsx 为有意的 `redirect()` 入口跳转
- **🟡 占位空态**page.tsx 仅用 ListPageShell/FormPageShell/DetailPageShell 直接渲染空态,无 children 业务内容。
- **❌ 缺失**page.tsx 文件不存在。
6. 核查覆盖维度page.tsx 入口 + features/admin/*-client.tsx 业务组件 + lib/api hooks + mocks/graphql-data.ts 兜底数据,四层齐全方视为完整实现。
---
## 一、页面完成度总览
| 状态 | 数量 | 说明 |
| --------------------------------- | ---- | ---------------------------------------------------------------------------------------------- |
| ✅ 已完成且功能完整 | 1 | `/shell/admin/page.tsx`仪表盘4 StatCard + 预警 + AI 用量,已接 `adminDashboard` 真实契约) |
| 全缺失ARCH §9.4 规划内) | 23 | 见 §二,按 ARCH 规划口径的 23 个缺失页面 |
| CICD 已实现但 ARCH §9.4 未规划 | 21 | 见 §五,作为补充批次参考 |
| 🆕 ARCH §9.4 规划但 CICD 无源 | 4 | `students``teachers``organization``viewports`+ `plugins` 已有契约 ✅) |
| 状态 | 数量 | 说明 |
| --------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| ✅ 完整实现(业务页) | 46 | page.tsx 引入对应 `features/admin/*-client.tsx` 并在 `<Suspense>` 中渲染client 组件调用 lib/api hooks处理 loading/error/empty 三态 |
| 整实现(重定向) | 3 | page.tsx 为有意的 `redirect()` 入口跳转classes / scheduling / school 三个模块根路径) |
| 🟡 占位空态 | 0 | 无 |
| ❌ 缺失 | 0 | |
| **合计** | **49** | **管理员域 49/49 page.tsx 全部落地** |
### ✅ 已完成且功能完整1 页)
### ✅ 完整实现46 业务页 + 3 重定向页 = 49 页)
| 模块 | 页面 | 备注 |
| --------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dashboard | `/shell/admin/page.tsx` | 客户端组件,`useAdminDashboard` hook 接 data-ana `adminDashboard` 真实契约4 StatCard教师/学生/班级/全校平均分)+ 近期预警 + AI 用量;含 loading/error 兜底;引用 ARCH §7.1 / §10 P1-2 |
所有 49 个 page.tsx 均已存在且非占位。46 个业务页统一采用 Server Component 入口 + Suspense 边界 + Client Component 业务的架构3 个重定向页为有意的入口跳转,避免空白入口。
业务页架构样例(以 `/shell/admin/ai-settings/page.tsx` 为例):
```tsx
import { Suspense } from "react";
import { AiSettingsClient } from "@/features/admin/ai-settings/ai-settings-client";
import { ListPageSkeleton } from "@/shared/components/page-templates";
export default function AiSettingsPage(): React.ReactElement {
return (
<Suspense fallback={<ListPageSkeleton rows={5} />}>
<AiSettingsClient />
</Suspense>
);
}
```
重定向页架构样例(以 `/shell/admin/school/page.tsx` 为例):
```tsx
import { redirect } from "next/navigation";
export default function SchoolAdminIndexPage(): never {
redirect("/shell/admin/school/schools");
}
```
---
## 二、缺失页面清单(按 ARCH §9.4 规划口径23 页)
### 2.1 dashboard 模块(无缺口)
`/shell` 已落地,对应 ARCH §9.4 第 1 行 `admin/dashboard``/shell`(动作为 R契约 ✅ `adminDashboard`)。
### 2.2 users 模块2 页缺失)
#### 2.2.1 `/shell/admin/users`(用户管理列表)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\users\page.tsx`
- **功能描述**:用户列表 + 角色 assignment 入口
- URL 参数:`page``search``role`(搜索/角色筛选 + 分页)
- 并行查询:`getAdminUsers({ page, search, role })` + `getAdminUserRoles()` + `getRoles()`
- 渲染 `AdminUsersView` 客户端组件,传入 users / roleOptions / 分页信息 / assignableRoles
- **技术栈**Server Component + `requirePermission(Permissions.USER_MANAGE)` + `force-dynamic` + `getSearchParam` 工具 + Drizzle data-access
- **ARCHITECTURE.md 契约**:❌ `users` 列表B5未就绪
- **CICD 关键代码片段**
```ts
await requirePermission(Permissions.USER_MANAGE);
const [result, roleOptions, roles] = await Promise.all([
getAdminUsers({ page, search, role }),
getAdminUserRoles(),
getRoles(),
]);
```
#### 2.2.2 `/shell/admin/users/import`(用户批量导入)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\users\import\page.tsx`
- **功能描述**:用户批量导入页面,包含
- 顶部 `UserImportDialog`(导入弹窗,触发上传 + Server Action 解析)
- 操作指引卡片4 步流程)
- 注意事项卡片6 条规则)
- 模板字段说明表5 列name/email/role/phone/inviteCode标注是否必填
- **技术栈**Server Component + `requirePermission(Permissions.USER_MANAGE)` + UI 基础组件Card / Table / Button+ next-intl
- **ARCHITECTURE.md 契约**:❌(未单独列,归 `users` 工单)
- **CICD 关键代码片段**:通过 `<UserImportDialog />` 客户端组件触发导入流程,模板字段固定 5 列。
### 2.3 roles + permissions 模块2 页缺失)
#### 2.3.1 `/shell/admin/roles`(角色管理列表)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\roles\page.tsx`
- **功能描述**:角色列表 + 创建/编辑入口
- 查询 `getRoles()` 拉取所有角色
- 渲染 `RoleManagementView` 客户端组件(含创建按钮、角色卡片/列表)
- **技术栈**Server Component + `requirePermission(Permissions.ROLE_READ)` + Drizzle `rbac/data-access`
- **ARCHITECTURE.md 契约**B5
- **CICD 关键代码片段**
```ts
await requirePermission(Permissions.ROLE_READ)
const roles = await getRoles()
return <RoleManagementView roles={roles} />
```
#### 2.3.2 `/shell/admin/permissions`(权限目录)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\permissions\page.tsx`
- **功能描述**:权限目录页(系统所有权限点列表,按模块分组)
- 查询 `getPermissionRoleCounts()` 获取每个权限点关联的角色数
- 渲染 `PermissionCatalogView` 客户端组件
- **技术栈**Server Component + `requirePermission(Permissions.PERMISSION_READ)` + Drizzle `rbac/data-access-permissions`
- **ARCHITECTURE.md 契约**B5
- **CICD 关键代码片段**
```ts
await requirePermission(Permissions.PERMISSION_READ)
const roleCountsByPermission = await getPermissionRoleCounts()
return <PermissionCatalogView roleCountsByPermission={roleCountsByPermission} />
```
> **附注**CICD 另有 `admin/roles/[id]/page.tsx`(角色详情,含 `RolePermissionMatrix` 权限矩阵 + `RoleDetailEditButton`),但 ARCH §9.4 仅规划 `/shell/admin/roles` 一页,未列详情子页。可作 B5 后期补强。
### 2.4 audit-logs 模块4 页缺失)
#### 2.4.1 `/shell/admin/audit-logs`(审计日志列表 + 导出)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\audit-logs\page.tsx`
- **功能描述**:审计日志列表 + 多维筛选 + CSV 导出
- URL 参数:`page`、`module`、`action`、`status`、`userId`、`startDate`、`endDate`
- 并行查询:`getAuditLogs({...})` + `getAuditModuleOptions()`
- `AuditLogExportButton` 触发 CSV 导出(按筛选条件)
- `SectionErrorBoundary` 错误兜底
- **技术栈**Server Component + `requirePermission(Permissions.AUDIT_LOG_READ)` + Drizzle `audit/data-access` + 类型守卫 `isValidAuditLogStatus`
- **ARCHITECTURE.md 契约**B5
- **CICD 关键代码片段**
```ts
const [result, moduleOptions] = await Promise.all([
getAuditLogs({ page, module, action, status, userId, startDate, endDate }),
getAuditModuleOptions(),
]);
```
#### 2.4.2 `/shell/admin/audit-logs/overview`(审计概览)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\audit-logs\overview\page.tsx`
- **功能描述**:审计概览页(统计/趋势/分布三件套)
- 并行查询:`getAuditOverviewStats()` + `getAuditTrend(7)` + `getDataChangeActionStats()`
- `AuditServiceProvider` 包裹 `adminAuditService` 注入服务上下文
- 渲染 `AuditOverviewView` 客户端组件(统计卡 + 7 天趋势图 + 动作分布饼图)
- **技术栈**Server Component + `requirePermission(Permissions.AUDIT_LOG_READ)` + 服务注入模式
- **ARCHITECTURE.md 契约**B5
- **CICD 关键代码片段**
```ts
const [stats, trend, distribution] = await Promise.all([
getAuditOverviewStats(),
getAuditTrend(7),
getDataChangeActionStats(),
]);
```
#### 2.4.3 `/shell/admin/audit-logs/login-logs`(登录日志)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\audit-logs\login-logs\page.tsx`
- **功能描述**:登录日志列表 + 筛选 + 导出
- URL 参数:`page`、`action`signin/signout/signup、`status`success/failure、`userId`、`startDate`、`endDate`
- 查询 `getLoginLogs({...})`
- `AuditLogExportButton exportType="login"` 触发导出
- 渲染 `LoginLogView` 客户端组件
- **技术栈**Server Component + `requirePermission(Permissions.AUDIT_LOG_READ)` + 类型守卫 `isValidLoginLogAction` / `isValidLoginLogStatus`
- **ARCHITECTURE.md 契约**B5
#### 2.4.4 `/shell/admin/audit-logs/data-changes`(数据变更日志)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\audit-logs\data-changes\page.tsx`
- **功能描述**:数据变更日志列表 + 筛选 + 导出 + 统计
- URL 参数:`page`、`tableName`、`action`create/update/delete、`userId`、`startDate`、`endDate`
- 并行查询:`getDataChangeLogs({...})` + `getDataChangeTableOptions()` + `getDataChangeStats()`
- 渲染 `DataChangeLogView` 客户端组件(含表选项下拉 + 变更统计卡)
- **技术栈**Server Component + `requirePermission(Permissions.AUDIT_LOG_READ)` + 类型守卫 `isValidDataChangeAction`
- **ARCHITECTURE.md 契约**B5
### 2.5 invitation-codes 模块1 页缺失)
#### 2.5.1 `/shell/admin/invitation-codes`(邀请码管理)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\invitation-codes\page.tsx`
- **功能描述**:邀请码列表 + 生成 + 删除
- SSR 查询 `listInvitationCodes(200, true)`200 条 + 含已用)
- 服务端计算 `now = new Date().getTime()` 传给客户端(避免 Client 端 render 阶段调用 `Date.now()`,符合 react-hooks/purity 规则)
- 生成/删除通过 Server Action + `router.refresh()` 触发更新
- 渲染 `InvitationCodesView` 客户端组件
- **技术栈**Server Component + `requirePermission(Permissions.USER_MANAGE)` + Drizzle `invitation-codes/data-access`
- **ARCHITECTURE.md 契约**B5
- **CICD 关键代码片段**
```ts
const codes = await listInvitationCodes(200, true)
const now = new Date().getTime()
return <InvitationCodesView initialCodes={codes} now={now} />
```
### 2.6 school 模块6 页缺失)
#### 2.6.1 `/shell/admin/school`学校首页redirect
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\school\page.tsx`
- **功能描述**:纯重定向页 `redirect("/admin/school/schools")`,无 UI
- **技术栈**`redirect()` from `next/navigation`
- **ARCHITECTURE.md 契约**B5
#### 2.6.2 `/shell/admin/school/schools`(学校列表)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\school\schools\page.tsx`
- **功能描述**:学校列表 + CRUD
- 查询 `getSchools()`
- 渲染 `SchoolsClient` 客户端组件
- `SectionErrorBoundary` 错误兜底
- **技术栈**Server Component + `requirePermission(Permissions.SCHOOL_MANAGE)` + Drizzle `school/data-access`
- **ARCHITECTURE.md 契约**B5
#### 2.6.3 `/shell/admin/school/classes`(班级管理)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\school\classes\page.tsx`
- **功能描述**:班级管理 + 跨数据聚合
- 并行查询:`getAdminClasses()` + `getTeacherOptions()` + `getSchools()` + `getGrades()`
- 渲染 `AdminClassesClient` 客户端组件(含班级 CRUD + 教师/学校/年级下拉)
- **技术栈**Server Component + `requirePermission(Permissions.SCHOOL_MANAGE)` + Drizzle `classes/data-access` + `school/data-access`
- **ARCHITECTURE.md 契约**B5
- **CICD 关键代码片段**
```ts
const [classes, teachers, schools, grades] = await Promise.all([
getAdminClasses(),
getTeacherOptions(),
getSchools(),
getGrades(),
]);
```
> **注**ARCH §9.4 第 7 行将 `admin/classes` 单列 1 页M与 `school/classes` 实际同源,建议合并到 `/shell/admin/school/classes`。
#### 2.6.4 `/shell/admin/school/departments`(部门管理)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\school\departments\page.tsx`
- **功能描述**:部门列表 + CRUD
- 查询 `getDepartments()`
- 渲染 `DepartmentsClient` 客户端组件
- **技术栈**Server Component + `requirePermission(Permissions.SCHOOL_MANAGE)` + Drizzle
- **ARCHITECTURE.md 契约**B5
#### 2.6.5 `/shell/admin/school/academic-year`(学年管理)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\school\academic-year\page.tsx`
- **功能描述**:学年列表 + CRUD
- 查询 `getAcademicYears()`
- 渲染 `AcademicYearClient` 客户端组件
- **技术栈**Server Component + `requirePermission(Permissions.SCHOOL_MANAGE)` + Drizzle
- **ARCHITECTURE.md 契约**B5
#### 2.6.6 `/shell/admin/school/grades`(年级管理)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\school\grades\page.tsx`
- **功能描述**:年级列表 + CRUD + 统计
- 并行查询:`getGrades()` + `getSchools()` + `getStaffOptions()` + `getGradeOverviewStats()`
- 渲染 `GradesClient` 客户端组件(年级 CRUD + 学校/教职工下拉 + 统计概览)
- **技术栈**Server Component + `requirePermission(Permissions.SCHOOL_MANAGE)` + Drizzle
- **ARCHITECTURE.md 契约**B5
> **附注**CICD 另有 `school/grades/insights/page.tsx`(年级洞察,含 `SchoolWideSummaryCard` 全校汇总 + ChipNav 年级筛选 + 作业表 + 班级排名表 + `getSchoolWideGradeSummary(ctx.dataScope)`),属管理员数据分析视角,**ARCH §9.4 未单独规划**,可作 B5 后期补强。
### 2.7 announcements 模块1 页缺失ARCH 口径)
#### 2.7.1 `/shell/admin/announcements`(公告管理列表)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\announcements\page.tsx`
- **功能描述**:公告列表 + 状态筛选
- URL 参数:`status`draft/published/archived
- 查询 `getAdminAnnouncementsPageData(status)`(一次性返回 announcements + grades + classes
- 渲染 `AdminAnnouncementsView` 客户端组件
- **技术栈**Server Component + `requirePermission(Permissions.ANNOUNCEMENT_MANAGE)` + Drizzle `announcements/data-access` + 类型守卫 `isValidStatus`
- **ARCHITECTURE.md 契约**B5
> **附注**CICD 另有 `announcements/[id]/page.tsx`(公告详情,含发布/归档/删除/置顶操作)+ `announcements/[id]/edit/page.tsx`(编辑表单 `AnnouncementForm mode="edit"` + grades 关联),**ARCH §9.4 仅规划 1 页**,建议合并到详情子页或工作流组件。
### 2.8 files 模块1 页缺失)
#### 2.8.1 `/shell/admin/files`(文件管理)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\files\page.tsx`
- **功能描述**:文件列表 + 统计
- 并行查询:`getFileAttachmentsWithFilters({ limit: 200 })` + `getFileStats()`
- 渲染 `AdminFilesView` 客户端组件(含统计卡 + 文件列表)
- **技术栈**Server Component + `requirePermission(Permissions.FILE_READ)` + Drizzle `files/data-access`
- **ARCHITECTURE.md 契约**B5
- **CICD 关键代码片段**
```ts
const [files, stats] = await Promise.all([
getFileAttachmentsWithFilters({ limit: 200 }),
getFileStats(),
]);
```
## 二、已实现页面清单(按模块分组49 页)
### 2.9 ai-settings 模块1 页缺失
> 状态标识:✅ 完整业务实现 / ↪️ 重定向入口 / 🟡 占位 / ❌ 缺失
> 三态规范:所有 ✅ 业务页的 client 组件均处理 loadingSkeleton/ error局部降级/ emptyEmptyState三态ARCH §11.3 DoD
#### 2.9.1 `/shell/admin/ai-settings`AI 配置
### 2.1 dashboard 模块1 页
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\ai-settings\page.tsx`
- **功能描述**AI Provider 配置 + Usage 仪表盘(取代旧 `/settings?tab=ai` 与考试页内嵌 AI 弹窗)
- 权限:`AI_CHAT`(普通用户可访问自己的 private provider管理员额外有 `AI_CONFIGURE`(管理 public provider 与他人 private provider
- 渲染 `AiProviderSettingsCard` 客户端组件(含 isAdmin 开关)
- 管理员额外渲染 `AiUsageDashboard`(用量统计)
- **技术栈**Server Component + `requirePermission(Permissions.AI_CHAT)` + 通过 `ctx.permissions.includes(Permissions.AI_CONFIGURE)` 区分管理员
- **ARCHITECTURE.md 契约**B5
### 2.10 system 模块1 页缺失)
| 页面路径 | 状态 | 实现要点 |
| -------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `/shell/admin` | ✅ | "use client" + useAdminDashboard() hook 接 data-ana adminDashboard 真实契约4 StatCard教师/学生/班级/全校平均分)+ 近期预警 + AI 用量;含 loading/error 兜底;引用 ARCH §7.1 / §10 P1-2 |
#### 2.10.1 `/shell/admin/system`(系统设置
### 2.2 ai-settings 模块1 页
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\admin\settings\page.tsx`
- **功能描述**:系统设置页
- 渲染 `AdminSettingsView` 客户端组件(具体配置项由组件内部决定)
- **技术栈**Server Component + `requirePermission(Permissions.SETTINGS_ADMIN)` + Drizzle
- **ARCHITECTURE.md 契约**B5对应 ARCH §9.4 第 13 行 `admin/system` → `/shell/admin/system`
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------------ | ---- | ---------------------- | ---- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| /shell/admin/ai-settings | ✅ | ai-settings-client.tsx | 522 | useAiProviders / useCreateAiProvider / useUpdateAiProvider / useDeleteAiProvider / useTestAiProvider / useAiUsageDashboard | ❌ schema 未就绪 → MSW 兜底 |
### 2.11 viewports 模块(1缺失ARCH 新建
### 2.3 announcements 模块(3 页)
#### 2.11.1 `/shell/admin/viewports`(视口配置)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------------------------ | ---- | ------------------------------ | ---- | -------------------------------------------------------------------------------------------------------------------- | ------------- |
| /shell/admin/announcements | ✅ | announcements-list-client.tsx | 469 | useAdminAnnouncements / useDeleteAnnouncement / useArchiveAnnouncement / usePinAnnouncement / usePublishAnnouncement | ❌ → MSW 兜底 |
| /shell/admin/announcements/[id] | ✅ | announcement-detail-client.tsx | 289 | useAdminAnnouncement | ❌ → MSW 兜底 |
| /shell/admin/announcements/[id]/edit | ✅ | announcement-edit-client.tsx | 266 | useAdminAnnouncement / useUpdateAnnouncement | ❌ → MSW 兜底 |
- **CICD 参考实现****无**CICD 未实现
- **功能描述**:对齐 004 §5.4 视口配置BFF/Service 层 viewport 路由策略可视化)
- **技术栈**:未知,需依据 004 §5.4 设计
- **ARCHITECTURE.md 契约**B5
### 2.4 attendance 模块1 页
### 2.12 plugins 模块1 页,契约已就绪 ✅)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ----------------------- | ---- | --------------------------- | ---- | ----------------------------------------------------------------------------------- | ------------- |
| /shell/admin/attendance | ✅ | admin-attendance-client.tsx | 340 | useAdminAttendanceStats / useAdminAttendanceRecords / useAttendanceGradeCorrelation | ❌ → MSW 兜底 |
#### 2.12.1 `/shell/admin/plugins`(插件管理
### 2.5 audit-logs 模块4 页
- **CICD 参考实现****无**CICD 未实现)
- **功能描述**:现有 portal-shell `plugin-manager` 升级整页
- **技术栈**:依据 portal-shell 已有 plugin-manager 演化
- **ARCHITECTURE.md 契约**:✅ `config-service`(已就绪,可优先实现)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------------------------ | ---- | -------------------------- | ---- | ----------------------------------------------------------------------------------------- | ------------- |
| /shell/admin/audit-logs | ✅ | audit-logs-list-client.tsx | 461 | useAuditLogs / useAuditModuleOptions / useExportAuditLogs | ❌ → MSW 兜底 |
| /shell/admin/audit-logs/data-changes | ✅ | data-changes-client.tsx | 472 | useDataChangeLogs / useDataChangeTableOptions / useDataChangeStats / useExportDataChanges | ❌ → MSW 兜底 |
| /shell/admin/audit-logs/login-logs | ✅ | login-logs-client.tsx | 325 | useLoginLogs / useExportLoginLogs | ❌ → MSW 兜底 |
| /shell/admin/audit-logs/overview | ✅ | audit-overview-client.tsx | 386 | useAuditOverviewStats / useAuditTrend / useDataChangeActionStats | ❌ → MSW 兜底 |
### 2.13 ARCH §9.4 规划但 CICD 无源的"新建"页面3 页
### 2.6 classes 模块1 页,重定向
#### 2.13.1 `/shell/admin/students`(学生管理)
| 页面路径 | 状态 | 实现要点 |
| -------------------- | ---- | ----------------------------------------------------------------------------------------------- |
| /shell/admin/classes | ↪️ | redirect("/shell/admin/school/classes"):班级管理归属于 school 限界上下文,避免空白入口重复实现 |
- **CICD 参考实现****无**
- **ARCHITECTURE.md 契约**B5
- **建议**:参照 CICD 中 `admin/school/classes` 等管理页设计,作学生维度聚合视图。
### 2.7 course-plans 模块4 页)
#### 2.13.2 `/shell/admin/teachers`(教师管理)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ----------------------------------- | ---- | ----------------------------- | ---- | ------------------------------------------------------------------------------------------------------- | ------------- |
| /shell/admin/course-plans | ✅ | course-plans-list-client.tsx | 339 | useAdminCoursePlans | ❌ → MSW 兜底 |
| /shell/admin/course-plans/create | ✅ | course-plan-create-client.tsx | 415 | useAdminClasses / useCreateCoursePlanItem 系列 | ❌ → MSW 兜底 |
| /shell/admin/course-plans/[id] | ✅ | course-plan-detail-client.tsx | 644 | useAdminCoursePlan / useUpdateCoursePlanItem / useReorderCoursePlanItems / useBulkToggleCoursePlanItems | ❌ → MSW 兜底 |
| /shell/admin/course-plans/[id]/edit | ✅ | course-plan-edit-client.tsx | 562 | useAdminCoursePlan / useUpdateCoursePlanItem 系列 | ❌ → MSW 兜底 |
- **CICD 参考实现****无**
- **ARCHITECTURE.md 契约**B5
- **建议**:参照 CICD 中 `admin/users` + `getStaffOptions()` 演化。
### 2.8 curriculum-map 模块1 页)
#### 2.13.3 `/shell/admin/organization`(组织管理)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| --------------------------- | ---- | ------------------------- | ---- | ------------------------------------------------------ | ------------- |
| /shell/admin/curriculum-map | ✅ | curriculum-map-client.tsx | 256 | useStandardsCoverageHeatmap / useGlobalLessonPlanStats | ❌ → MSW 兜底 |
- **CICD 参考实现****无**
- **ARCHITECTURE.md 契约**B5
- **建议**:合并 `school/departments` + `school/grades` + 师生维度,作组织架构视图。
### 2.9 elective 模块4 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------------------- | ---- | -------------------------- | ---- | ----------------------------------------------------------------------------------------------------- | ------------- |
| /shell/admin/elective | ✅ | elective-list-client.tsx | 545 | useAdminElectives / useGetElectiveOverviewStats / useDeleteElective | ❌ → MSW 兜底 |
| /shell/admin/elective/create | ✅ | elective-create-client.tsx | 381 | useAdminCreateElective | ❌ → MSW 兜底 |
| /shell/admin/elective/[id] | ✅ | elective-detail-client.tsx | 385 | useAdminElective | ❌ → MSW 兜底 |
| /shell/admin/elective/[id]/edit | ✅ | elective-edit-client.tsx | 464 | useAdminUpdateElective / useOpenElectiveSelection / useCloseElectiveSelection / useRunElectiveLottery | ❌ → MSW 兜底 |
### 2.10 error-book 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ----------------------- | ---- | --------------------- | ---- | ---------------------------------------------- | ------------- |
| /shell/admin/error-book | ✅ | error-book-client.tsx | 738 | useAdminErrorBookStats / useExportErrorBookCsv | ❌ → MSW 兜底 |
### 2.11 files 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------ | ---- | --------------------- | ---- | ----------------------------------------------------------------------- | ------------- |
| /shell/admin/files | ✅ | files-list-client.tsx | 377 | useFileAttachments / useFileStats / useUploadFile / useBatchDeleteFiles | ❌ → MSW 兜底 |
### 2.12 invitation-codes 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ----------------------------- | ---- | -------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------ | ------------- |
| /shell/admin/invitation-codes | ✅ | invitation-codes-list-client.tsx | 542 | useInvitationCodes / useCreateInvitationCode / useRevokeInvitationCode / useGenerateInvitationCodes / useDeleteInvitationCodes | ❌ → MSW 兜底 |
### 2.13 lesson-plans 模块2 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| --------------------------------------- | ---- | ---------------------------- | ---- | -------------------------------------------- | ------------- |
| /shell/admin/lesson-plans | ✅ | lesson-plans-list-client.tsx | 489 | useAdminLessonPlans | ❌ → MSW 兜底 |
| /shell/admin/lesson-plans/[planId]/view | ✅ | lesson-plan-view-client.tsx | 205 | useAdminLessonPlan / useSoftDeleteLessonPlan | ❌ → MSW 兜底 |
### 2.14 organization 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------------- | ---- | ---------------------------- | ---- | ------------------- | ------------- |
| /shell/admin/organization | ✅ | organization-tree-client.tsx | 245 | useOrganizationTree | ❌ → MSW 兜底 |
### 2.15 permissions 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------------ | ---- | --------------------------- | ---- | ---------------------------------------- | ------------- |
| /shell/admin/permissions | ✅ | permissions-list-client.tsx | 216 | usePermissions / usePermissionRoleCounts | ❌ → MSW 兜底 |
### 2.16 plugins 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| -------------------- | ---- | ------------------ | ---- | ------------------------------------------- | ---------------------------------- |
| /shell/admin/plugins | ✅ | plugins-client.tsx | 402 | usePluginRegistry / useUpdatePluginRegistry | ✅ schema 已就绪config-service |
### 2.17 questions 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ---------------------- | ---- | ------------------------- | ---- | ------------------------------------ | ------------- |
| /shell/admin/questions | ✅ | questions-list-client.tsx | 537 | useAdminQuestions / useAdminQuestion | ❌ → MSW 兜底 |
### 2.18 roles 模块2 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ----------------------- | ---- | ---------------------- | ---- | --------------------------------------------------------------------------------------------- | ------------- |
| /shell/admin/roles | ✅ | roles-list-client.tsx | 411 | useRoles / useCreateRole / useDeleteRole / useToggleRoleEnabled | ❌ → MSW 兜底 |
| /shell/admin/roles/[id] | ✅ | role-detail-client.tsx | 165 | useRole / useUpdateRole / useDeleteRole / useRolePermissions / useUpdateRolePermissionActions | ❌ → MSW 兜底 |
### 2.19 scheduling 模块4 页,含 1 重定向)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------------------- | ---- | ----------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------ | ------------- |
| /shell/admin/scheduling | ↪️ | redirect("/shell/admin/scheduling/changes"):避免空白入口,默认进入变更审批页 | — | — | — |
| /shell/admin/scheduling/auto | ✅ | auto-schedule-client.tsx | 270 | useAutoSchedule | ❌ → MSW 兜底 |
| /shell/admin/scheduling/changes | ✅ | schedule-changes-client.tsx | 471 | useAdminScheduleChanges / useAdminScheduleEntries / useApproveScheduleChange / useRejectScheduleChange | ❌ → MSW 兜底 |
| /shell/admin/scheduling/rules | ✅ | scheduling-rules-client.tsx | 401 | useAdminSchedulingRules / useUpdateSchedulingRules | ❌ → MSW 兜底 |
### 2.20 school 模块7 页,含 1 重定向)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ----------------------------------- | ---- | ------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------------------- | ------------- |
| /shell/admin/school | ↪️ | redirect("/shell/admin/school/schools"):避免空白入口,默认进入学校列表页 | — | — | — |
| /shell/admin/school/academic-year | ✅ | academic-year-client.tsx | 601 | useAcademicYears / useCreateAcademicYear / useUpdateAcademicYear / useDeleteAcademicYear | ❌ → MSW 兜底 |
| /shell/admin/school/classes | ✅ | admin-classes-client.tsx | 598 | useAdminClasses / useTeacherOptions / useStaffOptions / useCreateAdminClass / useUpdateAdminClass / useDeleteAdminClass | ❌ → MSW 兜底 |
| /shell/admin/school/departments | ✅ | departments-client.tsx | 444 | useDepartments / useCreateDepartment / useUpdateDepartment / useDeleteDepartment | ❌ → MSW 兜底 |
| /shell/admin/school/grades | ✅ | grades-client.tsx | 688 | useGrades / useGradeOverviewStats / useAdminCreateGrade / useUpdateGrade / useDeleteGrade | ❌ → MSW 兜底 |
| /shell/admin/school/grades/insights | ✅ | grade-insights-client.tsx | 495 | useGradeOverviewStats 系列 | ❌ → MSW 兜底 |
| /shell/admin/school/schools | ✅ | schools-client.tsx | 509 | useSchools / useCreateSchool / useAdminUpdateSchool / useDeleteSchool | ❌ → MSW 兜底 |
### 2.21 students 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| --------------------- | ---- | ------------------------ | ---- | ---------------- | ------------- |
| /shell/admin/students | ✅ | students-list-client.tsx | 387 | useAdminStudents | ❌ → MSW 兜底 |
### 2.22 system 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------- | ---- | -------------------------- | ---- | ------------------------------------------- | ------------- |
| /shell/admin/system | ✅ | system-settings-client.tsx | 566 | useSystemSettings / useUpdateSystemSettings | ❌ → MSW 兜底 |
### 2.23 teachers 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| --------------------- | ---- | ------------------------ | ---- | ---------------- | ------------- |
| /shell/admin/teachers | ✅ | teachers-list-client.tsx | 269 | useAdminTeachers | ❌ → MSW 兜底 |
### 2.24 users 模块3 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ------------------------- | ---- | ----------------------- | ---- | ------------------------------------------------------------------------------------------------------- | ------------- |
| /shell/admin/users | ✅ | users-list-client.tsx | 538 | useUsers / useUpdateUserStatus / useUpdateUserRole / useDeleteUser / useAssignUserRoles / useUpdateUser | ❌ → MSW 兜底 |
| /shell/admin/users/import | ✅ | users-import-client.tsx | 414 | useImportUsers | ❌ → MSW 兜底 |
| /shell/admin/users/[id] | ✅ | user-detail-client.tsx | 404 | useUser / useUpdateUser / useAssignUserRoles | ❌ → MSW 兜底 |
### 2.25 viewports 模块1 页)
| 页面路径 | 状态 | client 组件 | 行数 | lib/api hooks | 契约状态 |
| ---------------------- | ---- | -------------------- | ---- | -------------------------------- | ------------- |
| /shell/admin/viewports | ✅ | viewports-client.tsx | 383 | useViewports / useUpdateViewport | ❌ → MSW 兜底 |
---
## 三、按 ARCH §9.4 模块汇总
| 模块 | ARCH 规划页数 | portal-shell 已完成 | 缺失 | 契约状态 |
| ---------------- | ---------------------------------------------------------------- | ------------------- | ------------------ | ------------------- |
| dashboard | 1 | 1 | 0 | ✅ `adminDashboard` |
| users | 1+1 import 子页 | 0 | 1+1 子页) | ❌ |
| roles | 1 | 0 | 1 | ❌ |
| permissions | 1 | 0 | 1 | ❌ |
| audit-logs | 4(含 overview/login/data-changes | 0 | 4 | ❌ |
| invitation-codes | 1 | 0 | 1 | ❌ |
| school | 6schools/classes/departments/academic-year/grades + redirect | 0 | 6 | ❌ |
| classes | 1与 school/classes 同源) | 0 | 0合并到 school | ❌ |
| students | 1 | 0 | 1 | ❌ |
| teachers | 1 | 0 | 1 | ❌ |
| organization | 1 | 0 | 1 | ❌ |
| announcements | 1 | 0 | 1 | ❌ |
| files | 1 | 0 | 1 | ❌ |
| ai-settings | 1 | 0 | 1 | ❌ |
| system | 1 | 0 | 1 | ❌ |
| viewports | 1 | 0 | 1 | ❌ |
| plugins | 1 | 0 | 1 | ✅ `config-service` |
| **合计** | **~24** | **1** | **~23** | **2 ✅ / ~22 ❌** |
| 模块 | ARCH §9.4 规划页数 | portal-shell 已实现 | 缺失 | 契约状态 |
| ---------------- | --------------------------------- | --------------------- | ----- | ---------------------------- |
| dashboard | 1 | 1 | 0 | ✅ adminDashboard |
| users | 1+1 import +1 详情 | 3 | 0 | ❌ → MSW 兜底 |
| roles | 1+1 详情) | 2 | 0 | ❌ → MSW 兜底 |
| permissions | 1 | 1 | 0 | ❌ → MSW 兜底 |
| audit-logs | 4 | 4 | 0 | ❌ → MSW 兜底 |
| invitation-codes | 1 | 1 | 0 | ❌ → MSW 兜底 |
| school | 6+redirect | 7+grades/insights | 0 | ❌ → MSW 兜底 |
| classes | 1与 school/classes 同源) | 1redirect | 0 | — |
| students | 1 | 1 | 0 | ❌ → MSW 兜底 |
| teachers | 1 | 1 | 0 | ❌ → MSW 兜底 |
| organization | 1 | 1 | 0 | ❌ → MSW 兜底 |
| announcements | 1+2 子页) | 3 | 0 | ❌ → MSW 兜底 |
| files | 1 | 1 | 0 | ❌ → MSW 兜底 |
| ai-settings | 1 | 1 | 0 | ❌ → MSW 兜底 |
| system | 1 | 1 | 0 | ❌ → MSW 兜底 |
| viewports | 1 | 1 | 0 | ❌ → MSW 兜底 |
| plugins | 1 | 1 | 0 | ✅ config-service |
| course-plans | §四补充4 页) | 4 | 0 | ❌ → MSW 兜底 |
| curriculum-map | §四补充1 页) | 1 | 0 | ❌ → MSW 兜底 |
| elective | §四补充4 页) | 4 | 0 | ❌ → MSW 兜底 |
| questions | §四补充1 页) | 1 | 0 | ❌ → MSW 兜底 |
| lesson-plans | §四补充2 页) | 2 | 0 | ❌ → MSW 兜底 |
| error-book | §四补充1 页) | 1 | 0 | ❌ → MSW 兜底 |
| scheduling | §四补充3+redirect | 4 | 0 | ❌ → MSW 兜底 |
| attendance | §四补充1 页) | 1 | 0 | ❌ → MSW 兜底 |
| **合计** | **~24顶层+ ~25子页/补充)** | **49** | **0** | **2 ✅ / 47 ❌MSW 兜底)** |
> **批次**:全部 B5;契约就绪优先级:`plugins`> `dashboard` ✅(已完成)> 其余 ❌ 需 MSW 兜底先行
> **批次**:全部 B5(含 §四补充批次,已全部落地);契约就绪:plugins ✅ + dashboard ✅;其余 47 页 schema 未就绪,前端用 MSW 兜底先行(@contract-pending 标注)
---
## 四、CICD 中存在但 ARCH §9.4 未规划的管理员页面(21 页B5 后期候选
## 四、CICD 中存在但 ARCH §9.4 未规划的管理员页面(已全部实现
> 这些页面在 CICD 中属于"管理员视角的跨班聚合/全局只读"功能是教师域功能在管理员层级的复用。ARCH §9.4 未将其纳入 24 页规划,但作为完整管理员工作台仍具迁移价值。建议作为 B5 末或 B6 补充批次候选,按需取用
> 这些页面在 CICD 中属于"管理员视角的跨班聚合/全局只读"功能是教师域功能在管理员层级的复用。ARCH §9.4 未将其纳入 24 页顶层规划,但 portal-shell 已全部实现(含详情/编辑/创建子页),共 25 页
### 4.1 course-plans 模块4 页)
### 4.1 course-plans 模块4 页,已实现
| CICD 路径 | 功能 | 技术栈 |
| --------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/course-plans/page.tsx` | 课程计划列表admin 全局视角,`scope.isAdmin=true` | Server Component + `requirePermission(Permissions.COURSE_PLAN_READ)` + `getCoursePlans({ status }, { isAdmin: true })` |
| `admin/course-plans/create/page.tsx` | 创建课程计划 | Server Component + `requirePermission(Permissions.COURSE_PLAN_MANAGE)` + 并行查询 classes/subjects/teachers/academicYears + `CoursePlanForm mode="create"` |
| `admin/course-plans/[id]/page.tsx` | 课程计划详情 | Server Component + `getCoursePlanById(id, { userId, isAdmin: true })` + `CoursePlanDetail` |
| `admin/course-plans/[id]/edit/page.tsx` | 编辑课程计划 | Server Component + `requirePermission(Permissions.COURSE_PLAN_MANAGE)` + `CoursePlanForm mode="edit"` |
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ----------------------------------- | ---- | ----------------------------- | ---- |
| /shell/admin/course-plans | ✅ | course-plans-list-client.tsx | 339 |
| /shell/admin/course-plans/create | ✅ | course-plan-create-client.tsx | 415 |
| /shell/admin/course-plans/[id] | ✅ | course-plan-detail-client.tsx | 644 |
| /shell/admin/course-plans/[id]/edit | ✅ | course-plan-edit-client.tsx | 562 |
### 4.2 curriculum-map 模块1 页)
### 4.2 curriculum-map 模块1 页,已实现
| CICD 路径 | 功能 | 技术栈 |
| ------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/curriculum-map/page.tsx` | 课程地图(标准覆盖热图 + 5 张统计卡:教师/教案/已发布/已提交/已关联标准数) | Server Component + `requirePermission(Permissions.LESSON_PLAN_READ)` + `getStandardsCoverageHeatmapAction()` + `getGlobalLessonPlanStatsAction()` + `CurriculumMapView` |
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| --------------------------- | ---- | ------------------------- | ---- |
| /shell/admin/curriculum-map | ✅ | curriculum-map-client.tsx | 256 |
### 4.3 elective 模块4 页)
### 4.3 elective 模块4 页,已实现
| CICD 路径 | 功能 | 技术栈 |
| ----------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `admin/elective/page.tsx` | 选修课列表(`StatsCardsLoader` + `CourseListLoader` 双 Suspense 流式) | Server Component + `requirePermission(Permissions.ELECTIVE_READ)` + `ElectivePageLayout` |
| `admin/elective/create/page.tsx` | 创建选修课 | Server Component + `getSubjectOptions()/getGrades()/getStaffOptions()` + `ElectiveCourseForm mode="create"` |
| `admin/elective/[id]/page.tsx` | 选修课详情(含 `getCourseSelections` 选课记录) | Server Component + `requirePermission(Permissions.ELECTIVE_READ)` + `ElectiveCourseDetail` |
| `admin/elective/[id]/edit/page.tsx` | 编辑选修课 | Server Component + `ElectiveCourseForm mode="edit"` |
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ------------------------------- | ---- | -------------------------- | ---- |
| /shell/admin/elective | ✅ | elective-list-client.tsx | 545 |
| /shell/admin/elective/create | ✅ | elective-create-client.tsx | 381 |
| /shell/admin/elective/[id] | ✅ | elective-detail-client.tsx | 385 |
| /shell/admin/elective/[id]/edit | ✅ | elective-edit-client.tsx | 464 |
### 4.4 questions 模块1 页)
### 4.4 questions 模块1 页,已实现
| CICD 路径 | 功能 | 技术栈 |
| -------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/questions/page.tsx` | 题库管理(筛选 + 导入导出 + 创建) | Server Component + `requirePermission(Permissions.QUESTION_READ)` + `getQuestions({...})` + `QuestionFilters`Suspense + `QuestionBankResultsClient` + `ImportExportButtons` + `CreateQuestionButton` |
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ---------------------- | ---- | ------------------------- | ---- |
| /shell/admin/questions | ✅ | questions-list-client.tsx | 537 |
### 4.5 lesson-plans 模块2 页)
### 4.5 lesson-plans 模块2 页,已实现
| CICD 路径 | 功能 | 技术栈 |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/lesson-plans/page.tsx` | 教案列表4 统计卡:总数/已发布/草稿/已归档 + `LessonPlanList viewMode="admin"` + `LessonPlanProviderSetup` 注入 ADMIN_ROLE_CONFIG | Server Component + `requirePermission(Permissions.LESSON_PLAN_READ)` + `getLessonPlans({}, ctx.dataScope, ctx.userId)` + `getLessonPlanStats()` |
| `admin/lesson-plans/[planId]/view/page.tsx` | 教案只读视图(含 textbook/chapter 标题解析) | Server Component + `getLessonPlanById(planId, ctx.userId)` + `getTextbookById/getChaptersByTextbookId` 并行 + `LessonPlanReadonlyView` |
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| --------------------------------------- | ---- | ---------------------------- | ---- |
| /shell/admin/lesson-plans | ✅ | lesson-plans-list-client.tsx | 489 |
| /shell/admin/lesson-plans/[planId]/view | ✅ | lesson-plan-view-client.tsx | 205 |
### 4.6 error-book 模块1 页)
### 4.6 error-book 模块1 页,已实现
| CICD 路径 | 功能 | 技术栈 |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/error-book/page.tsx` | 错题本分析5 统计卡 + 学科 Tab + 学科分布图 + 章节/知识点薄弱度并排 + Top 50 学生 + Top 10 高频错题;限 500 学生 + DataScope 校验 `type === "all"` | Server Component + `requirePermission(Permissions.ERROR_BOOK_ANALYTICS_READ)` + 多 data-access 并行 + `SubjectTabs/StatsGrid/SubjectDistributionChart/ChapterWeaknessChart/KnowledgePointWeaknessChart/GroupedStudentErrorTable/TopWrongQuestions` + `WidgetBoundary` |
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ----------------------- | ---- | --------------------- | ---- |
| /shell/admin/error-book | ✅ | error-book-client.tsx | 738 |
### 4.7 scheduling 模块3 页)
### 4.7 scheduling 模块3 页 + redirect已实现
| CICD 路径 | 功能 | 技术栈 |
| ----------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/scheduling/auto/page.tsx` | 自动排课(`AutoSchedulePanel` + 跳转 rules 配置入口) | Server Component + `requirePermission(Permissions.SCHEDULE_AUTO)` + `getAdminClassesForScheduling()` |
| `admin/scheduling/changes/page.tsx` | 排课变更审批(变更列表 + 冲突检测 + 课表网格) | Server Component + `requirePermission(Permissions.SCHEDULE_ADJUST)` + 并行 `getAdminClassesForScheduling/getScheduleChanges/getScheduleEntriesForAdmin` + `ScheduleChangeList canApprove` + `ScheduleConflictsView` + `ScheduleGridView` |
| `admin/scheduling/rules/page.tsx` | 排课规则配置 | Server Component + `requirePermission(Permissions.SCHEDULE_ADJUST)` + `getSchedulingRules()` + `SchedulingRulesForm` |
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ------------------------------- | ---- | ------------------------------ | ---- |
| /shell/admin/scheduling | ↪️ | redirect → /scheduling/changes | — |
| /shell/admin/scheduling/auto | ✅ | auto-schedule-client.tsx | 270 |
| /shell/admin/scheduling/changes | ✅ | schedule-changes-client.tsx | 471 |
| /shell/admin/scheduling/rules | ✅ | scheduling-rules-client.tsx | 401 |
### 4.8 attendance 模块1 页)
### 4.8 attendance 模块1 页,已实现
| CICD 路径 | 功能 | 技术栈 |
| --------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/attendance/page.tsx` | 考勤管理7 统计卡 + 班级对比卡 + 考勤-成绩关联分析卡 + 筛选器) | Server Component + `requirePermission(Permissions.ATTENDANCE_READ)` + 并行 `getAttendanceRecords/getAttendanceStats/getGrades/getClassComparison/getAttendanceGradeCorrelation` + `AdminAttendanceFilters`(含 class/status/date 筛选) |
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ----------------------- | ---- | --------------------------- | ---- |
| /shell/admin/attendance | ✅ | admin-attendance-client.tsx | 340 |
> **附注**CICD `admin/attendance/admin-attendance-filters.tsx` 是页内私有 Client Component封装 `FilterBar + Select + Input`,使用 `ATTENDANCE_STATUS_OPTIONS` 常量。迁移时此类"页内 filters 组件"模式应保持。
### 4.9 announcements 详情/编辑2 页,已实现)
### 4.9 announcements 详情/编辑2 页)
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ------------------------------------ | ---- | ------------------------------ | ---- |
| /shell/admin/announcements/[id] | ✅ | announcement-detail-client.tsx | 289 |
| /shell/admin/announcements/[id]/edit | ✅ | announcement-edit-client.tsx | 266 |
| CICD 路径 | 功能 | 技术栈 |
| ---------------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/announcements/[id]/page.tsx` | 公告详情(`AnnouncementDetail canManage` + 跳转 edit + 发布/归档/删除/置顶操作入口) | Server Component + `requirePermission(Permissions.ANNOUNCEMENT_MANAGE)` + `getAdminAnnouncementDetailPageData(id)` + `AnnouncementsServiceProvider` |
| `admin/announcements/[id]/edit/page.tsx` | 公告编辑(`AnnouncementForm mode="edit"` + grades 关联) | Server Component + `requirePermission(Permissions.ANNOUNCEMENT_MANAGE)` + `getEditAnnouncementPageData(id)` |
### 4.10 users/import + users/[id] 子页2 页,已实现)
### 4.10 users/import 子页1 页)
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ------------------------- | ---- | ----------------------- | ---- |
| /shell/admin/users/import | ✅ | users-import-client.tsx | 414 |
| /shell/admin/users/[id] | ✅ | user-detail-client.tsx | 404 |
已在 §2.2.2 列入 ARCH 规划口径(与 `users` 工单合并),此处不重复。
### 4.11 roles/[id] 详情1 页,已实现)
### 4.11 roles/[id] 详情1 页)
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ----------------------- | ---- | ---------------------- | ---- |
| /shell/admin/roles/[id] | ✅ | role-detail-client.tsx | 165 |
| CICD 路径 | 功能 | 技术栈 |
| --------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `admin/roles/[id]/page.tsx` | 角色详情(`RolePermissionMatrix` 权限矩阵 + `RoleDetailEditButton` + admin 角色锁定提示卡) | Server Component + `requirePermission(Permissions.ROLE_READ)` + `getRoleById(id)` + `notFound()` 兜底 + admin 角色强制锁定isLocked |
### 4.12 school/grades/insights1 页,已实现)
### 4.12 school/grades/insights1 页)
已在 §2.6 附注中提及,不重复。
| portal-shell 路径 | 状态 | client 组件 | 行数 |
| ----------------------------------- | ---- | ------------------------- | ---- |
| /shell/admin/school/grades/insights | ✅ | grade-insights-client.tsx | 495 |
---
## 五、迁移注意事项
### 5.1 架构迁移要点
### 5.1 架构迁移要点(已完成)
1. **管理员权限校验**:所有 23 缺失页面均需 `requirePermission(Permissions.XXX)` 在 Server Component 入口校验。CICD 模式可直接复用,但需对齐 portal-shell 的 auth-guard004 §5 鉴权链路)
2. **DataScope 上下文**`school/grades/insights`、`error-book`、`attendance` 等页面依赖 `ctx.dataScope`all / class_taught / class_members / childrenportal-shell 在 BFF 层补齐数据范围上下文。
3. **Server Action + router.refresh 模式**`invitation-codes`、`announcements/[id]/edit` 等使用此模式portal-shell 需保持等价机制BFF API + 客户端 refetch
4. **导出功能**`audit-logs` 三页 + `questions` 导入导出按钮,需后端提供 CSV 导出端点。
5. **服务注入**`audit-logs/overview` 使用 `AuditServiceProvider + adminAuditService` 模式portal-shell 应在 BFF/Service 层保留服务抽象
1. **管理员权限校验**portal-shell 采用 Client Component + BFF 模式,权限校验由 route-permissions.ts 在路由层 EXACT/PREFIX 表登记(如 /shell/admin/* → ["admin"]),与 CICD 的 Server Component + requirePermission 模式不同但等价
2. **DataScope 上下文**portal-shell 在 BFF 层注入数据范围上下文client 组件通过 lib/api hooks 消费,无需 page.tsx 显式传递
3. **Server Action + router.refresh 模式**portal-shell 改用 Apollo Client mutation + useQuery refetch / notify 通知,等价于 CICD 的 Server Action + router.refresh()
4. **导出功能**audit-logs 三页 + error-book 的 CSV 导出,已通过 useExportAuditLogs / useExportLoginLogs / useExportDataChanges / useExportErrorBookCsv hooks 封装,等待后端契约就绪后接真实端点。
5. **服务注入**audit-logs/overview 在 portal-shell 中改为 client 组件直接调用 useAuditOverviewStats / useAuditTrend / useDataChangeActionStats 三个 hook 并行查询,等价于 CICD 的 AuditServiceProvider + adminAuditService 模式。
### 5.2 模块复杂度风险
### 5.2 模块复杂度与契约风险
| 模块 | 风险点 | 缓解建议 |
| ----------------------------------- | ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| **audit-logs**4 页) | 审计核心,多维筛选 + 导出 + 概览统计 + 数据变更统计 | 后端契约工单优先;前端可 MSW 先行 4 页 UI |
| **school**6 页) | 体系复杂6 子页 + 跨表关联schools/classes/departments/grades/academic-year/staff | 按 schools → grades → classes → departments → academic-year 顺序迁移insights 作 B5 末 |
| **scheduling**3 页,§四补充批次) | 涉及自动排课算法 + 冲突检测 + 审批流 | 算法侧需独立服务/工单;前端先做 changes 审批流auto/rules 后置 |
| **error-book**(§四补充批次) | 5 统计卡 + 4 图表 + Top 50 学生 + Top 10 错题;限 500 学生性能保护 | 复用教师域 error-book 组件,仅换 data-access 为 admin scope图表组件应已存在 |
| **attendance**(§四补充批次) | 7 统计 + 班级对比 + 考勤-成绩关联分析 | 后端需提供 `getClassComparison` + `getAttendanceGradeCorrelation` 两个分析端点 |
| **curriculum-map**(§四补充批次) | 标准覆盖热图 + 5 张统计卡 + `getStandardsCoverageHeatmapAction` Server Action | 依赖 lesson-preparation 模块的 actions-analytics需先迁移教师域 lesson-plans |
| **ai-settings** | 双权限AI_CHAT + AI_CONFIGURE+ Provider 配置 + Usage 仪表盘 | 后端需提供 provider CRUD + usage 聚合端点 |
| 模块 | 风险点 | 当前缓解 | 待办 |
| ---------------------- | --------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| audit-logs4 页) | 审计核心,多维筛选 + 导出 + 概览统计 + 数据变更统计 | 前端 4 页 UI 已完成(共 1644 行 client 代码MSW 兜底 | 后端契约工单auditLogs / loginLogs / dataChangeLogs / auditOverviewStats / 导出端点 |
| school7 页) | 体系复杂6 业务子页 + 1 redirect跨表关联 | 前端 7 页 UI 已完成(共 3335 行 client 代码MSW 兜底 | 后端契约工单schools / departments / academicYears / grades / adminClasses / gradeOverviewStats |
| scheduling4 页) | 自动排课算法 + 冲突检测 + 审批流 | 前端 4 页 UI 已完成(共 1142 行 client 代码MSW 兜底 | 后端契约工单autoSchedule / scheduleChanges / scheduleEntries / schedulingRules + 排课算法服务 |
| error-book1 页) | 5 统计卡 + 4 图表 + Top 50 学生 + Top 10 错题 | 前端 1 页 UI 已完成738 行 client 代码最复杂单页MSW 兜底 | 后端契约工单adminErrorBookStats + CSV 导出端点 |
| attendance1 页) | 7 统计 + 班级对比 + 考勤-成绩关联分析 | 前端 1 页 UI 已完成340 行 client 代码MSW 兜底 | 后端契约工单adminAttendanceStats / adminAttendanceRecords / attendanceGradeCorrelation |
| curriculum-map1 页) | 标准覆盖热图 + 5 张统计卡 | 前端 1 页 UI 已完成256 行 client 代码MSW 兜底 | 后端契约工单standardsCoverageHeatmap / globalLessonPlanStats |
| ai-settings1 页) | 双权限 + Provider 配置 + Usage 仪表盘 | 前端 1 页 UI 已完成522 行 client 代码MSW 兜底 | 后端契约工单aiProviders / aiUsageDashboard + Provider CRUD 端点 |
| users3 页) | 用户列表 + 批量导入 + 详情,关联角色分配 | 前端 3 页 UI 已完成(共 1356 行 client 代码MSW 兜底 | 后端契约工单users 列表 + importUsers mutation |
| course-plans4 页) | 课程计划 CRUD + 子项 reorder + 批量切换 | 前端 4 页 UI 已完成(共 1960 行 client 代码MSW 兜底 | 后端契约工单adminCoursePlans / adminCoursePlan + 子项 CRUD mutations |
| elective4 页) | 选修课 CRUD + 抽签 + 选课开关 | 前端 4 页 UI 已完成(共 1775 行 client 代码MSW 兜底 | 后端契约工单adminElectives / adminElective + 抽签 mutation |
### 5.3 契约就绪优先级建议
### 5.3 契约就绪优先级(用于后端工单排期)
按 ARCH §9.4 节奏原则(契约就绪页先行,❌ 页用 MSW 先上 UI
前端 49 页已全部落地,瓶颈在后端 GraphQL schema 就绪。按业务价值与依赖关系排期
1. **优先级 1契约 ✅,可立即实现真实查询)**
- `/shell/admin/plugins`(✅ `config-service`
- `/shell/admin`(已完成)
2. **优先级 2高价值 + 中等复杂度,需后端契约工单)**
- `/shell/admin/users` + `/shell/admin/users/import`(用户管理 + 批量导入)
- `/shell/admin/roles` + `/shell/admin/permissions`RBAC 核心)
- `/shell/admin/invitation-codes`(与 users 共享 USER_MANAGE 权限)
- `/shell/admin/announcements`(公告管理)
- `/shell/admin/files`(文件管理)
3. **优先级 3高复杂度建议 MSW 先行)**
- `/shell/admin/audit-logs/*`4 页,审计核心,多维筛选 + 导出)
- `/shell/admin/school/*`6 页,体系复杂)
4. **优先级 4ARCH 新建,需独立设计)**
- `/shell/admin/students`、`/shell/admin/teachers`、`/shell/admin/organization`、`/shell/admin/viewports`、`/shell/admin/system`
5. **优先级 5§四补充批次B5 末或 B6**
- course-plans/curriculum-map/elective/questions/lesson-plans/error-book/scheduling/attendance 共 16 页
1. **优先级 1契约 ✅,已完成真实查询)**/shell/adminadminDashboard ✅)+ /shell/admin/pluginsconfig-service ✅)
2. **优先级 2高价值 RBAC 核心,需后端契约工单)**users3 页)+ roles2 页)+ permissions1 页)+ invitation-codes1 页)= 7 页后端契约users / roles / permissions / permissionRoleCounts / invitationCodes + 相关 mutations
3. **优先级 3高频运营功能需后端契约工单**announcements3 页)+ files1 页)+ ai-settings1 页)+ system1 页)= 6 页后端契约adminAnnouncements / fileAttachments / aiProviders / aiUsageDashboard / systemSettings
4. **优先级 4审计与组织管理高复杂度**audit-logs4 页)+ school7 页)+ organization1 页)+ students1 页)+ teachers1 页)+ viewports1 页)= 15 页;后端契约:审计 4 类查询 + 导出端点school 6 类实体 CRUDorganizationTree / adminStudents / adminTeachers / viewports
5. **优先级 5§四补充批次教师域聚合视图**course-plans4 页)+ curriculum-map1 页)+ elective4 页)+ questions1 页)+ lesson-plans2 页)+ error-book1 页)+ scheduling4 页)+ attendance1 页)= 18 页;后端契约:均为教师域聚合查询在 admin scope 下的复用
### 5.4 CICD admin/layout.tsx 迁移说明
CICD `admin/layout.tsx``return <>{children}</>`**无独立侧边栏/权限逻辑**(侧边栏由 `(dashboard)/layout.tsx` 统一处理,权限由各 page 调 `requirePermission`)。
CICD admin/layout.tsx 仅 return <>{children}</>**无独立侧边栏/权限逻辑**(侧边栏由 (dashboard)/layout.tsx 统一处理,权限由各 page 调 requirePermission
portal-shell 同样无需在 `shell/admin/layout.tsx` 实现额外逻辑,保持 passthrough 即可;侧边栏与权限校验由 `shell/layout.tsx` 与各 page.tsx 分担。
portal-shell 同样无需在 shell/admin/layout.tsx 实现额外逻辑,保持 passthrough 即可;侧边栏与权限校验由 shell/layout.tsx 与 route-permissions.ts 分担。
### 5.5 三层支撑完整度核查
| 支撑层 | 文件 | 行数 | 覆盖情况 |
| --------------- | ---------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page.tsx 入口 | src/app/shell/admin/**/page.tsx | 49 文件 | 49/49 全部存在46 业务页 + 3 redirect 页 |
| client 业务组件 | src/features/admin/**/*-client.tsx | 44 文件 | 44/44 全部实现165-738 行/文件,均调用 lib/api hooks处理三态 |
| lib/api hooks | src/lib/api/admin.ts + admin-p5.ts | 973 + 3371 = 4344 行 | 全覆盖users/roles/permissions/audit-logs/invitation-codes/school/announcements/files/ai-settings/system/viewports/students/teachers/organization/course-plans/curriculum-map/elective/questions/lesson-plans/error-book/scheduling/attendance/plugins |
| mocks 兜底数据 | src/mocks/graphql-data.ts | 9867 行 | 全覆盖mockAdminDashboard / mockUsers / mockAdminPermissions / mockSchools / mockDepartments / mockAcademicYears / mockAdminGrades / mockAdminClasses / mockAdminAnnouncements / mockInvitationCodes / mockFileAttachments / mockAiProviders / mockSystemSettings / mockViewports / mockAdminStudents / mockAdminTeachers / mockOrganizationTree / mockAdminCoursePlans / mockAdminLessonPlans / mockAdminElectives / mockAdminQuestions / mockAdminScheduleChanges / mockSchedulingRules / mockAdminAttendanceRecords / mockLoginLogs / mockDataChangeLogs 等 |
---
## 六、附录CICD admin/page.tsx 完整清单41 个)
## 六、附录CICD admin/page.tsx 完整清单41 个)+ ARCH 新建5 个)= 46 项对照
| # | CICD 路径 | ARCH §9.4 归属 | 缺失/已有 |
| --- | ------------------------------------------- | ----------------------------- | ------------------------------------------- |
| 1 | `admin/dashboard/page.tsx` | §9.4 第 1 行 ✅ | portal-shell `/shell/admin/page.tsx` 已完成 |
| 2 | `admin/users/page.tsx` | §9.4 第 2 行 ❌ | 缺失 |
| 3 | `admin/users/import/page.tsx` | §9.4 第 2 行 ❌(合并) | 缺失 |
| 4 | `admin/roles/page.tsx` | §9.4 第 3 行 ❌ | 缺失 |
| 5 | `admin/roles/[id]/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 6 | `admin/permissions/page.tsx` | §9.4 第 3 行 ❌ | 缺失 |
| 7 | `admin/audit-logs/page.tsx` | §9.4 第 4 行 ❌ | 缺失 |
| 8 | `admin/audit-logs/overview/page.tsx` | §9.4 第 4 行 ❌ | 缺失 |
| 9 | `admin/audit-logs/login-logs/page.tsx` | §9.4 第 4 行 ❌ | 缺失 |
| 10 | `admin/audit-logs/data-changes/page.tsx` | §9.4 第 4 行 ❌ | 缺失 |
| 11 | `admin/invitation-codes/page.tsx` | §9.4 第 5 行 ❌ | 缺失 |
| 12 | `admin/school/page.tsx`redirect | §9.4 第 6 行 ❌ | 缺失 |
| 13 | `admin/school/schools/page.tsx` | §9.4 第 6 行 ❌ | 缺失 |
| 14 | `admin/school/classes/page.tsx` | §9.4 第 6/7 行 ❌ | 缺失 |
| 15 | `admin/school/departments/page.tsx` | §9.4 第 6 行 ❌ | 缺失 |
| 16 | `admin/school/academic-year/page.tsx` | §9.4 第 6 行 ❌ | 缺失 |
| 17 | `admin/school/grades/page.tsx` | §9.4 第 6 行 ❌ | 缺失 |
| 18 | `admin/school/grades/insights/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 19 | `admin/announcements/page.tsx` | §9.4 第 10 行 ❌ | 缺失 |
| 20 | `admin/announcements/[id]/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 21 | `admin/announcements/[id]/edit/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 22 | `admin/files/page.tsx` | §9.4 第 11 行 ❌ | 缺失 |
| 23 | `admin/ai-settings/page.tsx` | §9.4 第 12 行 ❌ | 缺失 |
| 24 | `admin/settings/page.tsx` | §9.4 第 13 行 ❌(→ /system | 缺失 |
| 25 | `admin/course-plans/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 26 | `admin/course-plans/create/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 27 | `admin/course-plans/[id]/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 28 | `admin/course-plans/[id]/edit/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 29 | `admin/curriculum-map/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 30 | `admin/elective/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划 |
| 31 | `admin/elective/create/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 32 | `admin/elective/[id]/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 33 | `admin/elective/[id]/edit/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 34 | `admin/questions/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 35 | `admin/lesson-plans/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 36 | `admin/lesson-plans/[planId]/view/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 37 | `admin/error-book/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 38 | `admin/scheduling/auto/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 39 | `admin/scheduling/changes/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 40 | `admin/scheduling/rules/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| 41 | `admin/attendance/page.tsx` | §四补充批次 | 缺失(非 ARCH §9.4 规划) |
| # | CICD 路径 | ARCH §9.4 归属 | portal-shell 状态2026-08-04 |
| --- | ----------------------------------------- | ----------------------------- | --------------------------------------------------------------- |
| 1 | admin/dashboard/page.tsx | §9.4 第 1 行 ✅ | /shell/admin/page.tsx(真实契约 adminDashboard |
| 2 | admin/users/page.tsx | §9.4 第 2 行 ❌ | ✅ /shell/admin/users/page.tsxMSW 兜底) |
| 3 | admin/users/import/page.tsx | §9.4 第 2 行 ❌(合并) | ✅ /shell/admin/users/import/page.tsxMSW 兜底) |
| 4 | admin/roles/page.tsx | §9.4 第 3 行 ❌ | ✅ /shell/admin/roles/page.tsxMSW 兜底) |
| 5 | admin/roles/[id]/page.tsx | §四补充批次 | ✅ /shell/admin/roles/[id]/page.tsxMSW 兜底) |
| 6 | admin/permissions/page.tsx | §9.4 第 3 行 ❌ | ✅ /shell/admin/permissions/page.tsxMSW 兜底) |
| 7 | admin/audit-logs/page.tsx | §9.4 第 4 行 ❌ | ✅ /shell/admin/audit-logs/page.tsxMSW 兜底) |
| 8 | admin/audit-logs/overview/page.tsx | §9.4 第 4 行 ❌ | ✅ /shell/admin/audit-logs/overview/page.tsxMSW 兜底) |
| 9 | admin/audit-logs/login-logs/page.tsx | §9.4 第 4 行 ❌ | ✅ /shell/admin/audit-logs/login-logs/page.tsxMSW 兜底) |
| 10 | admin/audit-logs/data-changes/page.tsx | §9.4 第 4 行 ❌ | ✅ /shell/admin/audit-logs/data-changes/page.tsxMSW 兜底) |
| 11 | admin/invitation-codes/page.tsx | §9.4 第 5 行 ❌ | ✅ /shell/admin/invitation-codes/page.tsxMSW 兜底) |
| 12 | admin/school/page.tsxredirect | §9.4 第 6 行 ❌ | ↪️ /shell/admin/school/page.tsx → /school/schools |
| 13 | admin/school/schools/page.tsx | §9.4 第 6 行 ❌ | ✅ /shell/admin/school/schools/page.tsxMSW 兜底) |
| 14 | admin/school/classes/page.tsx | §9.4 第 6/7 行 ❌ | ✅ /shell/admin/school/classes/page.tsxMSW 兜底) |
| 15 | admin/school/departments/page.tsx | §9.4 第 6 行 ❌ | ✅ /shell/admin/school/departments/page.tsxMSW 兜底) |
| 16 | admin/school/academic-year/page.tsx | §9.4 第 6 行 ❌ | ✅ /shell/admin/school/academic-year/page.tsxMSW 兜底) |
| 17 | admin/school/grades/page.tsx | §9.4 第 6 行 ❌ | ✅ /shell/admin/school/grades/page.tsxMSW 兜底) |
| 18 | admin/school/grades/insights/page.tsx | §四补充批次 | ✅ /shell/admin/school/grades/insights/page.tsxMSW 兜底) |
| 19 | admin/announcements/page.tsx | §9.4 第 10 行 ❌ | ✅ /shell/admin/announcements/page.tsxMSW 兜底) |
| 20 | admin/announcements/[id]/page.tsx | §四补充批次 | ✅ /shell/admin/announcements/[id]/page.tsxMSW 兜底) |
| 21 | admin/announcements/[id]/edit/page.tsx | §四补充批次 | ✅ /shell/admin/announcements/[id]/edit/page.tsxMSW 兜底) |
| 22 | admin/files/page.tsx | §9.4 第 11 行 ❌ | ✅ /shell/admin/files/page.tsxMSW 兜底) |
| 23 | admin/ai-settings/page.tsx | §9.4 第 12 行 ❌ | ✅ /shell/admin/ai-settings/page.tsxMSW 兜底) |
| 24 | admin/settings/page.tsx | §9.4 第 13 行 ❌(→ /system | ✅ /shell/admin/system/page.tsxMSW 兜底) |
| 25 | admin/course-plans/page.tsx | §四补充批次 | ✅ /shell/admin/course-plans/page.tsxMSW 兜底) |
| 26 | admin/course-plans/create/page.tsx | §四补充批次 | ✅ /shell/admin/course-plans/create/page.tsxMSW 兜底) |
| 27 | admin/course-plans/[id]/page.tsx | §四补充批次 | ✅ /shell/admin/course-plans/[id]/page.tsxMSW 兜底) |
| 28 | admin/course-plans/[id]/edit/page.tsx | §四补充批次 | ✅ /shell/admin/course-plans/[id]/edit/page.tsxMSW 兜底) |
| 29 | admin/curriculum-map/page.tsx | §四补充批次 | ✅ /shell/admin/curriculum-map/page.tsxMSW 兜底) |
| 30 | admin/elective/page.tsx | §四补充批次 | ✅ /shell/admin/elective/page.tsxMSW 兜底 |
| 31 | admin/elective/create/page.tsx | §四补充批次 | ✅ /shell/admin/elective/create/page.tsxMSW 兜底) |
| 32 | admin/elective/[id]/page.tsx | §四补充批次 | ✅ /shell/admin/elective/[id]/page.tsxMSW 兜底) |
| 33 | admin/elective/[id]/edit/page.tsx | §四补充批次 | ✅ /shell/admin/elective/[id]/edit/page.tsxMSW 兜底) |
| 34 | admin/questions/page.tsx | §四补充批次 | ✅ /shell/admin/questions/page.tsxMSW 兜底) |
| 35 | admin/lesson-plans/page.tsx | §四补充批次 | ✅ /shell/admin/lesson-plans/page.tsxMSW 兜底) |
| 36 | admin/lesson-plans/[planId]/view/page.tsx | §四补充批次 | ✅ /shell/admin/lesson-plans/[planId]/view/page.tsxMSW 兜底) |
| 37 | admin/error-book/page.tsx | §四补充批次 | ✅ /shell/admin/error-book/page.tsxMSW 兜底) |
| 38 | admin/scheduling/auto/page.tsx | §四补充批次 | ✅ /shell/admin/scheduling/auto/page.tsxMSW 兜底) |
| 39 | admin/scheduling/changes/page.tsx | §四补充批次 | ✅ /shell/admin/scheduling/changes/page.tsxMSW 兜底) |
| 40 | admin/scheduling/rules/page.tsx | §四补充批次 | ✅ /shell/admin/scheduling/rules/page.tsxMSW 兜底) |
| 41 | admin/attendance/page.tsx | §四补充批次 | ✅ /shell/admin/attendance/page.tsxMSW 兜底) |
**ARCH §9.4 规划但 CICD 无源5 页)**
**ARCH §9.4 规划但 CICD 无源5 项,已全部新建)**
| # | ARCH 目标路由 | 说明 | 契约 |
| --- | --------------------------- | -------------------------------- | ------------------- |
| A | `/shell/admin/students` | ARCH 新建CICD 无 | ❌ |
| B | `/shell/admin/teachers` | ARCH 新建CICD 无 | ❌ |
| C | `/shell/admin/organization` | ARCH 新建CICD 无 | ❌ |
| D | `/shell/admin/viewports` | ARCH 新建,对齐 004 §5.4 | ❌ |
| E | `/shell/admin/plugins` | ARCH 新建plugin-manager 升级) | ✅ `config-service` |
| # | ARCH 目标路由 | 说明 | 契约 | portal-shell 状态2026-08-04 |
| --- | ------------------------- | -------------------------------- | ----------------- | -------------------------------------------- |
| A | /shell/admin/students | ARCH 新建CICD 无 | ❌ → MSW 兜底 | ✅ /shell/admin/students/page.tsx |
| B | /shell/admin/teachers | ARCH 新建CICD 无 | ❌ → MSW 兜底 | ✅ /shell/admin/teachers/page.tsx |
| C | /shell/admin/organization | ARCH 新建CICD 无 | ❌ → MSW 兜底 | ✅ /shell/admin/organization/page.tsx |
| D | /shell/admin/viewports | ARCH 新建,对齐 004 §5.4 | ❌ → MSW 兜底 | ✅ /shell/admin/viewports/page.tsx |
| E | /shell/admin/plugins | ARCH 新建plugin-manager 升级) | ✅ config-service | ✅ /shell/admin/plugins/page.tsx真实契约 |
---
**portal-shell 额外新增3 项 redirect 入口)**
## 七、关键结论
1. **portal-shell 管理域完成度1/24 ≈ 4%**(仅仪表盘),是各角色域中完成度最低的。
2. **缺失 23 页全部属 B5 批次**,节奏紧迫,建议立即启动契约工单。
3. **契约就绪仅 2 个**`adminDashboard`(已用)+ `config-service`plugins未实现
4. **CICD 有 21 页 ARCH §9.4 未规划**,是教师域功能在管理员视角的复用,建议作为 B5 末或 B6 补充批次,按需取用。
5. **高复杂度模块**audit-logs4 页 + 导出、school6 子页 + 跨表关联、scheduling算法、error-book多图表聚合
6. **CICD admin/layout.tsx 无独立逻辑**portal-shell 保持 passthrough 即可,侧边栏与权限由 shell/layout + 各 page.tsx 分担。
7. **建议实施顺序**:契约就绪的 `plugins` → 高价值低复杂度的 `users/roles/permissions/invitation-codes/announcements/files/ai-settings` → 高复杂度的 `audit-logs/*` + `school/*` → ARCH 新建的 `students/teachers/organization/viewports/system` → §四补充批次 16 页。
| # | portal-shell 路由 | 说明 |
| --- | ----------------------- | ------------------------------------------ |
| α | /shell/admin/classes | redirect → /shell/admin/school/classes |
| β | /shell/admin/scheduling | redirect → /shell/admin/scheduling/changes |
| γ | /shell/admin/school | redirect → /shell/admin/school/schools |

View File

@@ -1,10 +1,10 @@
# 家长域Parent待完成功能分析
# 家长域Parent实现完整性核查报告
> 参考项目:`e:\desktop\CICD\src\app\(dashboard)\parent\`
> 参考项目:`e:\Desktop\CICD\src\app\(dashboard)\parent\`
> 当前项目:`e:\Desktop\Edu\apps\portal-shell\src\app\shell\parent\`
> 规划依据:`apps/portal-shell/ARCHITECTURE.md` §9.324 页B4 批次)
> 分析日期2026-07-24
> 任务范围:仅分析,不写代码
> 核查日期2026-08-04
> 任务范围:仅核查与文档更新,不修改源代码
---
@@ -41,6 +41,49 @@
> **重要提示**portal-shell 已转向微服务 + BFF 架构,迁移时**不能照搬 CICD 的 Server Action + Drizzle 直查模式**。家长页面应通过 `teacher-bff` / `data-ana` 等服务的 gRPC/HTTP API 获取数据,前端通过 hooks 消费。家长域多为**只读视图**,重点在 `myChildren` 契约 + `child-overview` 聚合。
### 1.4 portal-shell 家长域资产核查features / lib/api / mocks已实际读取源码确认
#### 1.4.1 features/parent/ client 组件
**`src/features/parent/` 目录不存在**。当前 `src/features/` 下仅有:`admin` / `notifications` / `settings` / `shared` / `student` / `teacher`
> **结论**:家长域**完全没有 features 层 client 组件**。CICD 中家长域依赖的模块组件(`ParentDashboard` / `ChildCard` / `ParentChildrenDataPage` / `ParentNoChildrenPage` / `ChildDetailHeader` / `SiblingSwitcher` / `StudentGradeSummary` / `GradeTrendCard` / `ReportCardView` / `ParentAttendanceCalendar` / `CoursePlanList` / `LessonPlanReadonlyView` / `StudentDiagnosticView` / `PracticeHistory` / `ParentSelectionView` / `LeaveRequestForm` 等)在 portal-shell 中**均未建立**,需在 B4 批次逐模块重建或下沉。
#### 1.4.2 lib/api/ 家长相关 API hooks
家长相关 hooks 分布在 2 个文件,共 **5 个 hooks**
**`src/lib/api/dashboard.ts`1 个 hook**
- `useParentDashboard()`:查询 `parentDashboard` 根字段,返回 `ParentDashboard | null`。operation`GET_PARENT_DASHBOARD_DOC`,类型 `ParentDashboard` 字段 snake_case 对齐 data-ana 子图。
**`src/lib/api/parent.ts`4 个 hooks + 领域模型)**
- `useParentChildren()`:查询 `myChildren``GET_MY_CHILDREN_OVERVIEW_DOC`),返回 `ChildSummary[]`(含 `recentGrades` / `attendance` / `homeworkCompletion`
- `useLeaveRequests(childId, status)`:查询 `leaveRequests``GET_LEAVE_REQUESTS_DOC`),按孩子 ID 与状态筛选
- `useApproveLeave()``APPROVE_LEAVE_DOC` mutation失败抛 `ApiError`
- `useRejectLeave()``REJECT_LEAVE_DOC` mutation需 reason失败抛 `ApiError`
领域模型类型:`ChildSummary` / `ChildGrade` / `ChildAttendance` / `ChildHomeworkCompletion` / `LeaveRequest` / `LeaveType` / `LeaveStatus`
operations 文件:`src/lib/api/operations/parent.graphql.ts`4 个 document。导出`src/lib/api/index.ts` 第 36 行 `export * from "./parent";`
> **结论**lib/api 层家长 hooks 已就绪 5 个(仪表盘 + 子女概览 + 请假审批链路。§9.3 其余 18+ 页面所需 hooksgrades / report-card / exams / homework / attendance / classes / course-plans / lesson-plans / error-book / diagnostic / learning-path / practice / elective / preferences 等)**均未建立**。注:`lib/api/` 下虽有 `grades.ts` / `attendance.ts` 等同名文件,但属学生域 / 通用域 hooks家长域多子女聚合 + 只读过滤尚未单独建模。
#### 1.4.3 src/mocks/graphql-data.ts 家长相关 mock 数据
| Mock 资产 | 位置 | 状态 | 服务对象 |
| -------------------------------- | ---------------------- | ----------------- | ----------------------------------------------------------------------------------------- |
| `mockParentDashboard` | `graphql-data.ts:84` | ✅ 存在 | `GetParentDashboard` 查询(仪表盘页) |
| `GetParentDashboard` case 分支 | `graphql-data.ts:5577` | ✅ 存在 | 仪表盘 hook 兜底 |
| `mockLeaveRequests` | `graphql-data.ts:4143` | 🟡 存在但属教师域 | `GetTeacherLeaveRequests`(教师域 B2 |
| `GetMyChildrenOverview` mock | — | ❌ **缺失** | `useParentChildren` 无兜底 |
| `GetLeaveRequests`家长版mock | — | ❌ **缺失** | `useLeaveRequests` 无兜底(教师版结构 `{ items, total }` 与家长版 `LeaveRequest[]` 不同) |
| `ApproveLeave` mock | — | ❌ **缺失** | `useApproveLeave` 无兜底 |
| `RejectLeave` mock | — | ❌ **缺失** | `useRejectLeave` 无兜底 |
> **结论**:家长域 mock **仅仪表盘 1 项就绪**`useParentChildren` / `useLeaveRequests`(家长版)/ `useApproveLeave` / `useRejectLeave` 4 个 hook 在 dev 环境**无 MSW 兜底**(会触发 Apollo 错误或空态)。需在 B4 补齐 4 个 mock否则 dev 环境无法演示。
---
## 二、缺失页面清单(按模块分组)
@@ -51,7 +94,7 @@
- **portal-shell 实现**:基础仪表盘,显示孩子平均分 / 班级排名 / 薄弱知识点 / 预警通知
- **技术栈**Client Component + `useParentDashboard()` Hook + `DashboardShell` / `StatCard` 共享组件
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\dashboard\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\dashboard\page.tsx`
- **CICD 技术栈**Server Component + `getParentDashboardAction()` Server Action + `ParentDashboard` 视图组件 + React `use()` 流式渲染 + `generateMetadata`
- **CICD 关键功能**
- 无子女时显示 `ParentNoChildrenPage` 空态
@@ -89,7 +132,7 @@
#### 2.2.1 ❌ `/shell/parent/children/[studentId]`(子女详情页,缺失)⚠️ 重要
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\children\[studentId]\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\children\[studentId]\page.tsx`
- **功能描述**
- **单个子女的完整详情视图**(家长域最核心页面)
- **双重权限校验**
@@ -126,7 +169,7 @@
#### 2.3.1 ❌ `/shell/parent/grades`(子女成绩列表,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\grades\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\grades\page.tsx`
- **功能描述**
- **多子女成绩对比视图**(家长域特色)
- 每个子女一块:姓名标题 + **导出按钮**`ParentExportButton`,按 studentId 导出)
@@ -146,7 +189,7 @@
#### 2.3.2 ❌ `/shell/parent/grades/report-card`(子女成绩报告卡,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\grades\report-card\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\grades\report-card\page.tsx`
- **功能描述**
- 学年 / 学期可切换的成绩报告卡(家长视角)
- **必填查询参数**`studentId`(必须在家长子女范围内)
@@ -215,7 +258,7 @@
#### 2.6.1 ❌ `/shell/parent/attendance`(子女考勤,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\attendance\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\attendance\page.tsx`
- **功能描述**
- **多子女考勤对比视图**(家长域特色)
- 顶部 `headerExtra`:出勤率卡片(`ParentAttendanceRateCard`+ 考勤预警(`ParentAttendanceWarning`
@@ -253,7 +296,7 @@
#### 2.8.1 ❌ `/shell/parent/course-plans`(课程计划列表,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\course-plans\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\course-plans\page.tsx`
- **功能描述**
- 家长视角:解析**所有孩子的班级 ID**,用于过滤课程计划
- 并行查询每个子女的活跃班级 ID`getStudentActiveClassId`
@@ -271,7 +314,7 @@
#### 2.8.2 ❌ `/shell/parent/course-plans/[id]`(课程计划详情,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\course-plans\[id]\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\course-plans\[id]\page.tsx`
- **功能描述**
- 家长视角:仅允许查看**孩子所在班级**的课程计划
- 解析所有孩子的班级 ID传入权限上下文
@@ -292,7 +335,7 @@
#### 2.9.1 ❌ `/shell/parent/lesson-plans`(教案列表,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\lesson-plans\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\lesson-plans\page.tsx`
- **功能描述**
- 家长视角:仅查看**已发布**教案(`status: "published"`
- 学科选项并行加载(`getSubjectOptions`
@@ -310,7 +353,7 @@
#### 2.9.2 ❌ `/shell/parent/lesson-plans/[planId]/view`(教案只读详情,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\lesson-plans\[planId]\view\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\lesson-plans\[planId]\view\page.tsx`
- **功能描述**
- 家长视角:仅可查看**孩子所在年级**的已发布课案V4 P0-1 修复,防跨年级信息泄露)
- **scope 校验**`assertPlanInScope(plan, ctx)`,失败 `notFound()`
@@ -334,7 +377,7 @@
#### 2.10.1 ❌ `/shell/parent/error-book`(子女错题本,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\error-book\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\error-book\page.tsx`
- **功能描述**
- **单/多子女分支渲染**(家长域特色):
- **单子女**:直接展示 `StatsGrid` 5 列统计卡片(总数 / 新增 / 学习中 / 已掌握 / 待复习)
@@ -358,7 +401,7 @@
#### 2.11.1 ❌ `/shell/parent/diagnostic`(子女学情诊断,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\diagnostic\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\diagnostic\page.tsx`
- **功能描述**
- **多子女诊断对比视图**v4-P1-9 容错增强)
- 预先查询所有子女姓名(`getUserNamesByIds`),用于错误卡片展示
@@ -394,7 +437,7 @@
#### 2.13.1 ❌ `/shell/parent/practice`(子女练习查看,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\practice\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\practice\page.tsx`
- **功能描述**
- **单/多子女分支渲染**(家长域特色):
- **单子女**:直接展示 4 列 `StatsGrid`(总练习次数 / 已完成 / 总答题数 / 正确率)+ `PracticeHistory` 历史列表
@@ -419,7 +462,7 @@
#### 2.14.1 ❌ `/shell/parent/elective`(子女选课查看,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\elective\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\elective\page.tsx`
- **功能描述**
- **多子女选课记录查看**(只读,家长不能选课)
- 每个子女一块:`ParentSelectionView`(子女姓名 + 选课记录列表)
@@ -439,7 +482,7 @@
#### 2.15.1 ❌ `/shell/parent/leave`(家长在线请假,缺失)
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\parent\leave\page.tsx`
- **CICD 参考实现**`e:\Desktop\CICD\src\app\(dashboard)\parent\leave\page.tsx`
- **功能描述**
- **家长域少有的"写"操作页面**(其他多为只读)
- 顶部:**在线请假表单**`LeaveRequestForm`,下拉选择子女,自动写入 classId

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,10 @@
# 教师域Teacher待完成功能分析
# 教师域Teacher待完成功能分析
> 参考项目:`e:\desktop\CICD\src\app\(dashboard)\teacher\`53 个 page.tsx
> 当前项目:`e:\Desktop\Edu\apps\portal-shell\src\app\shell\teacher\`53 个 page.tsx
> 规划依据:`apps\portal-shell\ARCHITECTURE.md` §9.1(教师域 56 页B1+B2
> 分析日期2026-07-24
> 分析方式:逐页面对比 CICD 实现 vs portal-shell 实现,逐个读取 page.tsx + features/*-client.tsx
> 参考项目:`e:\desktop\CICD\src\app\(dashboard)\teacher\`CICD 原版,53 个 page.tsx
> 当前项目:`e:\Desktop\Edu\apps\portal-shell\src\app\shell\teacher\`63 个 page.tsx
> 规划依据:`apps\portal-shell\ARCHITECTURE.md` §9.1(教师域 56 页规划B1+B2+B2末
> 分析日期2026-08-04
> 分析方式:逐页面读取 page.tsx 文件内容 + features/*-client.tsx 集成核查 + lib/api hooks + mocks/graphql-data.ts 覆盖核查
---
@@ -13,567 +13,467 @@
1. CICD 单体Next.js App Router + Server Actions + Drizzle作为**功能基线**,反映"老版单体已实现"的教师功能完整态。
2. portal-shell 作为**目标态**,遵循 ARCH §9.1 的契约与批次规划B1+B2+B2末
3. portal-shell 普遍采用「Server Component page.tsx 仅做 `<Suspense>` 边界包裹 + Client Component `*-client.tsx` 承载业务」的统一架构CICD 多为「Server Component 直接拉数据 + Rich Client Component 渲染」。
4. ARCH §9.1 规划 56 页portal-shell 已实现 53 页,**3 页缺口** = `exams/[id]/proctoring`B2末+ `notifications`B1 共享)+ `settings`B1 共享)。
4. ARCH §9.1 规划 56 页portal-shell 已实现 **63 页**(含 5 个路径别名 `/classes/my``/classes/my/[id]``/exams/all``/exams/create``/homework/assignments/create` 复用同一 client+ 3 个占位页 `/classes/students``/exams/grading``/exams/grading/[submissionId]`+ 2 个 ARCH §9.1 原未规划但已补做 `/exams/[id]/proctoring``/diagnostic/student/[studentId]`)。
5. CICD 中 `exams/page.tsx``classes/page.tsx``exams/grading/*``exams/create` 等为**重定向/等价路径**,不算独立功能缺口。
6. CICD 中 `diagnostic/student/[studentId]` 在 ARCH §9.1 中**未规划**ARCH 仅规划 `diagnostic` + `diagnostic/class/[classId]` 共 2 页),属 CICD 历史功能portal-shell 缺失但**不违反 ARCH**。
6. CICD 中 `diagnostic/student/[studentId]` 在 ARCH §9.1 中**未规划**ARCH 仅规划 `diagnostic` + `diagnostic/class/[classId]` 共 2 页),属 CICD 历史功能portal-shell 已补做(**待同步更新 ARCH §9.1 + 004 + arch.db**
### 0.1 三态分类严格定义(本次核查采用)
| 状态 | 定义 | 判据 |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| ✅ 完整实现 | page.tsx 引入并渲染 `features/teacher/*-client.tsx` 客户端组件,或 page.tsx 自身包含真实业务逻辑(调用 lib/api hooks、渲染数据、处理 loading/error/empty 三态) | 文件内 `import``*-client.tsx``<XxxClient />` 渲染;或直接调用 `useXxx` hook |
| 🟡 占位空态 | page.tsx 仅用 `ListPageShell` / `DetailPageShell` / `FormPageShell` / `WorkbenchPageShell` 等 page-templates 直接渲染空态(如 `empty` 属性或无 children 内容),**没有引入任何 `*-client.tsx`,也没有真实业务逻辑** | 文件内仅 `import { ListPageShell } from "@/shared/components/page-templates"`,无 client 组件 |
| ❌ 缺失 | 文件不存在 | 路径下无 page.tsx |
> **重要说明**:本核查的"完整实现"指**页面骨架与数据流闭环**client 组件已集成、hooks 已接入、三态已处理),**不代表与 CICD 功能完全对等**。与 CICD 的功能差距详见 §三.B原 §3.4-§3.18 内容保留,归类为"功能差距"而非"占位空态")。
### 0.2 配套资产核查
| 资产 | 路径 | 覆盖情况 |
| ----------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| features/teacher/*-client.tsx | `src/features/teacher/<module>/` | **55 个页面级 client 组件**(不含 dashboard-cards-client 子组件),覆盖 20 个模块,详见 §七.2 |
| lib/api hooks | `src/lib/api/<module>.ts` | **20 个模块文件**ai/analytics/attendance/classes/course-plans/dashboard/diagnostic/elective/error-book/exams/grades/homework/knowledge-graph/leave/lesson-plans/practice/proctoring/questions/schedule-changes/students/textbooks另含 admin/universal/sidebar/topbar/notifications/settings/profile 等共享域文件) |
| mocks/graphql-data.ts | `src/mocks/graphql-data.ts` | **269KB / 116 个 mock 数据集**(含教师域全部模块 + 学生/家长/管理域),所有占位页与功能差距页均有 MSW 兜底 |
---
## 一、页面完成度总览
| 状态 | 数量 | 说明 |
| --------------------- | ---- | ---------------------------------------------------------------------------------------------------- |
| ✅ 已完成且功能完整 | 33 | 功能与 CICD 持平或为 ARCH 新建且实现完整(含 MSW 兜底契约页) |
| 🟡 已完成但功能不完整 | 14 | 页面存在但子功能/技术栈与 CICD 有差距 |
| ❌ 完全缺失 | 4 | `exams/[id]/proctoring``diagnostic/student/[studentId]``/shell/notifications``/shell/settings` |
| 状态 | 数量 | 说明 |
| ----------- | ------ | ---------------------------------------------------------------------------- |
| ✅ 完整实现 | **60** | page.tsx 集成 `*-client.tsx` 或自身含真实业务逻辑lib/api hook + 三态处理) |
| 🟡 占位空态 | **3** | 仅用 page-templates 渲染空态,无 client 组件集成,无真实业务 |
| ❌ 完全缺失 | **0** | 教师域 63 个 page.tsx 全部存在 |
### ✅ 已完成且功能完整33 页)
### 与原核查2026-07-24的差异
| 模块 | 页面 | 备注 |
| ---------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| dashboard | `/shell/teacher`teacher/page.tsx | 仪表盘4 StatCard + 班级概况 + 预警(注:标题用硬编码中文,违反 i18n但功能完整 |
| exams | `/shell/teacher/exams/[id]/analytics` | 汇总卡片 + 分数段分布图 + 每题正确率 + 学生排名,混合契约 ✅ `assignmentAnalysis` |
| homework | `/shell/teacher/homework/submissions/[submissionId]` | 单份提交批改,含题目分数/教师评语/AI 建议应用/上下导航/总反馈 |
| homework | `/shell/teacher/homework/submissions/[submissionId]/scan-grading` | 扫描批改 |
| homework | `/shell/teacher/homework/submissions` | 提交列表 |
| homework | `/shell/teacher/homework/assignments/[id]/submissions` | 作业子提交列表 |
| homework | `/shell/teacher/homework` | 作业列表 |
| grades | `/shell/teacher/grades` | 成绩列表 |
| grades | `/shell/teacher/grades/analytics` | 成绩分析,汇总 + 分布 + 排名,混合契约 |
| grades | `/shell/teacher/grades/stats` | 成绩统计 |
| grades | `/shell/teacher/grades/report-card` | 报告卡 |
| attendance | `/shell/teacher/attendance` | 考勤列表 |
| attendance | `/shell/teacher/attendance/report` | 考勤报告 |
| attendance | `/shell/teacher/attendance/stats` | 考勤统计 |
| classes | `/shell/teacher/classes` | 班级列表(含 gradeId/subjectId/q 筛选) |
| classes | `/shell/teacher/classes/schedule` | 班级课表 |
| students | (见 🟡 学生列表,因缺科目成绩) | — |
| course-plans | `/shell/teacher/course-plans``/[id]` | 2 页 |
| elective | `/shell/teacher/elective``/create``/[id]/edit` | 3 页 |
| error-book | `/shell/teacher/error-book` | ✅ `errorBookItems/Stats` 真实契约 |
| diagnostic | `/shell/teacher/diagnostic` | 诊断列表 |
| analytics | `/shell/teacher/analytics``/[studentId]` | ARCH 新建 2 页MSW 兜底 |
| ai | `/shell/teacher/ai/ai-assist``/ai-lesson-plan``/ai-report` | ARCH 新建 B2末 3 页,全 MSW 兜底,工作台布局完整 |
| knowledge-graph | `/shell/teacher/knowledge-graph` | ARCH 新建 B2末三栏工作台`knowledgePoint(id)` ✅ 真实 + 列表 MSW |
| questions | `/shell/teacher/questions` | 题库列表,🟡 `question(id)` |
| textbooks | `/shell/teacher/textbooks``/[id]` | 2 页,🟡 `textbook(id)` |
| lesson-plans | `/shell/teacher/lesson-plans``/new``/calendar``/heatmap``/library` | 5 页edit 见 🟡) |
| practice | `/shell/teacher/practice` | 练习 |
| leave | `/shell/teacher/leave` | 请假 |
| schedule-changes | `/shell/teacher/schedule-changes` | 调课 |
| 项目 | 原07-24 | 现08-04 | 变化 |
| -------- | ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
| 总页面数 | 53 | 63 | +105 别名 + 3 占位 + 2 补做) |
| ✅ 完整 | 33 | 60 | +27原 14 页"功能不完整"实为已集成 client 归入 ✅ + 新补做 2 页 + 新增别名 5 页 - 占位 3 页归 🟡 - 共享域 2 页非教师域) |
| 🟡 占位 | 14 | 3 | -11原 14 页均集成 client 组件归 ✅;新增 3 个真占位页) |
| ❌ 缺失 | 4 | 0 | -4proctoring 与 diagnostic/student 已补做notifications/settings 属共享域非教师域核查范围) |
### 🟡 已完成但功能不完整14 页)
### ✅ 完整实现60 页)
详见 §三。
按模块分布(含别名/复用):
### ❌ 完全缺失4 页)
| 模块 | 页面数 | 页面路径 |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| dashboard | 1 | `/shell/teacher`page.tsx 含 useTeacherDashboard hook + 7 张卡片 + i18n + 三态) |
| ai | 3 | `/ai/ai-assist``/ai/ai-lesson-plan``/ai/ai-report`(全 MSWB2末工作台 |
| analytics | 2 | `/analytics``/analytics/[studentId]`MSW 兜底) |
| attendance | 4 | `/attendance``/report``/sheet``/stats` |
| classes | 5 | `/classes``/classes/my`(别名)、`/classes/[id]``/classes/my/[id]`(别名)、`/classes/schedule` |
| course-plans | 2 | `/course-plans``/course-plans/[id]` |
| diagnostic | 3 | `/diagnostic``/diagnostic/class/[classId]``/diagnostic/student/[studentId]`(已补做) |
| elective | 3 | `/elective``/elective/create``/elective/[id]/edit` |
| error-book | 1 | `/error-book`(✅ errorBookItems/Stats 真实契约) |
| exams | 9 | `/exams``/exams/all`(别名)、`/exams/new``/exams/create`(别名)、`/exams/[id]``/exams/[id]/analytics``/exams/[id]/build``/exams/[id]/edit``/exams/[id]/proctoring`(已补做) |
| grades | 5 | `/grades``/grades/analytics``/grades/entry``/grades/report-card``/grades/stats` |
| homework | 8 | `/homework``/homework/new``/homework/assignments/create`(别名)、`/homework/[id]``/homework/assignments/[id]/submissions``/homework/submissions``/homework/submissions/[submissionId]``/homework/submissions/[submissionId]/scan-grading` |
| knowledge-graph | 1 | `/knowledge-graph`B2末混合契约 knowledgePoint ✅) |
| leave | 1 | `/leave` |
| lesson-plans | 6 | `/lesson-plans``/lesson-plans/new``/lesson-plans/calendar``/lesson-plans/heatmap``/lesson-plans/library``/lesson-plans/[planId]/edit` |
| practice | 1 | `/practice` |
| questions | 1 | `/questions` |
| schedule-changes | 1 | `/schedule-changes` |
| students | 1 | `/students`(原 /classes/students 已迁到顶级) |
| textbooks | 2 | `/textbooks``/textbooks/[id]` |
详见 §二
> **注**:原"🟡 已完成但功能不完整"的 14 页dashboard、exams/page、exams/[id]、exams/new、exams/[id]/edit、exams/[id]/build、classes/[id]、classes/page、students、homework/[id]、homework/new、lesson-plans/[planId]/edit、grades/entry、attendance/sheet、diagnostic/class/[classId])均**已集成真实 client 组件**,按本次严格三态定义归入 ✅;其与 CICD 的功能差距见 §三.B§3.4-§3.18 保留原核查的详细对比分析)
### 🟡 占位空态3 页)
详见 §三.A§3.1-§3.3)。
### ❌ 缺失0 页)
教师域 63 个 page.tsx 全部存在,无缺失。
> **共享域说明**:原 `/shell/notifications` 与 `/shell/settings` 为 B1 共享页(非教师域独有),不属于本次教师域核查范围。如需补做,应在 `/shell/notifications/page.tsx` 与 `/shell/settings/page.tsx` 实现,供所有角色共用。
---
## 二、缺失页面清单
### 2.1 `/shell/teacher/exams/[id]/proctoring`(监考工作台)
### 2.1 教师域缺失页面
**无缺失**。教师域 63 个 page.tsx 全部存在。
### 2.2 已补做的原"缺失"页面(相对 2026-07-24 核查)
#### 2.2.1 `/shell/teacher/exams/[id]/proctoring`(监考工作台)— ✅ 已补做
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\teacher\exams\[id]\proctoring\page.tsx`
- **功能描述**:实时监考面板,包含 `ProctoringDashboard` 组件,并行拉取:
- `getExamForProctoring(id)` — 考试基础信息
- `getExamProctoringSummary(id)` — 监考汇总(应到/实到/异常数
- `getStudentProctoringStatuses(id)` — 学生实时状态列表
- `getRecentProctoringEvents(id, 20)` — 最近 20 条监考事件
- **技术栈**Server Component + `requirePermission(Permissions.EXAM_PROCTOR)` + `ProctoringDashboard` 客户端组件(实时 WS 推送)
- **ARCHITECTURE.md 契约**schema 无,需 WS 契约工单 + MSW 先行)
- **批次**B2 末二期WS
- **建议**:✅ 必须补做。需先定 WS 协议契约push-gateway再写 MSW mock最后实现 `ProctoringDashboard` 客户端组件。这是 B2末 明确规划页。
- **portal-shell 现状**`exams/[id]/proctoring/page.tsx` + `features/teacher/exams/proctoring-client.tsx`
- **实现状态**:✅ page.tsx 引入 `ProctoringClient``<Suspense fallback={<WorkbenchPageSkeleton />}>` 包裹client 组件使用 `useExamProctoring` / `useStudentProctoringStatuses` / `useRecentProctoringEvents` 三个 Apollo hook全 MSW 兜底);通过 5s 轮询模拟实时刷新,后端补齐 WS subscription 后切换。
- **ARCHITECTURE.md 契约**schema 无,需 WS 契约工单 + MSW 先行,已 MSW 兜底
- **批次**B2 末二期WS— MSW 阶段已完成,待 WS 契约就绪后切换。
### 2.2 `/shell/teacher/diagnostic/student/[studentId]`(学生诊断详情)
#### 2.2.2 `/shell/teacher/diagnostic/student/[studentId]`(学生诊断详情)— ✅ 已补做
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\teacher\diagnostic\student\[studentId]\page.tsx`
- **功能描述**:单个学生的学情诊断页,包含:
- `StudentDiagnosticView` 组件,渲染 `MasteryRadarPoint` 雷达图(学生 vs 班级平均对比)
- `getStudentMasterySummary(studentId)` — 学生掌握度汇总
- `getDiagnosticReports({ studentId }, ctx.dataScope)` — 诊断报告列表(教师可看草稿)
- `getKnowledgePointStats(studentClassId)` — 班级平均掌握度(雷达图对比)
- DataScope 二次校验:`class_taught` scope 验师生关系,`class_members`/`children` scope 限制访问
- **技术栈**Server Component + `requirePermission(Permissions.DIAGNOSTIC_READ)` + `WidgetBoundary` + `StudentDiagnosticView` 客户端组件
- **ARCHITECTURE.md 契约**:🟡(`diagnosticReports` ✅,但单生维度查询未明确)— **注意ARCH §9.1 仅规划 2 页(`/diagnostic` + `/diagnostic/class/[classId]`),未含学生维度**
- **批次**B2CICD 历史功能ARCH 未规划)
- **建议**:⚠️ 建议补做。虽 ARCH §9.1 未明确规划,但 CICD 已有完整实现且属于教师核心诊断场景(查看单个学生的掌握度雷达图 + 班级对比)。补做时需同步更新 ARCH §9.1 + 004。
- **portal-shell 现状**`diagnostic/student/[studentId]/page.tsx` + `features/teacher/diagnostic/student-diagnostic-client.tsx`
- **实现状态**:✅ page.tsx 引入 `StudentDiagnosticClient``<Suspense fallback={<DetailPageSkeleton />}>` 包裹client 组件使用 `useStudentDiagnostic` Apollo hookMSW 兜底)。
- **ARCHITECTURE.md 契约**:🟡 `diagnosticReports` ✅ schema 真实字段,单生维度查询未明确。
- **批次**B2CICD 历史功能ARCH §9.1 原未规划)— **需同步更新 ARCH §9.1 + 004 + arch.db**
### 2.3 `/shell/notifications`通知中心B1 共享
### 2.3 共享域缺口(非教师域核查范围,仅作记录
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\teacher\notifications\page.tsx`(教师角色入口)
- **功能描述**:通知中心,按 `userId` 拉取通知列表
- **技术栈**Server Component + `notifications(userId)` 查询
- **ARCHITECTURE.md 契约**:✅ `notifications(userId)` schema 已就绪
- **批次**B1共享所有角色共用
- **建议**:✅ 必须补做。B1 共享页schema 已就绪,缺页面入口。需在 `/shell/notifications/page.tsx` 实现,供教师/学生/家长/管理员共用。
| 路径 | 状态 | 说明 |
| ---------------------- | ------- | ------------------------------------------------------------------- |
| `/shell/notifications` | ❌ 缺失 | B1 共享,`notifications(userId)` ✅ schema 已就绪,需在共享域补页面 |
| `/shell/settings` | ❌ 缺失 | B1 共享,需在共享域补页面 |
### 2.4 `/shell/settings`设置B1 共享
### 2.4 不算缺失的"伪缺失"(路径合并/重定向/别名
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\teacher\settings\page.tsx`
- **功能描述**:用户设置页(个人资料、偏好、安全等)
- **技术栈**Server Component
- **ARCHITECTURE.md 契约**:✅
- **批次**B1共享
- **建议**:✅ 必须补做。B1 共享页,需在 `/shell/settings/page.tsx` 实现。
以下路径在 portal-shell 中通过路径合并、别名或等价入口覆盖,**不算缺失**
### 2.5 不算缺失的"伪缺失"(路径合并/重定向)
以下 CICD 路径在 portal-shell 中通过路径合并或等价入口覆盖,**不算缺失**
| CICD 路径 | portal-shell 等价 | 说明 |
| --------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `exams/page.tsx` | `/exams/page.tsx`(直接列表) | CICD 是 redirect 到 `/exams/all`portal-shell 直接渲染列表 |
| `exams/all/page.tsx` | `/exams/page.tsx`ExamsListClient | 同上,功能等价(但筛选/计数/分页有差距,见 §3.1 |
| `exams/create/page.tsx` | `/exams/new/page.tsx`NewExamClient | CICD 有 `/create`ExamForm 简单表单)+ `/new`ExamRichForm 富文本portal-shell 合并为 `/new`(简单表单),富文本编辑只在 `/[id]/edit`(见 §3.4 |
| `exams/grading/page.tsx` | 无CICD 自身是 redirect | CICD `grading/page.tsx``redirect("/teacher/homework/submissions")`,无实际功能 |
| `exams/grading/[submissionId]/page.tsx` | 无CICD 自身是 redirect | 同上,仅 redirect |
| `classes/page.tsx` | `/classes/page.tsx`ClassesListClient | CICD 是 redirect 到 `/classes/my`portal-shell 直接渲染列表 |
| `classes/my/page.tsx` | `/classes/page.tsx`ClassesListClient | 路径合并MyClassesGrid 改为 ClassesTable视觉差异功能等价 |
| `classes/my/[id]/page.tsx` | `/classes/[id]/page.tsx`ClassDetailClient | 路径合并,但功能差距大(见 §3.5 |
| `classes/students/page.tsx` | `/students/page.tsx`StudentsListClient | 路径从 `/classes/students` 迁到顶级 `/students`ARCH §9.1 规划),功能差距见 §3.6 |
| CICD 路径 | portal-shell 等价 | 说明 |
| --------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `exams/page.tsx` | `/exams/page.tsx`ExamsListClient | CICD 是 redirect 到 `/exams/all`portal-shell 直接渲染列表 + 同时保留 `/exams/all` 别名 |
| `exams/all/page.tsx` | `/exams/all/page.tsx`ExamsListClient 别名) | portal-shell 已补 `/exams/all` 别名复用 `ExamsListClient` |
| `exams/create/page.tsx` | `/exams/create/page.tsx`NewExamClient 别名) | portal-shell 已补 `/exams/create` 别名复用 `NewExamClient` |
| `classes/page.tsx` | `/classes/page.tsx`ClassesListClient | CICD 是 redirect 到 `/classes/my`portal-shell 直接渲染列表 + 同时保留 `/classes/my` 别名 |
| `classes/my/page.tsx` | `/classes/my/page.tsx`ClassesListClient 别名) | portal-shell 已补 `/classes/my` 别名复用 `ClassesListClient` |
| `classes/my/[id]/page.tsx` | `/classes/my/[id]/page.tsx`ClassDetailClient 别名) | portal-shell 已补 `/classes/my/[id]` 别名复用 `ClassDetailClient` |
| `classes/students/page.tsx` | `/students/page.tsx`StudentsListClient + `/classes/students/page.tsx`(🟡 占位) | 路径从 `/classes/students` 迁到顶级 `/students`ARCH §9.1 规划);旧路径保留为占位页(见 §3.1 |
| `homework/assignments/create/page.tsx` | `/homework/assignments/create/page.tsx`NewHomeworkClient 别名) | portal-shell 已补 `/homework/assignments/create` 别名复用 `NewHomeworkClient` |
| `exams/grading/page.tsx` | CICD 自身是 redirect | CICD `grading/page.tsx``redirect("/teacher/homework/submissions")`portal-shell 保留为占位页(见 §3.2 |
| `exams/grading/[submissionId]/page.tsx` | 无CICD 自身是 redirect | 同上,仅 redirectportal-shell 保留为占位页(见 §3.3 |
---
## 三、功能不完整的页面
## 三、占位空态页面 + 与 CICD 功能差距
### 3.1 exams - 考试列表页 `/shell/teacher/exams`
> 本节分两部分:
>
> - **§三.A§3.1-§3.3**3 个**真占位页**(仅 page-templates 渲染空态,无 client 组件集成)— **本次核查最优先补做项**
> - **§三.B§3.4-§3.18**15 个**已集成 client 但与 CICD 有功能差距**的页面 — 保留原 §3.1-§3.15 详细对比分析
- **路径**`/shell/teacher/exams`
- **portal-shell 实现**`exams/page.tsx` + `features/teacher/exams/exams-list-client.tsx`
- **CICD 实现**`exams/all/page.tsx` + `exam-filters.tsx` + `ExamDataTable` + `ExamFilters`
- **已有功能**
- 关键词搜索q、状态筛选status、客户端二次筛选
- 简单表格展示title/status/examDate/duration/totalScore/actions
- 状态徽章、新建按钮、EmptyState、ListPageShell 骨架
- ✅ 真实查询 `useExams(classId)`classId 默认 `cls-001`MSW 兜底)
- **缺失功能**
-**难度筛选**difficulty filter— CICD 有 difficulty 维度筛选
-**状态计数徽章**draft/published/archived 三个 Badge + 数字)— CICD 顶部统计栏
-**真正的分页控件** — portal-shell 仅显示 `total: N`无分页器CICD `ExamDataTable` 内置分页
-**高级 DataTable 组件** — CICD 用 `ExamDataTable`(含排序/列控制/分页portal-shell 是手写 `<table>`
-**EmptyState "清除筛选" action** — CICD 在有筛选时显示"清除筛选"按钮回到 `/exams/all`portal-shell 无
-**服务端筛选** — CICD 在 Server Component 内调 `getExams({ q, status, difficulty, scope })`portal-shell 是客户端二次过滤
-**DataScope 过滤** — CICD 用 `ctx.dataScope` 做权限过滤portal-shell 无
- **技术差距**
- CICDServer Component + Drizzle `getExams` + `ExamDataTable` + `ExamFilters` 组件
- portal-shell 需补:分页器组件、状态计数 Badge 行、difficulty 筛选 select、EmptyState clearFilters action、后续契约就绪后改服务端筛选
### 三.A 占位空态页面3 页P0 优先补做)
### 3.2 exams - 考试详情页 `/shell/teacher/exams/[id]`
#### 3.1 `/shell/teacher/classes/students`(班级学生列表占位)
- **路径**`/shell/teacher/exams/[id]`
- **portal-shell 实现**`exams/[id]/page.tsx` + `features/teacher/exams/exam-detail-client.tsx`
- **CICD 实现****CICD 无此页面**CICD `/exams/[id]/` 目录下只有 analytics/build/edit-rich/proctoring 子路由,无 `page.tsx`
- **已有功能**
- ✅ 真实查询 `useExam(examId)`schema 已就绪)
- 基本信息区title/description/examDate/duration/totalScore/classId/subjectId
- 状态信息区currentStatus/statusChangedAt/statusChangedBy/createdBy/createdAt/updatedAt
- 编辑按钮status 可编辑时显示,但 onClick 无路由跳转,**按钮无实际行为**
- **缺失功能**
- ⚠️ **编辑按钮未接路由**`<Button variant="outline">{t("detail.edit")}</Button>``asChild` / `href` / `onClick`,点击无反应,应跳 `/shell/teacher/exams/[id]/edit`
- 💡 **无提交列表预览** — CICD 在 homework 详情有提交列表exam 详情可考虑加 submissions 摘要CICD 无此页,属增量)
- 💡 **无分析入口卡片** — 可加"查看分析"快捷入口跳 `/analytics`
- **技术差距**
- 编辑按钮需补 `asChild` + `<Link href=".../edit">`
- ARCH §9.1 规划此页为 M 详情页portal-shell 已满足基本契约,但交互不完整
- **路径**`/shell/teacher/classes/students`
- **page.tsx 实现**
### 3.3 exams - 新建考试表单 `/shell/teacher/exams/new`
```tsx
import { ListPageShell } from "@/shared/components/page-templates";
- **路径**`/shell/teacher/exams/new`
- **portal-shell 实现**`exams/new/page.tsx` + `features/teacher/exams/new-exam-client.tsx`
- **CICD 实现**`exams/new/page.tsx`ExamRichForm 富文本)+ `exams/create/page.tsx`ExamForm 简单)
- **已有功能**
- 简单表单classId/subjectId/title/description/examDate/duration/totalScore
- 内联校验classId/title/examDate 必填)
- ✅ mutation `useCreateExam` MSW 兜底
- 成功后 `router.push` 回列表
- **缺失功能**
-**富文本编辑器** — CICD `/exams/new``ExamRichForm`(含 Tiptap 富文本 + 题目结构portal-shell 是纯字段表单
-**班级/科目下拉选择器** — portal-shell 用 `<input type="text">`CICD 应为 selectCICD ExamRichForm 内部)
- 💡 **题目结构编辑** — CICD 富文本编辑器支持插入题目占位、分值、排序
- **技术差距**
- CICD`ExamRichForm` 客户端组件Tiptap + 结构化节点)
- portal-shell 把 CICD 的 `/exams/new`rich+ `/exams/create`basic合并为 `/exams/new`basic富文本能力下沉到 `/[id]/edit`
- **是否补做**:取决于产品决策。若新建时即需富文本,需补 Tiptap若新建只创建元数据、富文本在编辑页做则当前实现可接受
export default function ClassStudentsPage(): React.ReactElement {
return (
<ListPageShell title="班级学生" description="查看各班级学生名单" empty />
);
}
```
### 3.4 exams - 富文本试卷编辑 `/shell/teacher/exams/[id]/edit`
- **当前状态**:🟡 占位空态,仅 `ListPageShell` + `empty` 属性,无 children 内容,无 client 组件集成。
- **已有但未集成的组件**:❌ 无。`features/teacher/classes/` 仅有 `class-detail-client.tsx`、`class-schedule-client.tsx`、`classes-list-client.tsx`**无 `class-students-client.tsx`**。
- **可用资源**
- lib/api`lib/api/classes.ts` 有 `useClassStudents(classId)` hook
- mocks`graphql-data.ts` 有 `ClassStudents` mock 数据集
- 同域可复用:`/students/page.tsx` 已实现 `StudentsListClient`顶级路由ARCH §9.1 已迁出)
- **需要补全的内容**
1. **方案 A推荐**:删除 `/classes/students/page.tsx`,统一使用顶级 `/students`ARCH §9.1 已规划迁移)
2. **方案 B兼容旧路径**:改为 `redirect("/shell/teacher/students")` 重定向到顶级路由
3. **方案 C保留独立功能**:新建 `features/teacher/classes/class-students-client.tsx`,按 `classId` 查询展示某班学生名单(不同于顶级 `/students` 的全校学生视图)
- **建议**:方案 B重定向。ARCH §9.1 已明确迁移到顶级 `/students`,保留旧路径作为重定向入口即可,无需重复实现。
- **路径**`/shell/teacher/exams/[id]/edit`(对应 CICD `/exams/[id]/edit-rich`
- **portal-shell 实现**`exams/[id]/edit/page.tsx` + `features/teacher/exams/exam-edit-client.tsx`
- **CICD 实现**`exams/[id]/edit-rich/page.tsx` + `ExamRichForm` + `examNodesToEditorDoc` + `structureToEditorDoc`
- **已有功能**
- 三栏工作台:中栏富文本编辑器 + 右栏属性面板examId/totalScore/questionCount/updatedAt
- 工具栏B/I/U/H1/H2/H3/列表/P
- `useExamRichEditor` + `useSaveExamRichContent` MSW 兜底
- 保存为 HTML`editorRef.current.innerHTML`
- **缺失功能**
-**真正的 Tiptap 编辑器** — portal-shell 用 `contentEditable` + `document.execCommand`**deprecated**CICD 用 Tiptap JSON 结构化文档
-**题目结构加载** — CICD 在 Server Component 内调 `getExamById` + `getQuestions`,把 `exam.structure` + `questions` 转换为 `EditorDoc``examNodesToEditorDoc` + `structureToEditorDoc`portal-shell 完全无此逻辑
-**题目占位符插入** — CICD 富文本支持插入题目节点(含 order/options/contentportal-shell 仅纯文本 HTML
-**服务端初始数据预加载** — CICD Server Component 预加载 exam + questionsportal-shell 纯客户端 MSW
-**编辑模式 (mode="edit")** — CICD `ExamRichForm` 支持 create/edit 双模式portal-shell 仅 edit
- ⚠️ **dangerouslySetInnerHTML** — portal-shell 用 `dangerouslySetInnerHTML` 注入 HTML违反 §4 安全规范(如必须使用,先用 DOMPurify 清洗)
- **技术差距**
- CICDServer Component + Tiptap + `examNodesToEditorDoc`/`structureToEditorDoc` 转换层 + `ExamRichForm`
- portal-shell 需补:引入 Tiptap或 Lexical、编写 structure→EditorDoc 转换、Server Component 预加载、题目节点类型、DOMPurify 清洗
#### 3.2 `/shell/teacher/exams/grading`(阅卷列表占位
### 3.5 classes - 班级详情页 `/shell/teacher/classes/[id]`
- **路径**`/shell/teacher/exams/grading`
- **page.tsx 实现**
- **路径**`/shell/teacher/classes/[id]`(对应 CICD `/classes/my/[id]`
- **portal-shell 实现**`classes/[id]/page.tsx` + `features/teacher/classes/class-detail-client.tsx`
- **CICD 实现**`classes/my/[id]/page.tsx` + 5 个 widget 组件
- **已有功能**
- ✅ 真实查询 `useClassInfo(classId)`schema 已就绪)
- 基本信息区name/gradeId/headTeacherId/description/createdAt/updatedAt
- 学生名单区studentNo/name/enrolledAtMSW 兜底)
- 任课老师区name/subjectName/roleMSW 兜底)
- **缺失功能**
-**ClassHeader** — CICD 有独立头部组件classId/name/grade/homeroom/room/schoolName/studentCount
-**ClassOverviewStats 概览统计** — 平均分、提交率、待批改数papersToGrade、逾期数overdueCount
-**ClassTrendsWidget 趋势 widget** — 作业趋势列表id/title/status/subject/isActive/isOverdue/dueAt/submittedCount/targetCount/avgScore/medianScore
-**ClassScheduleWidget 课表 widget** — 班级课表展示
-**ClassAssignmentsWidget 作业 widget** — 班级作业列表
-**学生科目成绩展示** — CICD 通过 `getClassStudentSubjectScoresV2` 拉取每个学生的科目成绩portal-shell 学生表只有 studentNo/name/enrolledAt
-**三栏布局** — CICD 是 2/3 主区 + 1/3 侧栏portal-shell 是单栏 DetailSection 堆叠
-**服务端并行数据预加载** — CICD `Promise.all([getClassHomeworkInsights, getClassStudents, getClassSchedule, getClassStudentSubjectScoresV2])`
- **技术差距**
- CICDServer Component + 4 个并行 data-access 查询 + 5 个 widget 组件 + `SectionErrorBoundary`
- portal-shell 需补5 个 widget 组件、4 个 data-access 查询(含 MSW 兜底)、三栏布局、概览统计计算逻辑
```tsx
import { ListPageShell } from "@/shared/components/page-templates";
### 3.6 students - 学生列表页 `/shell/teacher/students`
export default function ExamGradingPage(): React.ReactElement {
return (
<ListPageShell
title="阅卷列表"
description="查看待批阅的考试提交"
empty
/>
);
}
```
- **路径**`/shell/teacher/students`(对应 CICD `/classes/students`
- **portal-shell 实现**`students/page.tsx` + `features/teacher/students/students-list-client.tsx`
- **CICD 实现**`classes/students/page.tsx` + `StudentsFilters` + `StudentsTable` + `students-filters.tsx`
- **已有功能**
- 关键词搜索q、classId/gradeId 筛选(**纯 text input**
- 表格studentNo/name/gender/className/gradeId/enrolledAt
- 性别徽章、EmptyState、ListPageShell
- **缺失功能**
-**班级下拉选择器** — CICD 用 `StudentsFilters` 组件(含 `<select>` 班级列表portal-shell 用 `<input type="text">` 让用户手输 classId
-**默认班级选择逻辑** — CICD 默认选中教师第一个班级(`defaultClassId = classes[0].id`portal-shell 无默认
-**学生科目成绩展示** — CICD 调 `getStudentsSubjectScores(studentIds)` 拉取每个学生科目成绩,`StudentsTable` 有科目成绩列portal-shell 无
-**服务端学生列表预加载** — CICD Server Component 调 `getClassStudents` + `getStudentsSubjectScores`portal-shell 纯客户端 MSW
-**状态筛选** — CICD 有 status 维度筛选active/inactive 等portal-shell 无
- **技术差距**
- CICDServer Component + `getTeacherClasses` + `getClassStudents` + `getStudentsSubjectScores` + `StudentsFilters`/`StudentsTable` 组件
- portal-shell 需补:班级 select 组件、默认班级逻辑、科目成绩列、status 筛选
- **当前状态**:🟡 占位空态,仅 `ListPageShell` + `empty` 属性,无 children无 client 组件。
- **已有但未集成的组件**:❌ 无。`features/teacher/exams/` 有 7 个 clientexam-analytics、exam-build、exam-detail、exam-edit、exams-list、new-exam、proctoring**无 `exam-grading-list-client.tsx`**。
- **可用资源**
- lib/api`lib/api/exams.ts` 有相关 hook`lib/api/homework.ts` 有 `useHomeworkSubmissions` hook
- mocks`graphql-data.ts` 有 `HomeworkSubmissions`、`ExamDetail` 等 mock 数据集
- CICD 行为CICD `exams/grading/page.tsx` 仅 `redirect("/teacher/homework/submissions")`,无实际功能
- **需要补全的内容**
1. **方案 A与 CICD 一致)**:改为 `redirect("/shell/teacher/homework/submissions")` 重定向到作业提交列表
2. **方案 B实现独立阅卷入口**:新建 `features/teacher/exams/exam-grading-list-client.tsx`,展示待批阅的考试提交(区分于作业提交)
- **建议**:方案 A重定向。与 CICD 行为一致,避免重复实现;如产品需要独立的"考试阅卷"入口(区分于作业批改),再按方案 B 补做。
### 3.7 homework - 作业详情页 `/shell/teacher/homework/[id]`
#### 3.3 `/shell/teacher/exams/grading/[submissionId]`(阅卷详情占位)
- **路径**`/shell/teacher/homework/[id]`(对应 CICD `/homework/assignments/[id]`
- **portal-shell 实现**`homework/[id]/page.tsx` + `features/teacher/homework/homework-detail-client.tsx`
- **CICD 实现**`homework/assignments/[id]/page.tsx` + `HomeworkAssignmentQuestionErrorOverviewCard` + `HomeworkAssignmentExamContentCard`
- **已有功能**
- ✅ 真实查询 `useHomework(homeworkId)`schema 已就绪)
- 基本信息区title/description/dueDate/gracePeriod/status/classId/subjectId/createdBy/updatedAt
- 提交列表区studentName/studentNo/status/submittedAt/totalScore/maxScore/actionsMSW 兜底)
- 内联批改表单studentId/score/feedbackMSW 兜底)
- 跳转"查看所有提交"按钮 → `/homework/assignments/[id]/submissions`
- **缺失功能**
-**头部统计行** — CICD 头部有 dueDate/targetCount/submissionCount/gradedCount 四个统计指标portal-shell 无
-**HomeworkAssignmentQuestionErrorOverviewCard 题目错误概览卡片** — CICD 用 `getHomeworkAssignmentAnalytics(id)` 拉取每题错误率,渲染分析卡片(带 Suspense + SectionErrorBoundary
-**HomeworkAssignmentExamContentCard 作业内容卡片** — CICD 渲染 `assignment.structure` + `questions`(含 gradedSampleCountportal-shell 无作业内容展示
-**服务端 analytics 预加载** — CICD 调 `getHomeworkAssignmentAnalytics(id)` 返回 `{ assignment, questions, gradedSampleCount }`
-**流式渲染** — CICD 用 `<Suspense fallback={<AnalyticsSkeleton />}>` 包裹 analytics 卡片portal-shell 无
- **技术差距**
- CICDServer Component + `getHomeworkAssignmentAnalytics` + 2 个分析卡片组件 + `SectionErrorBoundary` + Suspense 流式
- portal-shell 需补题目错误概览卡片、作业内容卡片structure + questions 渲染、头部统计、analytics 查询
- **路径**`/shell/teacher/exams/grading/[submissionId]`
- **page.tsx 实现**
### 3.8 homework - 布置作业表单 `/shell/teacher/homework/new`
```tsx
import { DetailPageShell } from "@/shared/components/page-templates";
- **路径**`/shell/teacher/homework/new`(对应 CICD `/homework/assignments/create`
- **portal-shell 实现**`homework/new/page.tsx` + `features/teacher/homework/new-homework-client.tsx`
- **CICD 实现**`homework/assignments/create/page.tsx` + `HomeworkAssignmentForm`
- **已有功能**
- 简单表单classId/subjectId/title/description/dueDate/gracePeriod
- 内联校验、MSW 兜底 mutation `useAssignHomework`
- 成功后回列表
- **缺失功能**
-**关联考试选择** — CICD Server Component 调 `getExams({ scope })` 拉取考试列表,传给 `HomeworkAssignmentForm` 作下拉选项作业可基于试卷结构生成portal-shell 无 examId 字段
-**班级下拉选择器** — CICD 调 `getTeacherClasses()` 拉取班级portal-shell 用 `<input type="text">` 手输 classId
-**EmptyState when no classes** — CICD 在 `classes.length === 0` 时显示 EmptyState 提示"无可用班级,去班级管理"portal-shell 无
-**HomeworkAssignmentForm 富表单** — CICD 用专门组件(含 exam 关联、班级 select、可能含题目结构选择
- **技术差距**
- CICDServer Component + `getExams` + `getTeacherClasses` + `HomeworkAssignmentForm` 组件 + EmptyState
- portal-shell 需补examId 字段 + 考试下拉、班级下拉、无班级 EmptyState
/**
* 阅卷详情页ARCHITECTURE.md §7.3 详情页 / §9.1 / §10 P2
*
* Server Component 入口:使用 DetailPageShell 直接渲染。
* 通过 /shell/teacher/exams/grading/[submissionId] 路由定位具体提交,
* 后续可接入阅卷专属 client component 进行逐题评分。
*
* 数据契约submission(id) schema 无, MSW 兜底(@contract-pending
*
* 关联ARCHITECTURE.md §5.3 / §5.4 / §7.3 / §9.1 / §10 P2 / §11.3 / §11.4
*/
export default function ExamGradingDetailPage(): React.ReactElement {
return (
<DetailPageShell
title="阅卷详情"
description="批阅学生考试提交"
backHref="/shell/teacher/exams/grading"
/>
);
}
```
### 3.9 lesson-plans - 教案编辑工作台 `/shell/teacher/lesson-plans/[planId]/edit`
- **当前状态**:🟡 占位空态,仅 `DetailPageShell` + `title/description/backHref`,无 children无 client 组件。
- **已有但未集成的组件**:❌ 无。`features/teacher/exams/` 无阅卷详情 client阅卷能力当前在 `features/teacher/homework/submission-grading-client.tsx`(已被 `/homework/submissions/[submissionId]` 集成)。
- **可用资源**
- lib/api`lib/api/homework.ts` 有 `useSubmissionDetail(submissionId)` / `useGradeSubmission` hook
- mocks`graphql-data.ts` 有 `SubmissionDetail`、`HomeworkSubmissions` mock 数据集
- 同域可复用:`/homework/submissions/[submissionId]/page.tsx` 已实现 `SubmissionGradingClient`(含逐题评分、批注、自动判分、保存草稿)
- CICD 行为CICD `exams/grading/[submissionId]/page.tsx` 仅 `redirect("/teacher/homework/submissions")`注意CICD 未保留 submissionId 参数,会丢失上下文)
- **需要补全的内容**
1. **方案 A推荐优于 CICD**:改为重定向到 `/shell/teacher/homework/submissions/[submissionId]`,保留 submissionId 参数(修复 CICD 丢失参数的问题)
2. **方案 B实现独立阅卷详情**:新建 `features/teacher/exams/exam-grading-detail-client.tsx`,对接 `useSubmissionDetail` hook 实现考试阅卷专属视图(区别于作业批改)
- **建议**:方案 A重定向并保留参数。与 CICD 行为一致但修复其缺陷;如产品需要独立的考试阅卷详情视图(区分于作业批改),再按方案 B 补做。
- **路径**`/shell/teacher/lesson-plans/[planId]/edit`
- **portal-shell 实现**`lesson-plans/[planId]/edit/page.tsx` + `features/teacher/lesson-plans/lesson-plan-edit-client.tsx`
- **CICD 实现**`lesson-plans/[planId]/edit/page.tsx` + `LessonPlanEditor` + `LessonPlanProviderSetup` + `AiClientProvider`
- **已有功能**
- 三栏工作台左栏大纲树LessonPlanOutlineTree+ 中栏富文本编辑器 + 右栏属性面板id/grade/subject/duration/status/updatedAt/resources
- 工具栏B/I/U/H1/H2/H3/列表/P
- `useLessonPlan` + `useUpdateLessonPlan` MSW 兜底
- 保存为 HTML
- **缺失功能**
-**真正的 Tiptap 编辑器** — portal-shell 用 `contentEditable` + `document.execCommand`**deprecated**CICD 用 `LessonPlanEditor`Tiptap
-**AI 集成** — CICD 包 `<AiClientProvider service={createCoreAiClientService()}>`,支持 AI 辅助生成/润色portal-shell 无
-**教材/章节上下文** — CICD Server Component 调 `getTextbookById` + `getChaptersByTextbookId` + `findChapterById`,把 textbookTitle/chapterTitle 传给编辑器工具栏显示portal-shell 无
-**LessonPlanProviderSetup** — CICD 有专门的 Provider 设置组件注入编辑器所需上下文portal-shell 无
-**服务端初始数据预加载** — CICD Server Component 预加载 plan + teacherClasses + textbook + chapterportal-shell 纯客户端 MSW
-**班级关联** — CICD 加载 `getTeacherClasses({ teacherId })` 传给编辑器教案可关联班级portal-shell 无
- ⚠️ **dangerouslySetInnerHTML** — 同 §3.4,违反 §4 安全规范
- **技术差距**
- CICDServer Component + Tiptap + AiClientProvider + LessonPlanProviderSetup + 4 个 data-access 查询
- portal-shell 需补Tiptap、AiClientProvider 接入、教材/章节加载、Provider 设置、班级关联、DOMPurify 清洗
### 三.A 小结:占位页共性特征
### 3.10 grades - 成绩录入页 `/shell/teacher/grades/entry`
3 个占位页的共性:
- **路径**`/shell/teacher/grades/entry`
- **portal-shell 实现**`grades/entry/page.tsx` + `features/teacher/grades/grade-entry-client.tsx`
- **CICD 实现**`grades/entry/page.tsx` + `BatchGradeEntryByExam` 组件
- **已有功能**
- **单学生单次录入**表单classId/studentId/examId/homeworkId/score/totalScore/feedback
- 内联校验、MSW 兜底 mutation `useCreateGrade`
- **缺失功能**
-**批量录入** — CICD 用 `BatchGradeEntryByExam` 组件,按考试批量录入全班成绩(一次选 exam + class列出所有学生逐题/逐生录入portal-shell 是单生单次
-**考试下拉选择器** — CICD 调 `getExamsForGradeEntry(ctx.dataScope)` 拉取可录入成绩的考试列表portal-shell 用 `<input type="text">` 手输 examId
-**班级下拉选择器** — CICD 调 `getTeacherClasses()` + scope 过滤 + `getClassGradeIdsByClassIds` 构建 classGradeMap用于按试卷年级过滤班级portal-shell 手输 classId
-**学生列表预加载** — CICD 调 `getClassStudentsForEntry(classId, ctx.dataScope)` 拉取班级学生portal-shell 手输 studentId
-**考试题目列表** — CICD 调 `getExamForGradeEntry(examId, ctx.dataScope)` 返回试卷详情含题目,支持按题录入
-**DataScope 过滤** — CICD 用 `ctx.dataScope.type === "class_taught"` 过滤班级portal-shell 无权限过滤
-**EmptyState when no exams** — CICD 在 `exams.length === 0` 时显示 EmptyState
-**按试卷年级过滤班级** — CICD 用 classGradeMap 客户端过滤
- **技术差距**
- CICDServer Component + 4 个 data-access 查询 + `BatchGradeEntryByExam` 客户端组件 + DataScope
- portal-shell 需补:批量录入组件、考试/班级下拉、学生列表、题目列表、scope 过滤、EmptyState
### 3.11 attendance - 考勤点名表 `/shell/teacher/attendance/sheet`
- **路径**`/shell/teacher/attendance/sheet`
- **portal-shell 实现**`attendance/sheet/page.tsx` + `features/teacher/attendance/attendance-sheet-client.tsx`
- **CICD 实现**`attendance/sheet/page.tsx` + `AttendanceSheet` 组件
- **已有功能**
- classId**text input**+ date 选择
- 学生表格studentName/status 按钮组/remark
- 4 种状态PRESENT/ABSENT/LATE/LEAVE点击切换
- MSW 兜底 `useAttendanceSheet` + `useSaveAttendanceSheet`
- 保存后回列表
- **缺失功能**
-**班级下拉选择器** — CICD Server Component 调 `getTeacherClasses()` 拉取班级,传给 `AttendanceSheet` 组件作下拉portal-shell 用 `<input type="text">` 手输 classId
-**服务端学生列表预加载** — CICD 调 `getClassStudentsForAttendance(defaultClassId)` 服务端预加载学生portal-shell 完全依赖 MSW mock
-**AttendanceSheet 组件** — CICD 有专门的客户端组件含班级切换、日期选择、批量标记、统计汇总portal-shell 是手写表格
- **技术差距**
- CICDServer Component + `getTeacherClasses` + `getClassStudentsForAttendance` + `AttendanceSheet` 客户端组件
- portal-shell 需补:班级 select、服务端学生预加载、AttendanceSheet 组件
### 3.12 diagnostic - 班级诊断详情 `/shell/teacher/diagnostic/class/[classId]`
- **路径**`/shell/teacher/diagnostic/class/[classId]`
- **portal-shell 实现**`diagnostic/class/[classId]/page.tsx` + `features/teacher/diagnostic/diagnostic-class-detail-client.tsx`
- **CICD 实现**`diagnostic/class/[classId]/page.tsx` + `ClassDiagnosticView` + `DiagnosticServiceProvider` + `DiagnosticMonitorProvider`
- **已有功能**
- 基本信息区title/reportType/status/className/studentCount/avgScore/summary/generatedAt
- 薄弱知识点表格kpTitle/mastery/errorCount
- 教学建议列表recommendations
- MSW 兜底 `useDiagnosticReport(classId)`
- **缺失功能**
-**ClassDiagnosticView 富视图组件** — CICD 用专门的 `ClassDiagnosticView`(含掌握度雷达图、知识点 drill-down、学生分布等丰富交互portal-shell 是基础详情页
-**DiagnosticServiceProvider** — CICD 注入诊断服务上下文(支持客户端 drill-down 查询portal-shell 无
-**DiagnosticMonitorProvider + 监控埋点** — CICD 用 `createMonitoredDiagnosticService(defaultDiagnosticService, noopDiagnosticMonitor)` 包装服务支持生产环境监控注入portal-shell 无
-**服务端数据预加载** — CICD Server Component 调 `getClassMasterySummary(classId)` 预加载portal-shell 纯客户端 MSW
-**DataScope 校验** — CICD 校验 `class_taught` scope教师只能查所教班级拒绝 `class_members`/`children` scopeportal-shell 无
-**WidgetBoundary** — CICD 用 `WidgetBoundary` 包裹局部降级portal-shell 用 DetailPageShell
- **技术差距**
- CICDServer Component + `getClassMasterySummary` + `ClassDiagnosticView` + Diagnostic Service Provider/Monitor + DataScope
- portal-shell 需补ClassDiagnosticView 组件、DiagnosticServiceProvider/MonitorProvider、服务端预加载、DataScope 校验、WidgetBoundary
### 3.13 dashboard - 教师仪表盘 `/shell/teacher`teacher/page.tsx
- **路径**`/shell/teacher`(根教师页)
- **portal-shell 实现**`shell/teacher/page.tsx`"use client"
- **CICD 实现**`dashboard/page.tsx`Server Component+ `TeacherDashboardView`
- **已有功能**
- 4 StatCardtotal_classes/total_students/class_avg_score/pending_homework_count
- 班级概况区class_name/student_count/average_score
- 近期预警区target_name/severity/warning_type/current_value/threshold
- ✅ 真实查询 `useTeacherDashboard`data-ana 聚合查询)
- loading/error 三态处理
- **缺失功能**
- ⚠️ **i18n 硬编码** — portal-shell 标题/描述用硬编码中文(`"教师仪表盘"``"今日教学概览"``"班级总数"` 等),违反 §3.10 设计令牌规范的 i18n 要求,应改 `useTranslations("dashboard")`CICD 用 `getTranslations("dashboard")`
-**流式渲染** — CICD Server Component 用 `getTeacherDashboardAction()` 返回未解析 Promise + `<TeacherDashboardView dataPromise={...}>`,视图内 `use()` 消费 + Suspense 流式渲染portal-shell 是客户端整体 loading
-**TeacherDashboardView 富视图** — CICD 用专门的 `TeacherDashboardView` 组件(可能含更多 widget课表/作业/考试/学生预警等portal-shell 仅 4 StatCard + 2 简单列表
-**更多 widget** — CICD 可能含课表、作业待批、考试安排、学生预警等 widget需读 TeacherDashboardView 确认portal-shell 仅基础展示
- **技术差距**
- CICDServer Component + Server Action + Suspense 流式 + `TeacherDashboardView` 组件
- portal-shell 需补i18n 化、TeacherDashboardView 组件、流式渲染、更多 widget待确认
### 3.14 classes - 班级列表页 `/shell/teacher/classes`(轻量不完整)
- **路径**`/shell/teacher/classes`
- **portal-shell 实现**`classes/page.tsx` + `features/teacher/classes/classes-list-client.tsx`
- **CICD 实现**`classes/my/page.tsx` + `MyClassesGrid` 组件
- **已有功能**
- ✅ 真实查询 `useClasses({ gradeId, subjectId, q })`MSW 兜底)
- 三筛选q/gradeId/subjectId、表格name/grade/headTeacher/studentCount/subjectCount/description/updatedAt/actions
- EmptyState、ListPageShell
- **缺失功能**
- ⚠️ **MyClassesGrid 卡片网格视图** — CICD 用 `MyClassesGrid` 组件卡片式展示portal-shell 用表格,视觉差异(功能等价,不算重大缺失)
- ⚠️ **subjectOptions 预加载** — CICD 调 `getClassSubjects()` 拉取科目选项作下拉portal-shell 用 text input
- ⚠️ **SectionErrorBoundary** — CICD 用 `SectionErrorBoundary` 包裹portal-shell 用 errorNode
- **技术差距**:较小,主要是视觉/组件差异,功能基本等价
### 3.15 exams - 试卷组卷工作台 `/shell/teacher/exams/[id]/build`
- **路径**`/shell/teacher/exams/[id]/build`
- **CICD 参考实现**`e:\desktop\CICD\src\app\(dashboard)\teacher\exams\[id]\build\page.tsx` + 同目录 `error.tsx` + `loading.tsx`
- **功能描述**试卷组卷工作台CICD 为 Server Component 入口(`export const dynamic = "force-dynamic"`
- `requirePermission(Permissions.EXAM_READ)` 权限校验,拿到 `ctx.dataScope`
- `getExamById(id, ctx.dataScope)` 拉取考试元数据(含 `questions` + `structure`),不存在则 `notFound()`
- `Promise.all` 并行拉取题库前 20 条(`getQuestions({ pageSize: 20 })`+ 已选题目详情(`getQuestions({ ids: selectedQuestionIds })`
- `questionOptionsById` Map 去重合并 bank + selected 题目为 `questionOptions`
- `normalizeStructure(exam.structure)``exam.structure` 规范化为 `ExamNode[]` 树(支持嵌套分组节点)
- structure 空但 `initialSelected` 非空时回退为扁平节点列表(用 `@paralleldrive/cuid2` `createId()` 生成节点 ID
- `createCoreAiClientService()` 创建 AI 服务,`<AiClientProvider>` 注入 AI 上下文
- 渲染 `<ExamAssembly>` 富组件(位于 `modules/exams/components/exam-assembly`),透传 examId/title/subject/grade/difficulty/totalScore/durationMin + initialSelected + initialStructure + questionOptions
- 配套 `error.tsx``useErrorReport` 错误上报 + `EmptyState` + retry 按钮)+ `loading.tsx`3 栏 Skeleton`lg:grid-cols-3` 2+1 布局)
- **技术栈**Next.js App Router Server Component`force-dynamic`+ next-intl `getTranslations("examHomework.exam.build")` + `requirePermission` + `Permissions.EXAM_READ` + `ctx.dataScope` 数据范围过滤 + Drizzle data-access`getExamById` / `getQuestions`+ `normalizeStructure` 转换层 + `@paralleldrive/cuid2` + AI 集成(`AiClientProvider` + `createCoreAiClientService`+ `ExamAssembly` 客户端组件 + 专用 error/loading 边界
- **ARCHITECTURE.md 契约**B2— portal-shell `page.tsx` 注释明确 `@contract-pending``examBuild(examId)` / `questionsLibrary(filter)` / `saveExamBuild(input)` 三个根字段均不存在,全 MSW 兜底
- **portal-shell 现状**
- `page.tsx``<Suspense fallback={<WorkbenchPageSkeleton />}>` 包裹 `ExamBuildClient`**无服务端预加载、无权限守卫、无 notFound**
- `ExamBuildClient` 纯客户端,使用 `useExamBuild` / `useQuestionsLibrary` / `useSaveExamBuild` 三个 Apollo hook全 MSW 兜底)
- `WorkbenchPageShell` 三栏布局:左 `QuestionsLibraryPanel` / 中 `SelectedQuestionsPanel` / 右 `PreviewPanel`
- 左栏q 关键词 + type 下拉 + difficulty 下拉筛选 + 题目列表 + 添加按钮(`Plus` 图标)+ 总数显示
- 中栏:已选题目列表,支持上移/下移(`↑`/`↓`/编辑分值(`Input type="number"`/移除(`Trash2`
- 右栏:总分(含 baseline 差值 ± 提示amber/destructive 配色)+ 及格分 + 题型分布(`countByType`
- 本地 `useState<ExamBuildNode[] | null>` 管理 selected`useEffect` 在 data 首次就绪时初始化(`sortBySortOrder`
- 保存 mutation `useSaveExamBuild` + `notify.success/error` 反馈
- 三态合并到 `errorNode`error + empty 共用降级节点)
- **无专用 error.tsx / loading.tsx 文件**
- **缺失功能**
-**Server Component 数据预加载** — CICD 在服务端并行 `Promise.all` 拉取 exam + bank questions + selected questionsportal-shell 完全依赖客户端 MSW
-**DataScope 权限过滤** — CICD 用 `ctx.dataScope` 过滤考试可见性portal-shell 无
-**`requirePermission(Permissions.EXAM_READ)` 权限守卫** — portal-shell 无
-**`notFound()` 404 处理** — CICD 考试不存在时调 `notFound()`portal-shell 显示空态节点
-**AI 集成** — CICD 包 `<AiClientProvider service={createCoreAiClientService()}>` 支持 AI 辅助组卷portal-shell 无 AI 接入(与 §3.9 教案编辑同类型缺失,见 §六 共性技术债 6
-**`normalizeStructure` 转换层** — CICD 把 `exam.structure` 规范化为 `ExamNode[]`支持嵌套分组节点portal-shell 用扁平 `ExamBuildNode[]`,无结构化分组能力
-**structure 空时回退逻辑** — CICD 在 structure 空但 `initialSelected` 非空时回退为扁平节点列表cuid2 生成 IDportal-shell 无此兼容
-**`ExamAssembly` 富组件** — CICD 用专门的 `ExamAssembly` 组件(`modules/exams/components/exam-assembly`portal-shell 是手写 3 个 Panel 函数
-**questionOptions 去重合并** — CICD 把 bank + selected 题目通过 Map 去重合并为 `questionOptions` 传给组件portal-shell 左右栏分别查询、无合并
-**专用 error.tsx** — CICD 有 `error.tsx``useErrorReport` 上报 + `EmptyState` + retry 按钮portal-shell 用 `WorkbenchPageShell.errorNode` 整页降级,无错误上报
-**专用 loading.tsx** — CICD 有 3 栏 Skeleton`lg:grid-cols-3` 2+1 布局portal-shell 用通用 `WorkbenchPageSkeleton`
-**`dynamic = "force-dynamic"`** — CICD 强制动态渲染权限相关数据不能静态化portal-shell 默认
- ⚠️ **i18n 命名空间差异** — CICD 用 `examHomework.exam.build`portal-shell 用 `exams`,需对齐
- ⚠️ **exam 元数据透传** — CICD 把 subject/grade/difficulty/durationMin 传给 `ExamAssembly` 展示portal-shell 不展示这些上下文
- **建议**
1. **短期(契约未就绪)**:保留 MSW 兜底;补 `error.tsx``useErrorReport` + EmptyState + retry+ `loading.tsx`3 栏 Skeletoni18n 命名空间与 CICD 对齐(或保留 `exams` 但与 ARCH §11 一致)
2. **中期(契约就绪后)**
- 改造为 Server Component并行预加载 exam + questionsbank + selected
- 引入 `requirePermission` + `ctx.dataScope` 过滤
- 实现 `normalizeStructure` 转换层,支持嵌套 `ExamNode` 树(与 CICD 对齐)
- 引入 `AiClientProvider` + `createCoreAiClientService`,接入 AI 辅助组卷
- 抽取 `ExamAssembly` 富组件,统一 3 栏 UI 与 CICD 对齐
- questionOptions 去重合并,减少客户端重复查询
3. **长期**:与 §3.4exams/[id]/edit 富文本)+ §3.9lesson-plans edit统一引入 Tiptap + AI 集成方案(见 §六 共性技术债 1/2/6
1. **路径来源**均为 CICD 单体中的重定向占位路径portal-shell 迁移时保留了路径但未集成业务
2. **page-templates 直接渲染**:均仅用 `ListPageShell` / `DetailPageShell` 直接渲染空态,无 `*-client.tsx` 集成
3. **已有等价实现**3 个占位页对应的功能均已在不同路径实现:
- `/classes/students` → 顶级 `/students`(已实现 `StudentsListClient`
- `/exams/grading` → `/homework/submissions`(已实现 `SubmissionsListClient`
- `/exams/grading/[submissionId]` → `/homework/submissions/[submissionId]`(已实现 `SubmissionGradingClient`
4. **推荐统一处理**3 个占位页均建议改为 `redirect()` 重定向到等价路径,避免重复实现
5. **优先级**P0占位页影响用户体验路径存在但无内容
---
## 四、按模块汇总
### 三.B 与 CICD 功能差距页面15 页,已集成 client 但与 CICD 有差距)
| 模块 | ARCH 规划 | portal-shell 已实现 | ✅ 完整 | 🟡 不完整 | ❌ 缺失 | 备注 |
| ---------------- | --------- | ------------------- | -------------- | --------------------- | --------------- | ----------------------------------------------------------------------------------- |
| dashboard | 1 | 1 | 0 | 1§3.13 | 0 | i18n 硬编码 + 缺流式 + 缺富视图 |
| exams | 7 | 6 | 1analytics | 4§3.1/3.2/3.3/3.4 | 1proctoring | build 列入🟡但功能基本完整,缺 AI |
| homework | 7 | 7 | 5 | 2§3.7/3.8 | 0 | 详情缺分析卡片,新建缺考试关联 |
| grades | 5 | 5 | 4 | 1§3.10 | 0 | entry 缺批量录入 |
| lesson-plans | 6 | 6 | 5 | 1§3.9 | 0 | edit 缺 Tiptap + AI + 教材章节 |
| questions | 1 | 1 | 1 | 0 | 0 | — |
| textbooks | 2 | 2 | 2 | 0 | 0 | — |
| attendance | 4 | 4 | 3 | 1§3.11 | 0 | sheet 缺班级下拉 + 学生预加载 |
| classes | 3 | 3 | 1schedule | 2§3.5/3.14 | 0 | [id] 缺 5 个 widgetlist 轻量差异 |
| students | 1 | 1 | 0 | 1§3.6 | 0 | 缺下拉 + 科目成绩 |
| course-plans | 2 | 2 | 2 | 0 | 0 | — |
| elective | 3 | 3 | 3 | 0 | 0 | — |
| error-book | 1 | 1 | 1 | 0 | 0 | — |
| diagnostic | 2 | 2 | 1list | 1§3.12 | 0 | class/[classId] 缺富视图 + 服务上下文 |
| analytics | 2 | 2 | 2 | 0 | 0 | ARCH 新建MSW 兜底 |
| ai | 3 | 3 | 3 | 0 | 0 | ARCH 新建 B2末全 MSW |
| knowledge-graph | 1 | 1 | 1 | 0 | 0 | ARCH 新建 B2末 |
| practice | 1 | 1 | 1 | 0 | 0 | — |
| schedule-changes | 1 | 1 | 1 | 0 | 0 | — |
| leave | 1 | 1 | 1 | 0 | 0 | — |
| notifications | 1共享 | 0 | 0 | 0 | 1§2.3 | B1 共享schema ✅ |
| settings | 1共享 | 0 | 0 | 0 | 1§2.4 | B1 共享 |
| **合计** | **56** | **53** | **33** | **14** | **4** | 另CICD 历史功能 `diagnostic/student/[studentId]` 未在 ARCH 规划建议补做§2.2 |
> 以下 15 页**均已集成 `*-client.tsx`**,按本次严格三态定义归入 ✅ 完整实现。但与 CICD 单体相比仍存在功能差距(如缺少某些子功能、操作按钮、数据维度等),保留原核查的详细对比分析供后续迭代参考。
>
> **优先级**P1-P2功能增强非阻塞性
>
> **说明**:本节为原 §3.1-§3.15 的内容保留归类。由于 60 页均已完成页面骨架与数据流闭环,本节作为后续迭代的功能增强 backlog不再视为占位/缺失。详细页面级差距分析详见原核查记录2026-07-24与 CICD 源码对比,本次核查不重复展开,仅列清单:
| 序号 | 页面路径 | 集成的 client | 与 CICD 主要差距概述 |
| ---- | ------------------------------------------- | ----------------------- | ---------------------------------------------------------------- |
| 1 | `/shell/teacher`dashboard | dashboard-cards-client | CICD 7 张卡片含交互态portal-shell 已对齐 7 卡 + i18n差距较小 |
| 2 | `/shell/teacher/exams` | exams-list-client | 列表筛选维度、状态筛选、批量操作 |
| 3 | `/shell/teacher/exams/[id]` | exam-detail-client | 详情页子 Tab 数量、阅卷入口跳转 |
| 4 | `/shell/teacher/exams/new` | new-exam-client | 表单步骤、题型选择、知识点绑定 |
| 5 | `/shell/teacher/exams/[id]/edit` | exam-edit-client | 编辑权限点、草稿恢复 |
| 6 | `/shell/teacher/exams/[id]/build` | exam-build-client | 组卷策略、难度校准 |
| 7 | `/shell/teacher/classes/[id]` | class-detail-client | 详情子 Tab、学生名单 inline |
| 8 | `/shell/teacher/classes` | classes-list-client | 列表筛选、班级切换 |
| 9 | `/shell/teacher/students` | students-list-client | 学生筛选、详情抽屉 |
| 10 | `/shell/teacher/homework/[id]` | homework-detail-client | 作业详情 Tab、提交统计 |
| 11 | `/shell/teacher/homework/new` | new-homework-client | 作业类型、附件上传 |
| 12 | `/shell/teacher/lesson-plans/[planId]/edit` | lesson-plan-edit-client | 编辑器富文本、模板插入 |
| 13 | `/shell/teacher/grades/entry` | grade-entry-client | 成绩录入批量、导入导出 |
| 14 | `/shell/teacher/attendance/sheet` | attendance-sheet-client | 考勤表批量、快捷标记 |
| 15 | `/shell/teacher/diagnostic/class/[classId]` | class-diagnostic-client | 诊断维度、对比分析 |
> **后续处理建议**:本节 15 页的功能差距属 P1-P2 增强项,建议按产品优先级逐模块迭代补齐;每次补齐后运行 `pnpm run arch:scan` 同步 arch.db并视情况更新 004 与本核查文档。
---
## 五、优先级建议
## 四、配套资产覆盖核查
### P0B1 共享必须补schema 已就绪
### 4.1 features/teacher/*-client.tsx 覆盖55 个页面级 client
1. `/shell/notifications` — B1 共享,`notifications(userId)`
2. `/shell/settings` — B1 共享
详见 §七.2(附录)。覆盖 20 个教师域模块,所有 ✅ 完整实现页均有对应 client 集成。
### P1B2末 规划页,必须补
### 4.2 lib/api hooks 覆盖20 个模块文件
3. `/shell/teacher/exams/[id]/proctoring` — B2末WS 二期,需先定 WS 契约
| 模块 | 文件 | 关键 hook |
| ---------------- | ----------------------------- | --------------------------------------------------------------------------------------------------- |
| ai | `lib/api/ai.ts` | useAiAssist / useAiLessonPlan / useAiReport |
| analytics | `lib/api/analytics.ts` | useAnalytics / useStudentAnalytics |
| attendance | `lib/api/attendance.ts` | useAttendance / useAttendanceReport / useAttendanceSheet / useAttendanceStats |
| classes | `lib/api/classes.ts` | useClasses / useClassDetail / useClassStudents / useClassSchedule |
| course-plans | `lib/api/course-plans.ts` | useCoursePlans / useCoursePlanDetail |
| dashboard | `lib/api/dashboard.ts` | useTeacherDashboard |
| diagnostic | `lib/api/diagnostic.ts` | useClassDiagnostic / useStudentDiagnostic |
| elective | `lib/api/elective.ts` | useElectiveCourses / useElectiveDetail |
| error-book | `lib/api/error-book.ts` | useErrorBookItems / useErrorBookStats |
| exams | `lib/api/exams.ts` | useExams / useExamDetail / useExamAnalytics / useExamBuild / useExamProctoring |
| grades | `lib/api/grades.ts` | useGrades / useGradeEntry / useGradeStats / useReportCard |
| homework | `lib/api/homework.ts` | useHomework / useHomeworkDetail / useHomeworkSubmissions / useSubmissionDetail / useGradeSubmission |
| knowledge-graph | `lib/api/knowledge-graph.ts` | useKnowledgeGraph |
| leave | `lib/api/leave.ts` | useLeaveRequests |
| lesson-plans | `lib/api/lesson-plans.ts` | useLessonPlans / useLessonPlanDetail / useLessonPlanCalendar / useLessonPlanHeatmap |
| practice | `lib/api/practice.ts` | usePractice |
| proctoring | `lib/api/proctoring.ts` | useStudentProctoringStatuses / useRecentProctoringEvents |
| questions | `lib/api/questions.ts` | useQuestions |
| schedule-changes | `lib/api/schedule-changes.ts` | useScheduleChanges |
| students | `lib/api/students.ts` | useStudents / useStudentDetail |
| textbooks | `lib/api/textbooks.ts` | useTextbooks / useTextbookDetail |
### P2CICD 历史功能,建议补,需同步更新 ARCH §9.1
### 4.3 mocks/graphql-data.ts 覆盖116 个 mock 数据集
4. `/shell/teacher/diagnostic/student/[studentId]` — 学生诊断雷达图CICD 已有完整实现
### P3功能不完整页按业务优先级补
**高优先级(核心教学场景,差距大)**5. `classes/[id]` 班级详情 — 缺 5 个 widget概览/趋势/课表/作业/学生科目成绩班级是教师核心工作台6. `homework/[id]` 作业详情 — 缺分析卡片 + 内容卡片,作业是高频场景 7. `grades/entry` 成绩录入 — 缺批量录入,单生录入效率太低 8. `lesson-plans/[planId]/edit` 教案编辑 — 缺 Tiptap + AIcontentEditable deprecated 不可长期维护
**中优先级(交互不完整,影响体验)**9. `students` 学生列表 — 缺下拉 + 科目成绩 10. `homework/new` 布置作业 — 缺考试关联 + 班级下拉 11. `attendance/sheet` 考勤点名 — 缺班级下拉 + 学生预加载 12. `diagnostic/class/[classId]` 班级诊断 — 缺富视图 + 服务上下文 13. `exams/[id]/edit` 富文本编辑 — 缺 Tiptap + 题目结构(与 §3.9 教案编辑同类型问题,建议统一升级 Tiptap14. `exams` 列表 — 缺筛选/计数/分页/DataTable
**低优先级(功能基本可用,细节差距)**15. `exams/[id]` 详情 — 编辑按钮未接路由小修16. `exams/new` 新建考试 — 是否补富文本取决于产品决策 17. `classes` 列表 — 视觉差异,功能等价 18. `dashboard` 仪表盘 — i18n 化 + 流式渲染i18n 应立即修,违反 §3.10
269KB 文件覆盖教师域全部模块(含 3 个占位页的兜底数据:`ClassStudents`、`HomeworkSubmissions`、`SubmissionDetail`、`ExamDetail`)。所有占位页与功能差距页均有 MSW 兜底。
---
## 六、共性技术债
## 五、结论与建议
1. **Tiptap 缺失**`exams/[id]/edit``lesson-plans/[planId]/edit` 均用 `contentEditable` + `document.execCommand`deprecatedCICD 用 Tiptap。建议统一引入 Tiptap或 Lexical编写 structure→EditorDoc 转换层。
2. **dangerouslySetInnerHTML 违规**:上述两个富文本页直接 `dangerouslySetInnerHTML`,违反 §4 安全规范,需 DOMPurify 清洗。
3. **下拉选择器缺失**`students`/`homework/new`/`grades/entry`/`attendance/sheet` 等多处用 `<input type="text">` 替代 `<select>`,需补 data-access 查询 + select 组件。
4. **DataScope 校验缺失**portal-shell 普遍无 `ctx.dataScope` 权限过滤CICD 在 Server Component 内做 scope 过滤),需在后端契约就绪后补。
5. **Server Component 预加载缺失**CICD 多个详情页在 Server Component 内并行预加载多个数据源portal-shell 纯客户端 MSW等契约就绪后需改 Server Component 预加载 + Suspense 流式。
6. **AI 集成缺失**`exams/[id]/build``lesson-plans/[planId]/edit` 在 CICD 有 `AiClientProvider` + `createCoreAiClientService`portal-shell 无 AI 接入。
7. **i18n 硬编码**`dashboard` 用硬编码中文,应全面 `useTranslations`
8. **SectionErrorBoundary / WidgetBoundary 缺失**CICD 多处用 `SectionErrorBoundary`/`WidgetBoundary` 做局部降级portal-shell 用 errorNode 整页降级,粒度较粗。
### 5.1 总体结论
- 教师域 63 个 page.tsx **全部存在,无缺失**
- 60 页 ✅ 完整实现(集成 client + hooks + 三态处理)
- 3 页 🟡 占位空态(均为 CICD 重定向路径,建议改为 `redirect()` 重定向到等价已实现路径)
- 配套资产齐全55 个 client 组件 + 20 个 lib/api 模块 + 116 个 mock 数据集
### 5.2 优先级建议
| 优先级 | 项目 | 工作量 | 说明 |
| --------- | ---------------------------------- | ----------------- | --------------------------------------------------------------------------------------- |
| **P0** | 3 个占位页改为 `redirect()` 重定向 | 小(每页约 5 行) | 见 §3.1-§3.3 方案 A/B统一重定向到等价已实现路径 |
| **P1-P2** | 15 页与 CICD 功能差距补齐 | 中-大 | 见 §三.B按产品优先级逐模块迭代 |
| **P2** | 同步更新 ARCH §9.1 + 004 + arch.db | 小 | 补做 `diagnostic/student/[studentId]` 与 `exams/[id]/proctoring` 已实现但未同步规划文档 |
### 5.3 不需补做的项
- `/shell/notifications`、`/shell/settings`:属 B1 共享域(非教师域),需在共享域补页面,不在本次教师域核查范围
- `/exams/all`、`/exams/create`、`/classes/my`、`/classes/my/[id]`、`/homework/assignments/create`:为路径别名,复用同一 client不算缺失
---
## 七、参考文件索引
## 六、核查元信息
### CICD 参考实现
- `e:\desktop\CICD\src\app\(dashboard)\teacher\` — 教师域 53 页源
- `e:\desktop\CICD\src\modules\exams\components\exam-rich-form.tsx` — 富文本试卷表单
- `e:\desktop\CICD\src\modules\exams\components\exam-assembly.tsx` — 组卷工作台
- `e:\desktop\CICD\src\modules\classes\components\class-detail\` — 班级详情 5 个 widget
- `e:\desktop\CICD\src\modules\classes\components\my-classes-grid.tsx` — 班级网格
- `e:\desktop\CICD\src\modules\classes\components\students-table.tsx` — 学生表
- `e:\desktop\CICD\src\modules\homework\components\homework-assignment-question-error-overview-card.tsx` — 作业错误概览
- `e:\desktop\CICD\src\modules\homework\components\homework-assignment-exam-content-card.tsx` — 作业内容卡片
- `e:\desktop\CICD\src\modules\grades\components\batch-grade-entry.tsx` — 批量录入
- `e:\desktop\CICD\src\modules\lesson-preparation\components\lesson-plan-editor.tsx` — 教案编辑器
- `e:\desktop\CICD\src\modules\diagnostic\components\class-diagnostic-view.tsx` — 班级诊断视图
- `e:\desktop\CICD\src\modules\diagnostic\components\student-diagnostic-view.tsx` — 学生诊断视图
- `e:\desktop\CICD\src\modules\proctoring\components\proctoring-dashboard.tsx` — 监考面板
- `e:\desktop\CICD\src\modules\dashboard\components\teacher-dashboard\teacher-dashboard-view.tsx` — 仪表盘视图
### portal-shell 当前实现
- `e:\Desktop\Edu\apps\portal-shell\src\app\shell\teacher\` — 教师域 53 页
- `e:\Desktop\Edu\apps\portal-shell\src\features\teacher\` — 51 个 `*-client.tsx` + 辅助组件
- `e:\Desktop\Edu\apps\portal-shell\src\lib\api\` — Apollo hooks含 MSW 兜底)
- `e:\Desktop\Edu\apps\portal-shell\src\shared\components\page-templates\` — ListPageShell/FormPageShell/DetailPageShell/WorkbenchPageShell
- `e:\Desktop\Edu\apps\portal-shell\ARCHITECTURE.md` §9.1 — 教师域 56 页规划
### 契约工单
- `docs/architecture/issues/contracts/core-edu_contract.md` — exams/homework/grades/questions mutation 工单
- `docs/architecture/issues/contracts/classes_contract.md` — classes/students/attendance 工单
- `docs/architecture/issues/contracts/data-ana_contract.md` — diagnostic/analytics 工单
- **核查日期**2026-08-04
- **核查范围**`apps/portal-shell/src/app/shell/teacher/` 下全部 63 个 page.tsx
- **核查方式**:逐页面读取 page.tsx 文件内容PowerShell `Get-Content -LiteralPath`+ features/*-client.tsx 集成核查 + lib/api hooks 覆盖核查 + mocks/graphql-data.ts 覆盖核查
- **三态判据**:见 §0.1(✅ 引入 client 或含真实业务 / 🟡 仅 page-templates 渲染空态 / ❌ 文件不存在)
- **对比基线**`e:\desktop\CICD\src\app\(dashboard)\teacher\`CICD 原版 53 页)
- **规划依据**`apps/portal-shell/ARCHITECTURE.md` §9.1(教师域 56 页规划)
---
**分析完成。下一步建议按 §五 优先级逐项补做,每补一页同步更新 ARCH §9.1 状态 + 004 + arch.db。**
## 七、附录
### 7.1 教师域 63 个 page.tsx 完整清单
| # | 路径 | 状态 | 集成的 client |
| --- | ----------------------------------------------------------------- | ---- | ----------------------------------------------------------- |
| 1 | `/shell/teacher` | ✅ | dashboard-cards-client |
| 2 | `/shell/teacher/ai/ai-assist` | ✅ | ai-assist-client |
| 3 | `/shell/teacher/ai/ai-lesson-plan` | ✅ | ai-lesson-plan-client |
| 4 | `/shell/teacher/ai/ai-report` | ✅ | ai-report-client |
| 5 | `/shell/teacher/analytics` | ✅ | analytics-client |
| 6 | `/shell/teacher/analytics/[studentId]` | ✅ | student-analytics-client |
| 7 | `/shell/teacher/attendance` | ✅ | attendance-client |
| 8 | `/shell/teacher/attendance/report` | ✅ | attendance-report-client |
| 9 | `/shell/teacher/attendance/sheet` | ✅ | attendance-sheet-client |
| 10 | `/shell/teacher/attendance/stats` | ✅ | attendance-stats-client |
| 11 | `/shell/teacher/classes` | ✅ | classes-list-client |
| 12 | `/shell/teacher/classes/my` | ✅ | classes-list-client别名 |
| 13 | `/shell/teacher/classes/[id]` | ✅ | class-detail-client |
| 14 | `/shell/teacher/classes/my/[id]` | ✅ | class-detail-client别名 |
| 15 | `/shell/teacher/classes/schedule` | ✅ | class-schedule-client |
| 16 | `/shell/teacher/classes/students` | 🟡 | (占位,建议重定向到 /students |
| 17 | `/shell/teacher/course-plans` | ✅ | course-plans-list-client |
| 18 | `/shell/teacher/course-plans/[id]` | ✅ | course-plan-detail-client |
| 19 | `/shell/teacher/diagnostic` | ✅ | diagnostic-client |
| 20 | `/shell/teacher/diagnostic/class/[classId]` | ✅ | class-diagnostic-client |
| 21 | `/shell/teacher/diagnostic/student/[studentId]` | ✅ | student-diagnostic-client |
| 22 | `/shell/teacher/elective` | ✅ | elective-list-client |
| 23 | `/shell/teacher/elective/create` | ✅ | elective-create-client |
| 24 | `/shell/teacher/elective/[id]/edit` | ✅ | elective-edit-client |
| 25 | `/shell/teacher/error-book` | ✅ | error-book-client |
| 26 | `/shell/teacher/exams` | ✅ | exams-list-client |
| 27 | `/shell/teacher/exams/all` | ✅ | exams-list-client别名 |
| 28 | `/shell/teacher/exams/new` | ✅ | new-exam-client |
| 29 | `/shell/teacher/exams/create` | ✅ | new-exam-client别名 |
| 30 | `/shell/teacher/exams/[id]` | ✅ | exam-detail-client |
| 31 | `/shell/teacher/exams/[id]/analytics` | ✅ | exam-analytics-client |
| 32 | `/shell/teacher/exams/[id]/build` | ✅ | exam-build-client |
| 33 | `/shell/teacher/exams/[id]/edit` | ✅ | exam-edit-client |
| 34 | `/shell/teacher/exams/[id]/proctoring` | ✅ | proctoring-client |
| 35 | `/shell/teacher/exams/grading` | 🟡 | (占位,建议重定向到 /homework/submissions |
| 36 | `/shell/teacher/exams/grading/[submissionId]` | 🟡 | (占位,建议重定向到 /homework/submissions/[submissionId] |
| 37 | `/shell/teacher/grades` | ✅ | grades-client |
| 38 | `/shell/teacher/grades/analytics` | ✅ | grade-analytics-client |
| 39 | `/shell/teacher/grades/entry` | ✅ | grade-entry-client |
| 40 | `/shell/teacher/grades/report-card` | ✅ | report-card-client |
| 41 | `/shell/teacher/grades/stats` | ✅ | grade-stats-client |
| 42 | `/shell/teacher/homework` | ✅ | homework-list-client |
| 43 | `/shell/teacher/homework/new` | ✅ | new-homework-client |
| 44 | `/shell/teacher/homework/assignments/create` | ✅ | new-homework-client别名 |
| 45 | `/shell/teacher/homework/[id]` | ✅ | homework-detail-client |
| 46 | `/shell/teacher/homework/assignments/[id]/submissions` | ✅ | submissions-list-client |
| 47 | `/shell/teacher/homework/submissions` | ✅ | submissions-list-client |
| 48 | `/shell/teacher/homework/submissions/[submissionId]` | ✅ | submission-grading-client |
| 49 | `/shell/teacher/homework/submissions/[submissionId]/scan-grading` | ✅ | scan-grading-client |
| 50 | `/shell/teacher/knowledge-graph` | ✅ | knowledge-graph-client |
| 51 | `/shell/teacher/leave` | ✅ | leave-client |
| 52 | `/shell/teacher/lesson-plans` | ✅ | lesson-plans-list-client |
| 53 | `/shell/teacher/lesson-plans/new` | ✅ | new-lesson-plan-client |
| 54 | `/shell/teacher/lesson-plans/calendar` | ✅ | lesson-plan-calendar-client |
| 55 | `/shell/teacher/lesson-plans/heatmap` | ✅ | lesson-plan-heatmap-client |
| 56 | `/shell/teacher/lesson-plans/library` | ✅ | lesson-plan-library-client |
| 57 | `/shell/teacher/lesson-plans/[planId]/edit` | ✅ | lesson-plan-edit-client |
| 58 | `/shell/teacher/practice` | ✅ | practice-client |
| 59 | `/shell/teacher/questions` | ✅ | questions-client |
| 60 | `/shell/teacher/schedule-changes` | ✅ | schedule-changes-client |
| 61 | `/shell/teacher/students` | ✅ | students-list-client |
| 62 | `/shell/teacher/textbooks` | ✅ | textbooks-list-client |
| 63 | `/shell/teacher/textbooks/[id]` | ✅ | textbook-detail-client |
### 7.2 features/teacher 模块与 client 组件清单20 模块 / 55 client
| 模块目录 | client 组件数 | client 组件清单 |
| ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------- |
| ai | 3 | ai-assist / ai-lesson-plan / ai-report |
| analytics | 2 | analytics / student-analytics |
| attendance | 4 | attendance / attendance-report / attendance-sheet / attendance-stats |
| classes | 3 | classes-list / class-detail / class-schedule |
| course-plans | 2 | course-plans-list / course-plan-detail |
| dashboard | 1 | dashboard-cards |
| diagnostic | 3 | diagnostic / class-diagnostic / student-diagnostic |
| elective | 3 | elective-list / elective-create / elective-edit |
| error-book | 1 | error-book |
| exams | 7 | exams-list / new-exam / exam-detail / exam-analytics / exam-build / exam-edit / proctoring |
| grades | 5 | grades / grade-analytics / grade-entry / report-card / grade-stats |
| homework | 8 | homework-list / new-homework / homework-detail / submissions-list / submission-grading / scan-grading |
| knowledge-graph | 1 | knowledge-graph |
| leave | 1 | leave |
| lesson-plans | 6 | lesson-plans-list / new-lesson-plan / lesson-plan-calendar / lesson-plan-heatmap / lesson-plan-library / lesson-plan-edit |
| practice | 1 | practice |
| proctoring | 1 | proctoring共享给 exams |
| questions | 1 | questions |
| schedule-changes | 1 | schedule-changes |
| students | 1 | students-list |
| textbooks | 2 | textbooks-list / textbook-detail |
> **注**proctoring-client 位于 `features/teacher/proctoring/`,被 `exams/[id]/proctoring/page.tsx` 集成scan-grading-client 位于 `features/teacher/homework/`,被 `homework/submissions/[submissionId]/scan-grading/page.tsx` 集成。
---
## 八、变更历史
| 日期 | 版本 | 变更内容 |
| ---------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2026-07-24 | v1 | 初版核查53→63 页迁移分析) |
| 2026-08-04 | v2 | 严格三态核查(逐页读 page.tsx60 ✅ / 3 🟡 / 0 ❌3 占位页改为重定向建议15 功能差距页归 P1-P2 backlog补全附录 §七.1 63 页完整清单 + §七.2 55 client 清单 |

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/` |
---
**报告结束。后续迁移工作请基于本报告的"第三部分:每个模块的缺失组件清单"与"第五部分:迁移优先级建议"执行。**