import React from 'react'; import { Card, Empty, Input, Spin, Table } from 'antd'; import { ExportOutlined } from '@ant-design/icons'; import PermissionButton from '../../components/PermissionButton'; import { ADMIN_METRIC_META, STATUS_META, displayAttendanceStatus, type AdminStudentPanel, type AttendanceRecordItem, } from './AttendanceAdmin.helpers'; export const AttendanceAdminWorkspace: React.FC<{ metricFilter: string; studentSearch: string; onSearchChange: (value: string) => void; onExport: () => void; visibleStudents: AdminStudentPanel[]; loading: boolean; selectedStudentId?: number; onSelectStudent: (student: AdminStudentPanel) => void; sortAttendanceRecords: (items: readonly AttendanceRecordItem[]) => AttendanceRecordItem[]; sessionMap: Record; records: AttendanceRecordItem[]; columns: any[]; page: number; pageSize: number; total: number; onPageChange: (page: number, pageSize: number) => void; }> = ({ metricFilter, studentSearch, onSearchChange, onExport, visibleStudents, loading, selectedStudentId, onSelectStudent, sortAttendanceRecords, sessionMap, records, columns, page, pageSize, total, onPageChange, }) => { return ( <>

班级学生考勤

{metricFilter === 'all' ? `显示全部 ${visibleStudents.length} 名学生` : `筛出 ${ ADMIN_METRIC_META.find((item) => item.key === metricFilter)?.label || '' }相关 ${visibleStudents.length} 名学生`}
onSearchChange(event.target.value)} /> } onClick={onExport} > 导出
正常 请假 缺勤 仅显示当天已生成考勤的课程/时段,不再为无课时段补默认缺勤
{visibleStudents.length === 0 ? ( ) : (
{visibleStudents.map((student) => ( ))}
)}
rowKey="id" columns={columns} dataSource={records} loading={loading} scroll={{ x: 'max-content' }} pagination={{ current: page, pageSize, total, showSizeChanger: true, showTotal: (value) => `共 ${value} 条历史记录`, onChange: onPageChange, }} locale={{ emptyText: ( ), }} /> ); };