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

@@ -96,6 +96,16 @@ export function toAdminLessonPlanListItem(detail: {
};
}
/**
* 格式化数量为展示字符串。
* 输入无效null/undefined/NaN/负数)返回 "0"。
*/
export function formatCount(count: number | null | undefined): string {
if (count === null || count === undefined) return "0";
if (!Number.isFinite(count) || count < 0) return "0";
return `${count}`;
}
/**
* 根据教案状态返回 Tailwind 徽章语义类名。
*/