feat: improve admin responsive pages and teacher candidates

This commit is contained in:
2026-07-15 13:56:46 +08:00
parent fb9697bd05
commit d582d641c0
14 changed files with 406 additions and 87 deletions

View File

@@ -10,6 +10,7 @@ import dayjs from 'dayjs';
import api from '../../api';
import PermissionButton from '../../components/PermissionButton';
import { message } from '../../ui/app-message';
import { buildTeacherCandidateOptions, type TeacherCandidateUser } from './teacher-candidate';
// ---- Types ----
@@ -84,10 +85,7 @@ interface StudentItem {
studentNo?: string;
}
interface UserItem {
id: number;
username: string;
}
type UserItem = TeacherCandidateUser;
// ---- Constants ----
@@ -595,16 +593,13 @@ const ClassDetailPage: React.FC = () => {
<Space direction="vertical" style={{ width: '100%' }}>
<Select
style={{ width: '100%' }}
placeholder="选择教师"
showSearch
optionFilterProp="label"
placeholder="搜索姓名、用户名、角色或学科"
value={teacherUserId}
onChange={setTeacherUserId}
options={allUsers.map((u) => ({
value: u.id,
label: u.username,
}))}
filterOption={(input, option) =>
(option?.label as string)?.toLowerCase().includes(input.toLowerCase())
}
options={buildTeacherCandidateOptions(allUsers)}
notFoundContent="没有可分配的工作人员账号"
/>
<Select
style={{ width: '100%' }}