feat(admin): remove all department/campus scoping from frontend

- Delete CampusSwitcher component and useCampus hook
- Delete Departments page and its route
- Remove campus header interceptor from API client
- Remove departmentId from Class interfaces
- Remove campusLocation from student profile
- Remove department permissions from test fixtures
- Remove currentCampusId from test cleanup

TypeScript compiles clean.
This commit is contained in:
2026-07-09 17:40:57 +08:00
parent 22bc1876d8
commit b0f7883f33
12 changed files with 0 additions and 528 deletions

View File

@@ -1,36 +0,0 @@
import React from 'react';
import { Select, Typography } from 'antd';
import { EnvironmentOutlined } from '@ant-design/icons';
import { useCampus } from '../hooks/useCampus';
const CampusSwitcher: React.FC = () => {
const { campuses, currentId, switchCampus, loading } = useCampus();
if (campuses.length <= 1) {
return (
<Typography.Text style={{ color: '#fff', marginRight: 24 }}>
<EnvironmentOutlined style={{ marginRight: 4 }} />
{campuses[0]?.name || '主校区'}
</Typography.Text>
);
}
const options = [
...campuses.map((c) => ({ value: String(c.id), label: c.name })),
{ value: '', label: '全部校区' },
];
return (
<Select
value={currentId || undefined}
onChange={switchCampus}
options={options}
loading={loading}
style={{ minWidth: 140, marginRight: 24 }}
variant="borderless"
popupMatchSelectWidth={false}
/>
);
};
export default CampusSwitcher;

View File

@@ -53,7 +53,6 @@ interface ProfileData {
targetMajor?: string;
subjectDirection?: string;
grade?: string;
campusLocation?: string;
profileDate?: string;
notes?: string;
}
@@ -220,7 +219,6 @@ const ProfileTab: React.FC<{ data: ProfileData | null; studentId: number; onRefr
targetMajor: data?.targetMajor ?? undefined,
subjectDirection: data?.subjectDirection ?? undefined,
grade: data?.grade ?? undefined,
campusLocation: data?.campusLocation ?? undefined,
profileDate: data?.profileDate ? dayjs(data.profileDate) : undefined,
notes: data?.notes ?? undefined,
}}
@@ -238,9 +236,6 @@ const ProfileTab: React.FC<{ data: ProfileData | null; studentId: number; onRefr
<Form.Item name="grade" label="年级">
<Input placeholder="如:高三" />
</Form.Item>
<Form.Item name="campusLocation" label="校区">
<Input placeholder="请输入校区" />
</Form.Item>
<Form.Item name="profileDate" label="建档日期">
<DatePicker style={{ width: '100%' }} />
</Form.Item>
@@ -903,9 +898,6 @@ const StudentProfileContent: React.FC<StudentProfileContentProps> = ({
{profile?.subjectDirection && (
<Descriptions.Item label="选科方向">{profile.subjectDirection}</Descriptions.Item>
)}
{profile?.campusLocation && (
<Descriptions.Item label="校区">{profile.campusLocation}</Descriptions.Item>
)}
</Descriptions>
<Tabs