refactor(school,classes): 完成 school/grade/class 审计全量改进项

P0-1/P0-2: 删除 grade-management 死模块,年级 CRUD 统一由 school 模块负责

P0-3: classes/actions.ts 从 974 行拆分为 6 个职责文件 + barrel re-export

P0-5: 13 个页面 i18n 全量接入(grades/departments/academic-year/classes/insights)

P1-1: 角色硬编码改为 hasAdminScope/hasTeacherScope/hasStudentScope 基于 dataScope.type

P1-3: 新增 SchoolErrorBoundary + SchoolListSkeleton/SchoolCardSkeleton,4 个页面包裹 Error Boundary

P1-4: classes/types.ts 跨领域类型添加归属决策注释

P1-5: schools-view.tsx 拆分为组合模式(SchoolFormDialog + SchoolDeleteDialog + SchoolListToolbar)

P1-6: 新增 getSchoolsForUser/getGradesForUser 权限感知查询函数

P2-1: 抽取 useSchoolData hook,对话框状态管理与 UI 分离

同步更新架构图文档 004/005
This commit is contained in:
SpecialX
2026-06-22 18:54:01 +08:00
parent 97e59b95a1
commit 15aa84b72c
29 changed files with 2267 additions and 1380 deletions

View File

@@ -78,9 +78,51 @@
},
"actions": {
"edit": "Edit",
"delete": "Delete"
"delete": "Delete",
"insights": "Insights"
},
"notSet": "Not set"
"notSet": "Not set",
"filters": {
"search": "Search grade/school/head...",
"school": "School",
"allSchools": "All schools",
"head": "Head",
"allHeads": "All",
"missing": "Both missing",
"missingGradeHead": "Missing grade head",
"missingTeachingHead": "Missing teaching head",
"sort": "Sort",
"defaultSort": "Default",
"updatedDesc": "Updated (new→old)",
"updatedAsc": "Updated (old→new)",
"nameAsc": "Name (A→Z)",
"nameDesc": "Name (Z→A)",
"orderAsc": "Order (low→high)",
"orderDesc": "Order (high→low)",
"reset": "Reset"
},
"list": {
"title": "Grade list",
"noSchools": "No schools",
"noSchoolsDescription": "Please create a school first, then create grades under it.",
"noGrades": "No grades",
"noGradesDescription": "Create a grade to manage heads and classes.",
"noMatch": "No matching results",
"noMatchDescription": "Try adjusting filters or clearing the search."
},
"validation": {
"selectSchool": "Please select a school",
"enterName": "Please enter a grade name",
"nameTooLong": "Grade name must be at most 100 characters",
"orderInvalid": "Order must be a non-negative integer",
"duplicateName": "A grade with this name already exists in this school",
"fixForm": "Please complete the form",
"noChanges": "No changes to save"
},
"optional": "Optional",
"failedCreate": "Failed to create grade",
"failedUpdate": "Failed to update grade",
"failedDelete": "Failed to delete grade"
},
"departments": {
"title": "Department Management",
@@ -159,5 +201,57 @@
"edit": "Edit",
"delete": "Delete"
}
},
"classManagement": {
"title": "Class Management",
"description": "Manage classes and assign teachers.",
"grade": {
"title": "Class Management",
"description": "Manage classes for your grades.",
"insights": {
"title": "Grade Insights",
"description": "View grade-level homework statistics for grades you lead.",
"filters": "Filters",
"grade": "Grade",
"apply": "Apply",
"selectGrade": "Select a grade",
"noGrades": "No grades assigned",
"noGradesDescription": "You are not assigned as a grade head or teaching head for any grade.",
"selectToView": "Select a grade to view insights",
"selectToViewDescription": "Pick a grade to see latest homework and historical score statistics.",
"notFound": "Grade not found",
"notFoundDescription": "This grade may not exist or has no accessible data.",
"noData": "No homework data for this grade",
"noDataDescription": "No homework assignments were targeted to students in this grade yet.",
"classes": "Classes",
"students": "Students",
"overallAvg": "Overall Avg",
"latestAvg": "Latest Avg",
"homeworkTimeline": "Homework timeline",
"classRanking": "Class ranking",
"assignment": "Assignment",
"status": "Status",
"created": "Created",
"targeted": "Targeted",
"submitted": "Submitted",
"graded": "Graded",
"avg": "Avg",
"median": "Median",
"class": "Class",
"latestAvgCol": "Latest Avg",
"prevAvg": "Prev Avg",
"delta": "Δ",
"overallAvgCol": "Overall Avg",
"active": "Active",
"inactive": "Inactive"
}
}
},
"errors": {
"boundary": {
"title": "Loading Failed",
"description": "An error occurred while loading data. Please retry.",
"retry": "Retry"
}
}
}

View File

@@ -78,9 +78,51 @@
},
"actions": {
"edit": "编辑",
"delete": "删除"
"delete": "删除",
"insights": "学情"
},
"notSet": "未设置"
"notSet": "未设置",
"filters": {
"search": "搜索年级/学校/组长...",
"school": "学校",
"allSchools": "全部学校",
"head": "负责人",
"allHeads": "全部",
"missing": "两者都未设置",
"missingGradeHead": "未设置年级组长",
"missingTeachingHead": "未设置教研组长",
"sort": "排序",
"defaultSort": "默认排序",
"updatedDesc": "更新时间(新→旧)",
"updatedAsc": "更新时间(旧→新)",
"nameAsc": "年级名称A→Z",
"nameDesc": "年级名称Z→A",
"orderAsc": "Order小→大",
"orderDesc": "Order大→小",
"reset": "重置"
},
"list": {
"title": "年级列表",
"noSchools": "暂无学校",
"noSchoolsDescription": "请先创建学校,再在学校下创建年级。",
"noGrades": "暂无年级",
"noGradesDescription": "创建年级以便管理负责人和班级。",
"noMatch": "没有匹配结果",
"noMatchDescription": "尝试修改筛选条件或清空搜索。"
},
"validation": {
"selectSchool": "请选择学校",
"enterName": "请输入年级名称",
"nameTooLong": "年级名称最多 100 个字符",
"orderInvalid": "Order 必须是非负整数",
"duplicateName": "该学校下已存在同名年级",
"fixForm": "请完善表单信息",
"noChanges": "没有可保存的变更"
},
"optional": "可选",
"failedCreate": "创建年级失败",
"failedUpdate": "更新年级失败",
"failedDelete": "删除年级失败"
},
"departments": {
"title": "部门管理",
@@ -159,5 +201,57 @@
"edit": "编辑",
"delete": "删除"
}
},
"classManagement": {
"title": "班级管理",
"description": "管理班级并分配教师。",
"grade": {
"title": "班级管理",
"description": "管理你所在年级的班级。",
"insights": {
"title": "年级学情",
"description": "查看你负责年级的作业整体统计。",
"filters": "筛选",
"grade": "年级",
"apply": "应用",
"selectGrade": "选择年级",
"noGrades": "暂无负责年级",
"noGradesDescription": "你尚未被指派为任何年级的年级主任或教研组长。",
"selectToView": "请选择年级查看学情",
"selectToViewDescription": "选择一个年级以查看最新作业与历史成绩统计。",
"notFound": "年级不存在",
"notFoundDescription": "该年级可能不存在或暂无可访问数据。",
"noData": "该年级暂无作业数据",
"noDataDescription": "该年级学生尚未收到任何作业。",
"classes": "班级",
"students": "学生",
"overallAvg": "整体均分",
"latestAvg": "最新均分",
"homeworkTimeline": "作业时间线",
"classRanking": "班级排名",
"assignment": "作业",
"status": "状态",
"created": "创建时间",
"targeted": "目标人数",
"submitted": "已提交",
"graded": "已批改",
"avg": "均分",
"median": "中位数",
"class": "班级",
"latestAvgCol": "最新均分",
"prevAvg": "上次均分",
"delta": "变化",
"overallAvgCol": "整体均分",
"active": "活跃",
"inactive": "非活跃"
}
}
},
"errors": {
"boundary": {
"title": "加载失败",
"description": "数据加载时发生错误,请重试",
"retry": "重试"
}
}
}