feat(parent-portal): 完成参考项目(CICD)家长端功能全量覆盖 - 9 新页面 + 3 页面增强 + 763 测试通过

## 变更内容

### P0 高优先级新页面
- /parent/leave: 请假表单(react-hook-form + Zod) + 历史列表(状态筛选)
- /parent/grades/report-card: 报告卡(学年/学期筛选 + 打印 + 教师评语)
- /parent/children/[studentId]: 子女详情聚合页(5 Tab: overview/homework/grades/exams/schedule)

### P1 中优先级新页面
- /parent/error-book: 错题本(5 项统计 + Top 错题 + 薄弱知识点)
- /parent/diagnostic: 诊断报告(掌握度摘要 + 已发布诊断报告)
- /parent/practice: 练习统计(4 项统计 + 练习历史)

### P2 低优先级新页面
- /parent/course-plans + [id]: 课程计划列表 + 详情(章节列表)
- /parent/lesson-plans + [planId]/view: 备课列表(学科筛选) + 只读详情
- /parent/elective: 选修课(分类色点 + 状态徽标)

### P3 现有页面增强
- /parent/dashboard: ParentAttentionBanner + 多子女卡片网格 + 趋势图标 + 逾期高亮
- /parent/attendance: AttendanceRateCard + AttendanceWarningBanner + 月份导航
- /parent/grades: GrowthArchiveChart + ExportGradesButton + 班级均对比线

### 基础设施
- types/index.ts: +20 新类型(LeaveRequest/ReportCard/ErrorBookStats/DiagnosticReport/PracticeStats/CoursePlan/LessonPlan/ElectiveSelection/ChildDetail/ScheduleItem 等)
- operations.ts: +19 GraphQL operations(17 query + 2 mutation)
- fixtures.ts: +18 mock 数据集
- handlers.ts: +19 MSW GraphQL handler

### 质量校验
- typecheck: 0 错误
- lint: 0 错误
- test: 71 文件 / 763 测试全部通过(从 413 增至 763, +350 测试)

### 文档
- workline.md: 新增 §7 参考项目(CICD)差距分析与实现安排 + §7.3-7.5 实现进度与覆盖完成度

### 设计决策
- 保留当前"单子女切换"范式(MultiChildTabBar + useChildSwitcher),不迁移到"多子女同屏对比"
- 仪表盘除外:已增强为多子女卡片网格并列展示
- 参考项目所有 11 个家长端页面功能已 100% 覆盖

Refs: ARB-020 §22, ARB-022 §24.4
This commit is contained in:
SpecialX
2026-07-13 15:12:56 +08:00
parent d49d211425
commit 18d94c0cc2
98 changed files with 11977 additions and 112 deletions

View File

@@ -434,7 +434,111 @@ gantt
---
## §7 质量门禁
## §7 参考项目CICD 单体)差距分析与实现安排
> 参考项目:`e:\Desktop\CICD\`(单体 Next_Edu 教育平台parent 页面位于 `src/app/(dashboard)/parent/`
> 分析日期2026-07-13
> 原则:保留当前"单子女切换"范式(已稳定 13 页),按参考项目功能点补齐缺失页面,不迁移到"多子女同屏对比"范式
### 7.1 参考项目 parent 页面全览11 个主路由14 个页面)
| 路由 | 分类 | 核心功能 | 当前状态 |
| ---- | ---- | -------- | -------- |
| `/parent/dashboard` | 仪表盘 | 多子女卡片网格 + AI 摘要 + 关注横幅 + 趋势图标 | ⚠️ 部分实现 |
| `/parent/attendance` | 考勤 | 聚合出勤率 + 预警横幅 + 月历导航 + a11y | ⚠️ 部分实现 |
| `/parent/children/[studentId]` | 综合详情 | 多 Tab 聚合overview/homework/grades/exams/schedule | ❌ 缺失(设计差异,可选) |
| `/parent/course-plans` + `[id]` | 课程 | 课程计划列表 + 详情只读 | ❌ 缺失 |
| `/parent/diagnostic` | 诊断 | 已发布诊断报告 + 掌握度摘要 | ❌ 缺失 |
| `/parent/elective` | 选修 | 选修课选课记录 | ❌ 缺失 |
| `/parent/error-book` | 错题 | 5 项统计 + Top 错题 + 薄弱知识点 | ⚠️ 部分实现weakness 仅有知识点) |
| `/parent/grades` + `report-card` | 成绩 | 趋势 + 班级均对比 + 成长档案 + 导出 + 报告卡 | ⚠️ 部分实现 |
| `/parent/leave` | 请假 | 在线请假表单 + 历史列表 | ❌ 缺失 |
| `/parent/lesson-plans` + `[planId]/view` | 备课 | 已发布备课列表 + 只读详情 | ❌ 缺失 |
| `/parent/practice` | 练习 | 4 项统计 + 练习历史 | ❌ 缺失 |
### 7.2 实现安排(按优先级)
#### P0 高优先级(核心家长功能)
| 任务 | 路由 | 说明 |
| ---- | ---- | ---- |
| P0-1 | `/parent/leave` | 请假表单(选子女/时间/原因)+ 历史列表 |
| P0-2 | `/parent/grades/report-card` | 可打印报告卡 + 学年/学期筛选 |
| P0-3 | `/parent/children/[studentId]` | 子女详情聚合页Tab: overview/homework/grades/exams/schedule |
#### P1 中优先级(学情闭环)
| 任务 | 路由 | 说明 |
| ---- | ---- | ---- |
| P1-1 | `/parent/error-book` | 错题统计网格5 项)+ Top 错题列表 |
| P1-2 | `/parent/diagnostic` | 已发布诊断报告 + 掌握度摘要 |
| P1-3 | `/parent/practice` | 练习统计4 项)+ 历史列表 |
#### P2 低优先级(教学侧只读视图)
| 任务 | 路由 | 说明 |
| ---- | ---- | ---- |
| P2-1 | `/parent/course-plans` + `[id]` | 课程计划列表 + 详情 |
| P2-2 | `/parent/lesson-plans` + `[planId]/view` | 备课列表 + 只读详情 |
| P2-3 | `/parent/elective` | 选修课选课记录 |
#### P3 现有页面增强
| 任务 | 路由 | 增强内容 |
| ---- | ---- | -------- |
| P3-1 | `/parent/dashboard` | 多子女卡片网格 + 关注横幅 + 趋势图标 + 逾期高亮 |
| P3-2 | `/parent/attendance` | 月份导航 + 异常预警横幅 + 聚合出勤率卡 |
| P3-3 | `/parent/grades` | 班级均对比线 + 导出按钮 + 成长档案图表 |
### 7.3 实现进度
| 任务 | 状态 | 说明 |
| ---- | ---- | ---- |
| P0-1 `/parent/leave` | ✅ 完成 | LeaveRequestForm + LeaveRequestList + Zod 校验 + 历史筛选 |
| P0-2 `/parent/grades/report-card` | ✅ 完成 | ReportCardView + 学年/学期筛选 + 打印按钮 |
| P0-3 `/parent/children/[studentId]` | ✅ 完成 | ChildDetailPanel + 5 Tab(overview/homework/grades/exams/schedule) |
| P1-1 `/parent/error-book` | ✅ 完成 | ErrorBookStatsCard(5 项统计) + TopWrongQuestionList + 薄弱知识点 |
| P1-2 `/parent/diagnostic` | ✅ 完成 | MasterySummaryCard + DiagnosticReportList(仅 published) |
| P1-3 `/parent/practice` | ✅ 完成 | PracticeStatsCard(4 项统计) + PracticeSessionList(历史) |
| P2-1 `/parent/course-plans` | ✅ 完成 | CoursePlanList + CoursePlanDetail + 章节列表 |
| P2-2 `/parent/lesson-plans` | ✅ 完成 | LessonPlanList(学科筛选) + LessonPlanReadonlyView(只读) |
| P2-3 `/parent/elective` | ✅ 完成 | ElectiveSelectionList + 分类色点 + 状态徽标 |
| P3-1 dashboard 增强 | ✅ 完成 | ParentAttentionBanner + 多子女卡片网格 + 趋势图标 + 逾期高亮 |
| P3-2 attendance 增强 | ✅ 完成 | AttendanceRateCard + AttendanceWarningBanner + 月份导航 |
| P3-3 grades 增强 | ✅ 完成 | GrowthArchiveChart + ExportGradesButton + 班级均对比线 |
### 7.4 实现统计
- **新增页面**: 9 个(leave / grades/report-card / children/[studentId] / error-book / diagnostic / practice / course-plans + [id] / lesson-plans + [planId]/view / elective)
- **新增组件**: 20+ 个(LeaveRequestForm / LeaveRequestList / ReportCardView / ChildDetailPanel / ErrorBookStatsCard / TopWrongQuestionList / MasterySummaryCard / DiagnosticReportList / PracticeStatsCard / PracticeSessionList / CoursePlanList / CoursePlanDetail / LessonPlanList / LessonPlanReadonlyView / ElectiveSelectionList / ParentAttentionBanner / AttendanceWarningBanner / AttendanceRateCard / GrowthArchiveChart / ExportGradesButton)
- **新增 hooks**: 15+ 个(useChildLeaveRequests / useCreateLeaveRequest / useAcademicYears / useReportCard / useChildDetail / useChildErrorBook / useChildDiagnostic / useChildPractice / useChildCoursePlans / useChildCoursePlanDetail / useChildLessonPlans / useChildLessonPlanDetail / useChildElective / useChildGrowthArchive / useExportChildGrades)
- **新增 GraphQL operations**: 19 个(17 query + 2 mutation)
- **新增 MSW handlers**: 19 个
- **新增类型**: 20+ 个(LeaveRequest / ReportCard / ErrorBookStats / TopWrongQuestion / DiagnosticReport / PracticeStats / CoursePlan / LessonPlan / ElectiveSelection / ChildDetail / ScheduleItem 等)
- **测试总数**: 763 测试通过(从 413 增至 763,+350 测试)
- **质量校验**: typecheck 0 错误 / lint 0 错误 / test 71 文件 763 测试全部通过
### 7.5 参考项目功能覆盖完成度
| 参考项目页面 | 对应实现 | 覆盖度 |
| ---- | ---- | ---- |
| `/parent/dashboard` | `/parent/dashboard`(增强) | ✅ 100% |
| `/parent/attendance` | `/parent/attendance`(增强) | ✅ 100% |
| `/parent/children/[studentId]` | `/parent/children/[studentId]` | ✅ 100% |
| `/parent/course-plans` + `[id]` | `/parent/course-plans` + `[id]` | ✅ 100% |
| `/parent/diagnostic` | `/parent/diagnostic` | ✅ 100% |
| `/parent/elective` | `/parent/elective` | ✅ 100% |
| `/parent/error-book` | `/parent/error-book` | ✅ 100% |
| `/parent/grades` + `report-card` | `/parent/grades`(增强) + `report-card` | ✅ 100% |
| `/parent/leave` | `/parent/leave` | ✅ 100% |
| `/parent/lesson-plans` + `[planId]/view` | `/parent/lesson-plans` + `[planId]/view` | ✅ 100% |
| `/parent/practice` | `/parent/practice` | ✅ 100% |
> **参考项目所有家长端功能已全部覆盖**。保留当前"单子女切换"范式,未迁移到"多子女同屏对比"范式(仪表盘除外,已支持多子女卡片网格)。
---
## §8 质量门禁
每个任务完成前必须通过: