feat: 新增备课模块并修复全模块 P0/P1/P2 缺陷
Some checks failed
Security / deep-security-scan (push) Failing after 20m5s
DR Drill / dr-drill (push) Failing after 1m31s
CI / scheduled-backup (push) Failing after 1m31s
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled

主要变更:

- 新增 lesson-preparation 模块: 备课编辑器、节点编辑、AI 建议、知识点选择、版本历史、作业发布

- 新增 shared 通用组件: charts/question-bank-filters/schedule-list/ui (chip-nav/filter-bar/page-header/stat-card/stat-item)

- 新增 student/admin 端 loading.tsx 与 error.tsx, 优化加载与错误态体验

- 新增 teacher/lesson-plans 页面 (列表/新建/编辑)

- 新增 drizzle 迁移 0002_tiny_lionheart 及 snapshot

- 新增 textbooks/schema.ts 与 exams/utils/normalize-structure.ts

- 修复 Tiptap v3 SSR hydration 崩溃 (rich-text-block immediatelyRender: false)

- 重构多模块 data-access/actions/组件, 修复权限校验与类型规范

- 同步架构文档 004/005 反映新增模块、导出、依赖关系

- 归档 bugs/* 测试报告与 e2e 测试脚本 (admin/parent/student/teacher web_test)
This commit is contained in:
SpecialX
2026-06-22 01:06:16 +08:00
parent d8962aba96
commit 978d9a8309
327 changed files with 34070 additions and 5642 deletions

View File

@@ -0,0 +1,107 @@
import type { BlockType, TemplateBlockSkeleton, TemplateScope } from "./types";
// block 类型 → 中文默认标题
export const BLOCK_TYPE_LABELS: Record<BlockType, string> = {
objective: "教学目标",
key_point: "教学重难点",
import: "导入",
new_teaching: "新授",
consolidation: "巩固练习",
summary: "课堂小结",
homework: "作业布置",
blackboard: "板书设计",
text_study: "文本研习",
exercise: "练习/作业",
rich_text: "自定义环节",
reflection: "教学反思",
};
// 富文本类 block共享同一编辑组件
export const RICH_TEXT_BLOCK_TYPES: BlockType[] = [
"objective",
"key_point",
"import",
"new_teaching",
"consolidation",
"summary",
"homework",
"blackboard",
"rich_text",
"reflection",
];
// 系统预设模板骨架seed 用)
export interface SystemTemplateDef {
id: string; // 固定 ID便于幂等
name: string;
scope: TemplateScope;
blocks: TemplateBlockSkeleton[];
}
export const SYSTEM_TEMPLATES: SystemTemplateDef[] = [
{
id: "tpl_regular",
name: "常规课",
scope: "regular",
blocks: [
{ type: "objective", title: "教学目标", hint: "明确本课的知识、能力、情感目标" },
{ type: "key_point", title: "教学重难点", hint: "标注重点与难点及突破策略" },
{ type: "import", title: "导入", hint: "情境导入/复习导入/问题导入" },
{ type: "new_teaching", title: "新授", hint: "核心教学活动设计" },
{ type: "consolidation", title: "巩固练习", hint: "课堂练习,检验学习效果" },
{ type: "summary", title: "课堂小结", hint: "归纳本课要点" },
{ type: "homework", title: "作业布置", hint: "课后作业说明(如需下发请用练习块)" },
{ type: "blackboard", title: "板书设计", hint: "板书结构示意" },
],
},
{
id: "tpl_review",
name: "复习课",
scope: "review",
blocks: [
{ type: "objective", title: "复习目标" },
{ type: "rich_text", title: "知识网络梳理", hint: "构建知识结构图" },
{ type: "rich_text", title: "典型例题精讲" },
{ type: "rich_text", title: "变式训练" },
{ type: "exercise", title: "当堂检测", hint: "purpose 选 class_practice" },
{ type: "summary", title: "课堂小结" },
],
},
{
id: "tpl_experiment",
name: "实验课",
scope: "experiment",
blocks: [
{ type: "objective", title: "实验目的" },
{ type: "rich_text", title: "器材准备" },
{ type: "rich_text", title: "实验步骤" },
{ type: "rich_text", title: "观察记录表" },
{ type: "rich_text", title: "交流讨论" },
{ type: "summary", title: "课堂小结" },
],
},
{
id: "tpl_inquiry",
name: "探究课",
scope: "inquiry",
blocks: [
{ type: "rich_text", title: "情境导入" },
{ type: "rich_text", title: "问题驱动" },
{ type: "rich_text", title: "小组探究" },
{ type: "rich_text", title: "成果展示" },
{ type: "rich_text", title: "归纳提升" },
],
},
{
id: "tpl_blank",
name: "空白模板",
scope: "blank",
blocks: [],
},
];
export const LESSON_PLAN_STATUS_LABELS: Record<string, string> = {
draft: "草稿",
published: "已发布",
archived: "已归档",
};