Spaces:
Sleeping
Sleeping
Upload 46 files
Browse files- components/Sidebar.tsx +2 -2
- pages/CourseList.tsx +1 -1
- pages/Wishes.tsx +1 -1
- types.ts +2 -0
components/Sidebar.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
|
| 2 |
import React from 'react';
|
| 3 |
-
import { LayoutDashboard, Users, BookOpen, GraduationCap, Settings, LogOut, FileText, School, UserCog, Palette, X, Building, Gamepad2, CalendarCheck, UserCircle,
|
| 4 |
import { UserRole } from '../types';
|
| 5 |
|
| 6 |
interface SidebarProps {
|
|
@@ -19,7 +19,7 @@ export const Sidebar: React.FC<SidebarProps> = ({ currentView, onChangeView, use
|
|
| 19 |
{ id: 'dashboard', label: '工作台', icon: LayoutDashboard, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER, UserRole.STUDENT] },
|
| 20 |
{ id: 'attendance', label: '考勤管理', icon: CalendarCheck, roles: [UserRole.TEACHER, UserRole.PRINCIPAL] },
|
| 21 |
{ id: 'games', label: '互动教学', icon: Gamepad2, roles: [UserRole.TEACHER, UserRole.STUDENT] }, // Removed PRINCIPAL
|
| 22 |
-
{ id: 'wishes', label: '许愿 & 反馈', icon:
|
| 23 |
{ id: 'students', label: '学生管理', icon: Users, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER] },
|
| 24 |
{ id: 'classes', label: '班级管理', icon: School, roles: [UserRole.ADMIN, UserRole.PRINCIPAL] },
|
| 25 |
{ id: 'schools', label: '学校管理', icon: Building, roles: [UserRole.ADMIN] }, // Only Super Admin can manage schools
|
|
|
|
| 1 |
|
| 2 |
import React from 'react';
|
| 3 |
+
import { LayoutDashboard, Users, BookOpen, GraduationCap, Settings, LogOut, FileText, School, UserCog, Palette, X, Building, Gamepad2, CalendarCheck, UserCircle, MessageCircle } from 'lucide-react';
|
| 4 |
import { UserRole } from '../types';
|
| 5 |
|
| 6 |
interface SidebarProps {
|
|
|
|
| 19 |
{ id: 'dashboard', label: '工作台', icon: LayoutDashboard, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER, UserRole.STUDENT] },
|
| 20 |
{ id: 'attendance', label: '考勤管理', icon: CalendarCheck, roles: [UserRole.TEACHER, UserRole.PRINCIPAL] },
|
| 21 |
{ id: 'games', label: '互动教学', icon: Gamepad2, roles: [UserRole.TEACHER, UserRole.STUDENT] }, // Removed PRINCIPAL
|
| 22 |
+
{ id: 'wishes', label: '许愿 & 反馈', icon: MessageCircle, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER, UserRole.STUDENT] }, // NEW
|
| 23 |
{ id: 'students', label: '学生管理', icon: Users, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER] },
|
| 24 |
{ id: 'classes', label: '班级管理', icon: School, roles: [UserRole.ADMIN, UserRole.PRINCIPAL] },
|
| 25 |
{ id: 'schools', label: '学校管理', icon: Building, roles: [UserRole.ADMIN] }, // Only Super Admin can manage schools
|
pages/CourseList.tsx
CHANGED
|
@@ -169,7 +169,7 @@ export const CourseList: React.FC = () => {
|
|
| 169 |
<div className="flex gap-2 pt-2 border-t border-gray-50">
|
| 170 |
<button onClick={() => {
|
| 171 |
setFormData({
|
| 172 |
-
courseCode: c.courseCode,
|
| 173 |
courseName: c.courseName,
|
| 174 |
teacherName: c.teacherName,
|
| 175 |
teacherId: c.teacherId || '',
|
|
|
|
| 169 |
<div className="flex gap-2 pt-2 border-t border-gray-50">
|
| 170 |
<button onClick={() => {
|
| 171 |
setFormData({
|
| 172 |
+
courseCode: c.courseCode || '',
|
| 173 |
courseName: c.courseName,
|
| 174 |
teacherName: c.teacherName,
|
| 175 |
teacherId: c.teacherId || '',
|
pages/Wishes.tsx
CHANGED
|
@@ -63,7 +63,7 @@ export const Wishes: React.FC = () => {
|
|
| 63 |
if (user?.role === UserRole.STUDENT) {
|
| 64 |
// Get student info to check className
|
| 65 |
const stus = await api.students.getAll();
|
| 66 |
-
const me = stus.find(s => s.studentNo === user.username || s.name === user.trueName);
|
| 67 |
if (me) {
|
| 68 |
setStudentInfo(me);
|
| 69 |
// Fetch available teachers for student
|
|
|
|
| 63 |
if (user?.role === UserRole.STUDENT) {
|
| 64 |
// Get student info to check className
|
| 65 |
const stus = await api.students.getAll();
|
| 66 |
+
const me = stus.find((s: Student) => s.studentNo === user.username || s.name === user.trueName);
|
| 67 |
if (me) {
|
| 68 |
setStudentInfo(me);
|
| 69 |
// Fetch available teachers for student
|
types.ts
CHANGED
|
@@ -33,6 +33,8 @@ export interface User {
|
|
| 33 |
status: 'PENDING' | 'APPROVED' | 'REJECTED';
|
| 34 |
};
|
| 35 |
studentNo?: string;
|
|
|
|
|
|
|
| 36 |
}
|
| 37 |
|
| 38 |
export interface School {
|
|
|
|
| 33 |
status: 'PENDING' | 'APPROVED' | 'REJECTED';
|
| 34 |
};
|
| 35 |
studentNo?: string;
|
| 36 |
+
parentName?: string;
|
| 37 |
+
parentPhone?: string;
|
| 38 |
}
|
| 39 |
|
| 40 |
export interface School {
|