Files
NextEdu/docs/architecture/_update_004.cjs
SpecialX 6a22922ddd docs(architecture): sync architecture docs with code changes
- Update 001_project_overview.md

- Update 004_architecture_impact_map.md

- Update 005_architecture_data.json

- Add 008_module_role_mapping.md

- Add _update_004.cjs helper script
2026-07-03 10:32:15 +08:00

102 lines
6.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 临时脚本:更新 004_architecture_impact_map.md
const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, '004_architecture_impact_map.md');
const content = fs.readFileSync(filePath, 'utf8');
const oldString = [
'| `components/blocks/reflection-block.tsx` | 反思 BlockV3 续select onChange 使用 `isReflectionAspect` 类型守卫替代 `as` 断言) |',
'',
'---',
'',
'## 2.28 error-book错题本模块'
].join('\r\n');
const newLines = [
'| `components/blocks/reflection-block.tsx` | 反思 BlockV3 续select onChange 使用 `isReflectionAspect` 类型守卫替代 `as` 断言) |',
'| `components/calendar-view.tsx` | **M9 日历视图组件2026-07-01 新增)**:客户端组件,支持周历/月历切换6 种事件类型颜色映射 |',
'| `components/curriculum-map-view.tsx` | **M4 课程地图热力图组件2026-07-01 新增)**:学科×年级矩阵表格,颜色编码覆盖率 |',
'| `data-access-calendar.ts` | **M9 日历事件数据访问层2026-07-01 新增)** |',
'| `data-access-review.ts` | **M3 审核工作流数据访问层2026-07-01 新增)** |',
'| `data-access-comments.ts` | **M2 协同备课评论数据访问层2026-07-01 新增)** |',
'| `data-access-formative.ts` | **M5 形成性评价数据访问层2026-07-01 新增)** |',
'| `data-access-attachments.ts` | **M6 资源附件库数据访问层2026-07-01 新增)** |',
'| `data-access-substitutes.ts` | **M12 代课教师数据访问层2026-07-01 新增)** |',
'| `data-access-ai-evaluation.ts` | **M8 AI 评估数据访问层2026-07-01 新增)** |',
'| `data-access-analytics.ts` | **M10 备课分析仪表盘数据访问层2026-07-01 新增)** |',
'| `actions-calendar.ts` | **M9 日历 Server Actions2026-07-01 新增)** |',
'| `actions-review.ts` | **M3 审核工作流 Server Actions2026-07-01 新增)** |',
'| `actions-comments.ts` | **M2 评论 Server Actions2026-07-01 新增)** |',
'| `actions-formative.ts` | **M5 形成性评价 Server Actions2026-07-01 新增)** |',
'| `actions-attachments.ts` | **M6 附件库 Server Actions2026-07-01 新增)** |',
'| `actions-substitutes.ts` | **M12 代课教师 Server Actions2026-07-01 新增)** |',
'| `actions-ai-evaluation.ts` | **M8 AI 评估 Server Actions2026-07-01 新增)** |',
'| `actions-analytics.ts` | **M10 分析仪表盘 Server Actions2026-07-01 新增)** |',
'',
'> 架构变更2026-07-01M1-M12 中长期计划完整实施):',
'> - **M1 课标对标体系**:新增 modules/standards/ 模块;新增 3 个 STANDARD_* 权限点;新增路由 /admin/curriculum-map',
'> - **M2 协同备课评论**:新增 data-access-comments.ts + actions-comments.ts支持 Block 级评论、resolved 状态',
'> - **M3 审核工作流**:新增 data-access-review.ts + actions-review.ts状态机 draft → submitted → approved/rejected → published',
'> - **M4 课程地图**:新增 admin/curriculum-map 路由 + curriculum-map-view.tsx 热力图组件',
'> - **M5 形成性评价闭环**:新增 data-access-formative.ts + actions-formative.ts4 种互动类型',
'> - **M6 资源附件库**:新增 data-access-attachments.ts + actions-attachments.ts',
'> - **M7 移动端 PWA**:见 1.1.1 章节',
'> - **M8 AI 差异化生成 + 评估**:新增 data-access-ai-evaluation.ts + actions-ai-evaluation.ts',
'> - **M9 日历视图**:新增 data-access-calendar.ts + actions-calendar.ts + calendar-view.tsx + teacher/lesson-plans/calendar 路由',
'> - **M10 备课分析仪表盘**:新增 data-access-analytics.ts + actions-analytics.ts3 个分析维度',
'> - **M11 版本 diff 预览**data-access-versions.ts 的 getVersionContent 支持读取历史版本内容',
'> - **M12 代课教师**:新增 data-access-substitutes.ts + actions-substitutes.ts',
'> - **权限扩展**:新增 STANDARD_READ/MANAGE/LINK + LESSON_PLAN_SUBMIT/REVIEW/ANALYTICS_READ/SUBSTITUTE_MANAGE',
'> - **i18n 扩展**zh-CN 新增 9 个命名空间status 扩展为 6 状态',
'> - **数据库表**:新增 6 张表lessonPlanComments/lessonPlanReviewRecords/lessonPlanFormativeItems/lessonPlanAttachments/lessonPlanAiEvaluations/lessonPlanSubstituteAssignments',
'',
'---',
'',
'## 2.27b standards课标模块2026-07-01 新增)',
'',
'**职责**K12 课标管理,支持课标树、按学科+年级筛选、课案与课标多对多关联。',
'',
'**导出函数**',
'- Data-accessgetStandards / getStandardsTree / getStandardById / createStandard / updateStandard / deactivateStandard / searchStandards / getStandardsByPlanId / linkPlanToStandard / unlinkPlanFromStandard',
'- Actions10 个 Server Actions全部使用 requirePermission() + ActionState<T>',
'- SchemacreateStandardSchema / updateStandardSchema / getStandardsParamsSchema / linkPlanToStandardSchema',
'- TypesStandard / StandardTreeNode / LessonPlanStandardLink',
'',
'**权限点**',
'- STANDARD_READstandard:read',
'- STANDARD_MANAGEstandard:manage',
'- STANDARD_LINKstandard:link',
'',
'**依赖关系**',
'- 依赖shared/*、modules/lesson-preparation/lib/i18n-errors',
'- 被依赖modules/lesson-preparation、app/(dashboard)/admin/curriculum-map',
'',
'**文件清单**',
'| 文件 | 职责 |',
'|------|------|',
'| types.ts | 类型定义 |',
'| schema.ts | Zod 验证 |',
'| data-access.ts | 课标 CRUD + 树形查询 + 课案关联 |',
'| actions.ts | 10 个 Server Actions |',
'',
'---',
'',
'## 2.28 error-book错题本模块'
];
const newString = newLines.join('\r\n');
if (!content.includes(oldString)) {
console.error('ERROR: old string not found');
process.exit(1);
}
const occurrences = content.split(oldString).length - 1;
if (occurrences !== 1) {
console.error('ERROR: appears ' + occurrences + ' times');
process.exit(1);
}
const newContent = content.replace(oldString, newString);
fs.writeFileSync(filePath, newContent, 'utf8');
console.log('SUCCESS 004 updated, before=' + content.length + ' after=' + newContent.length);