dvc890 commited on
Commit
fc41832
·
verified ·
1 Parent(s): cec485b

Update components/Sidebar.tsx

Browse files
Files changed (1) hide show
  1. components/Sidebar.tsx +4 -4
components/Sidebar.tsx CHANGED
@@ -1,4 +1,3 @@
1
-
2
  import React from 'react';
3
  import { LayoutDashboard, Users, BookOpen, GraduationCap, Settings, LogOut, FileText, School, UserCog, Palette, X, Building } from 'lucide-react';
4
  import { UserRole } from '../types';
@@ -17,10 +16,11 @@ export const Sidebar: React.FC<SidebarProps> = ({ currentView, onChangeView, use
17
  { id: 'dashboard', label: '工作台', icon: LayoutDashboard, roles: [UserRole.ADMIN, UserRole.TEACHER] },
18
  { id: 'students', label: '学生管理', icon: Users, roles: [UserRole.ADMIN, UserRole.TEACHER] },
19
  { id: 'classes', label: '班级管理', icon: School, roles: [UserRole.ADMIN] },
20
- { id: 'schools', label: '学校管理', icon: Building, roles: [UserRole.ADMIN] }, // New
21
  { id: 'courses', label: '课程管理', icon: BookOpen, roles: [UserRole.ADMIN, UserRole.TEACHER, UserRole.STUDENT] },
22
  { id: 'grades', label: '成绩管理', icon: GraduationCap, roles: [UserRole.ADMIN, UserRole.TEACHER, UserRole.STUDENT] },
23
- { id: 'reports', label: '报表统计', icon: FileText, roles: [UserRole.ADMIN] },
 
24
  { id: 'subjects', label: '学科设置', icon: Palette, roles: [UserRole.ADMIN] },
25
  { id: 'users', label: '用户管理', icon: UserCog, roles: [UserRole.ADMIN] },
26
  { id: 'settings', label: '系统设置', icon: Settings, roles: [UserRole.ADMIN] },
@@ -80,4 +80,4 @@ export const Sidebar: React.FC<SidebarProps> = ({ currentView, onChangeView, use
80
  </div>
81
  </>
82
  );
83
- };
 
 
1
  import React from 'react';
2
  import { LayoutDashboard, Users, BookOpen, GraduationCap, Settings, LogOut, FileText, School, UserCog, Palette, X, Building } from 'lucide-react';
3
  import { UserRole } from '../types';
 
16
  { id: 'dashboard', label: '工作台', icon: LayoutDashboard, roles: [UserRole.ADMIN, UserRole.TEACHER] },
17
  { id: 'students', label: '学生管理', icon: Users, roles: [UserRole.ADMIN, UserRole.TEACHER] },
18
  { id: 'classes', label: '班级管理', icon: School, roles: [UserRole.ADMIN] },
19
+ { id: 'schools', label: '学校管理', icon: Building, roles: [UserRole.ADMIN] },
20
  { id: 'courses', label: '课程管理', icon: BookOpen, roles: [UserRole.ADMIN, UserRole.TEACHER, UserRole.STUDENT] },
21
  { id: 'grades', label: '成绩管理', icon: GraduationCap, roles: [UserRole.ADMIN, UserRole.TEACHER, UserRole.STUDENT] },
22
+ // Update: Allow TEACHER to access reports
23
+ { id: 'reports', label: '报表统计', icon: FileText, roles: [UserRole.ADMIN, UserRole.TEACHER] },
24
  { id: 'subjects', label: '学科设置', icon: Palette, roles: [UserRole.ADMIN] },
25
  { id: 'users', label: '用户管理', icon: UserCog, roles: [UserRole.ADMIN] },
26
  { id: 'settings', label: '系统设置', icon: Settings, roles: [UserRole.ADMIN] },
 
80
  </div>
81
  </>
82
  );
83
+ };