feat: add exam score management

This commit is contained in:
2026-07-21 16:04:17 +08:00
parent 37ef6f9dd7
commit cbc04fea4f
27 changed files with 1061 additions and 16 deletions

View File

@@ -11,6 +11,7 @@ const academicPermissions = [
'dashboard:view',
'student:view',
'class:view',
'exam:view',
'teacher:view',
'schedule:view',
'attendance:view',
@@ -54,6 +55,7 @@ describe('role-aware menu policy', () => {
expect(menu.map((item) => item.label)).toEqual(['数据面板', '教务管理', '通知中心']);
expect(paths.filter((path) => path === '/schedules')).toHaveLength(1);
expect(paths.filter((path) => path === '/attendance')).toHaveLength(1);
expect(paths).toContain('/exams');
expect(paths).not.toContain('/teacher-workspace');
});

View File

@@ -61,6 +61,7 @@ const SECTIONS: MenuSection[] = [
children: [
{ key: '/students', label: '学生管理', icon: 'students', permission: 'student:view' },
{ key: '/classes', label: '班级管理', icon: 'classes', permission: 'class:view' },
{ key: '/exams', label: '考试管理', icon: 'exam', permission: 'exam:view' },
{ key: '/teachers', label: '教师管理', icon: 'teachers', permission: 'teacher:view' },
{ key: '/schedules', label: '排课管理', icon: 'calendar', permission: 'schedule:view' },
{ key: '/attendance', label: '历史考勤', icon: 'attendance', permission: 'attendance:view' },

View File

@@ -30,6 +30,7 @@ describe('permission navigation', () => {
it('keeps route permission lookup aligned for nested detail routes', () => {
expect(getRequiredPermission('/classes/12')).toBe('class:view');
expect(getRequiredPermission('/students/8/profile')).toBe('student:view');
expect(getRequiredPermission('/exams/8')).toBe('exam:view');
expect(canAccessPath('/ai-config', ['ai:config:read'])).toBe(true);
expect(canAccessPath('/ai-config', ['integration:read'])).toBe(false);
});

View File

@@ -24,6 +24,11 @@ export const PERMISSION_PAGES: readonly PermissionPage[] = [
permission: 'class:view',
matches: (p) => p === '/classes' || /^\/classes\/\d+$/.test(p),
},
{
path: '/exams',
permission: 'exam:view',
matches: (p) => p === '/exams' || /^\/exams\/\d+$/.test(p),
},
{ path: '/attendance', permission: 'attendance:view' },
{ path: '/schedules', permission: 'schedule:view' },
{ path: '/classroom-schedule', permission: 'rental:view' },