feat(portal-shell): 管理域全模块功能补齐与差异修复

按 ARCHITECTURE.md 与 admin-NeedTodo.md 要求补齐所有管理页面缺失功能:
- users/roles/permissions:权限矩阵搜索/折叠、zod 校验、value 字段
- audit-logs:行内详情对话框、分页页码、ChartCardShell
- school:CRUD 对话框、GradeOverviewCards、academic-year 侧栏
- announcements/invitation-codes/ai-settings:发布按钮、分页、zod 校验
- course-plans/elective:Select 导入、undefined 处理
- error-book/scheduling/questions/lesson-plans/attendance:统计卡片

验证:typecheck 0 错误、arch:scan 已更新
This commit is contained in:
SpecialX
2026-07-30 17:49:49 +08:00
parent 071542b757
commit f991bf0446
98 changed files with 25956 additions and 2140 deletions

View File

@@ -40,6 +40,20 @@ export interface FlexibleElectiveItem {
endDate?: string;
createdAt?: string;
updatedAt?: string;
/** 教室(@contract-pending对齐 CICD 列表"教室"列) */
classroom?: string;
/** 上课时间(@contract-pending对齐 CICD 列表"时间"列) */
schedule?: string;
/** 学分(@contract-pending对齐 CICD 列表"学分"列) */
credit?: number;
/** 选课模式(@contract-pendingFIRST_COME | LOTTERY */
selectionMode?: string;
/** 选课开始时间 ISO@contract-pending */
selectionStartAt?: string;
/** 选课结束时间 ISO@contract-pending */
selectionEndAt?: string;
/** 退课截止时间 ISO@contract-pending */
dropDeadline?: string;
}
/**
@@ -49,6 +63,20 @@ export interface FlexibleElectiveItem {
export function formatElectiveStatus(status: string): string {
return ELECTIVE_STATUS_LABEL[status] ?? status;
}
/** 选课模式枚举(@contract-pending */
export type ElectiveSelectionMode = "FIRST_COME" | "LOTTERY";
/** 选课模式中文标签映射(与 admin.elective.list i18n 对齐) */
export const ELECTIVE_SELECTION_MODE_LABEL: Record<string, string> = {
FIRST_COME: "先到先得",
LOTTERY: "抽签",
};
/**
* 将选课模式枚举值映射为中文标签。
* 未知模式回退为原始值。
*/
export function formatElectiveSelectionMode(mode: string): string {
return ELECTIVE_SELECTION_MODE_LABEL[mode] ?? mode;
}
/**
* 根据选修课状态返回 Tailwind 徽章语义类名。