feat(web): migrate timetable query workflows

This commit is contained in:
biss authored and biss committed 2026-10-03 21:38:14 +08:00
1 parent dea8f70b48
commit 2ac0a82bb8
9 files changed
+115 -4

No files matched your search

+19
View File
@@ -28,6 +28,25 @@ export async function downloadApiFile(
}
}
export async function downloadApiPostFile(
path: string,
body: unknown,
fallbackName: string,
) {
const response = await http.post(path, body, { responseType: 'blob', timeout: 60000 })
const url = URL.createObjectURL(response.data)
try {
const anchor = document.createElement('a')
anchor.href = url
anchor.download = responseFileName(response.headers['content-disposition'], fallbackName)
document.body.appendChild(anchor)
anchor.click()
anchor.remove()
} finally {
URL.revokeObjectURL(url)
}
}
export async function importExcel(path: string, file: File) {
const form = new FormData()
form.append('file', file)
+4
View File
@@ -48,6 +48,7 @@ const CurriculumManagementPage = lazy(() => import('../pages/CurriculumManagemen
const PersonnelRegistryPage = lazy(() => import('../pages/PersonnelRegistryPage'))
const TeachingTasksPage = lazy(() => import('../pages/TeachingTasksPage'))
const SchedulesPage = lazy(() => import('../pages/SchedulesPage'))
const TimetableQueryPage = lazy(() => import('../pages/TimetableQueryPage'))
const AccountActivationPage = lazy(() => import('../pages/AccountActivationPage'))
const OfficialDocumentVerifyPage = lazy(() => import('../pages/OfficialDocumentVerifyPage'))
const ClassroomRepairReportPage = lazy(() => import('../pages/ClassroomRepairReportPage'))
@@ -95,6 +96,7 @@ function AppRoutes() {
<Route path="/verify/:verificationCode?" element={<OfficialDocumentVerifyPage />} />
<Route path="/classroom-repairs/report/:classroomId" element={<ClassroomRepairReportPage />} />
<Route path="/venue-display/:type/:id" element={<VenueDisplayPage />} />
<Route path="/timetable" element={<TimetableQueryPage />} />
<Route element={<ProtectedRoute />}>
<Route path="/dashboard" element={<DashboardPage />} />
<Route path="/account" element={<AccountPage />} />
@@ -142,6 +144,8 @@ function AppRoutes() {
<Route path="/students" element={<PersonnelRegistryPage />} />
<Route path="/teaching-tasks" element={<TeachingTasksPage />} />
<Route path="/schedules" element={<SchedulesPage />} />
<Route path="/class-timetable" element={<TimetableQueryPage />} />
<Route path="/teacher-timetable/:teacherId" element={<TimetableQueryPage />} />
<Route path="/" element={<Navigate to="/dashboard" replace />} />
</Route>
<Route path="*" element={<Navigate to="/dashboard" replace />} />
+3
View File
@@ -125,6 +125,9 @@ export default function AppShell() {
{ key: '/base-data/facilities', icon: <EnvironmentOutlined />, label: '教学场所' },
{ key: '/base-data/course-categories', icon: <SettingOutlined />, label: '课程分类' },
] : []),
...(roles.some((role) => ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Leader'].includes(role)) ? [
{ key: '/class-timetable', icon: <CalendarOutlined />, label: '课表查询中心' },
] : []),
...(roles.some((role) => ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Counselor'].includes(role)) ? [
{ key: '/teachers', icon: <TeamOutlined />, label: '教师档案' },
{ key: '/students', icon: <IdcardOutlined />, label: '学生档案' },
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff. Show more