+
);
diff --git a/src/pages/admin/ExamSubjectPage.tsx b/src/pages/admin/ExamSubjectPage.tsx
index d162f6b..af3bc6a 100644
--- a/src/pages/admin/ExamSubjectPage.tsx
+++ b/src/pages/admin/ExamSubjectPage.tsx
@@ -476,11 +476,13 @@ const ExamSubjectPage = () => {
columns={columns}
dataSource={subjects}
rowKey="id"
+ size="small"
loading={loading}
pagination={{
pageSize: 10,
showSizeChanger: true,
showTotal: (total) => `共 ${total} 条`,
+ size: 'small',
}}
/>
diff --git a/src/pages/admin/ExamTaskPage.tsx b/src/pages/admin/ExamTaskPage.tsx
index dccc124..a0612a6 100644
--- a/src/pages/admin/ExamTaskPage.tsx
+++ b/src/pages/admin/ExamTaskPage.tsx
@@ -213,32 +213,35 @@ const ExamTaskPage = () => {
title: '任务名称',
dataIndex: 'name',
key: 'name',
- width: 250,
+ width: 210,
ellipsis: true,
},
{
title: '考试科目',
dataIndex: 'subjectName',
key: 'subjectName',
- width: 200,
+ width: 180,
ellipsis: true,
},
{
title: '开始时间',
dataIndex: 'startAt',
key: 'startAt',
+ width: 110,
render: (text: string) => dayjs(text).format('YYYY-MM-DD HH:mm'),
},
{
title: '结束时间',
dataIndex: 'endAt',
key: 'endAt',
+ width: 110,
render: (text: string) => dayjs(text).format('YYYY-MM-DD HH:mm'),
},
{
title: '考试进程',
dataIndex: ['startAt', 'endAt'],
key: 'progress',
+ width: 160,
render: (_: any, record: ExamTask) => {
const now = dayjs();
const start = dayjs(record.startAt);
@@ -246,13 +249,10 @@ const ExamTaskPage = () => {
let progress = 0;
if (now < start) {
- // 尚未开始
progress = 0;
} else if (now > end) {
- // 已结束
progress = 100;
} else {
- // 进行中
const totalDuration = end.diff(start, 'millisecond');
const elapsedDuration = now.diff(start, 'millisecond');
progress = Math.round((elapsedDuration / totalDuration) * 100);
@@ -277,40 +277,46 @@ const ExamTaskPage = () => {
title: '参与人数',
dataIndex: 'userCount',
key: 'userCount',
+ width: 75,
render: (count: number) => `${count} 人`,
},
{
title: '已完成人数',
dataIndex: 'completedUsers',
key: 'completedUsers',
+ width: 75,
render: (count: number) => `${count} 人`,
},
{
title: '合格率',
dataIndex: 'passRate',
key: 'passRate',
+ width: 75,
render: (rate: number) => `${rate}%`,
},
{
title: '优秀率',
dataIndex: 'excellentRate',
key: 'excellentRate',
+ width: 75,
render: (rate: number) => `${rate}%`,
},
{
title: '创建时间',
dataIndex: 'createdAt',
key: 'createdAt',
+ width: 110,
render: (text: string) => dayjs(text).format('YYYY-MM-DD HH:mm'),
},
{
title:
操作
,
key: 'action',
- width: 120,
+ width: 230,
render: (_: any, record: ExamTask) => (
-
+
}
onClick={() => handleEdit(record)}
>
@@ -320,6 +326,7 @@ const ExamTaskPage = () => {
type="text"
icon={}
onClick={() => handleReport(record.id)}
+ size="small"
>
报表
@@ -329,7 +336,7 @@ const ExamTaskPage = () => {
okText="确定"
cancelText="取消"
>
- }>
+ } size="small">
删除
@@ -351,11 +358,14 @@ const ExamTaskPage = () => {
columns={columns}
dataSource={tasks}
rowKey="id"
+ size="small"
loading={loading}
+ scroll={{ x: 1400 }}
pagination={{
pageSize: 10,
showSizeChanger: true,
showTotal: (total) => `共 ${total} 条`,
+ size: 'small',
}}
/>
@@ -522,6 +532,7 @@ const ExamTaskPage = () => {
]}
dataSource={reportData.details}
rowKey="userId"
+ size="small"
pagination={false}
/>
diff --git a/src/pages/admin/QuestionCategoryPage.tsx b/src/pages/admin/QuestionCategoryPage.tsx
index 33110a6..7803a99 100644
--- a/src/pages/admin/QuestionCategoryPage.tsx
+++ b/src/pages/admin/QuestionCategoryPage.tsx
@@ -86,6 +86,8 @@ const QuestionCategoryPage = () => {
title: '类别名称',
dataIndex: 'name',
key: 'name',
+ align: 'center' as const,
+ width: 250,
render: (name: string) => (