## 变更内容 ### 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
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
// 选修课页面(家长查看子女选修课)
|
||
// 依据:02-architecture-design.md §3.1 路由结构
|
||
// 路由:/parent/elective
|
||
|
||
"use client";
|
||
|
||
import { useChildElective } from "@/hooks/useChildElective";
|
||
import { useChildSwitcher } from "@/hooks/useChildSwitcher";
|
||
import { ElectiveSelectionList } from "@/components/ElectiveSelectionList";
|
||
|
||
export default function ElectivePage(): JSX.Element {
|
||
const { currentChild } = useChildSwitcher();
|
||
const { electiveSelections, loading, error } = useChildElective();
|
||
|
||
if (loading) {
|
||
return (
|
||
<div className="space-y-4" role="status" aria-live="polite">
|
||
<span className="skeleton h-8 w-48 rounded" aria-hidden="true" />
|
||
<span className="skeleton h-32 w-full rounded" aria-hidden="true" />
|
||
<span className="skeleton h-32 w-full rounded" aria-hidden="true" />
|
||
<span className="sr-only">加载选修课中...</span>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
if (error) {
|
||
return (
|
||
<div
|
||
role="alert"
|
||
className="rounded border border-danger p-4 text-sm text-danger"
|
||
>
|
||
加载失败:{error.message}
|
||
</div>
|
||
);
|
||
}
|
||
|
||
return (
|
||
<div className="space-y-6">
|
||
<h1 className="font-serif text-2xl">{currentChild?.name}的选修课</h1>
|
||
<ElectiveSelectionList electiveSelections={electiveSelections} />
|
||
</div>
|
||
);
|
||
}
|