|
|
|
@ -107,11 +107,12 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
title: '确认删除', |
|
|
|
|
content: '你确定要删除这些选中的考试吗?', |
|
|
|
|
onOk: () => { |
|
|
|
|
const res = doDelete(ids); |
|
|
|
|
doDelete(ids).then(res => { |
|
|
|
|
if (!res) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
research(); |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
onCancel: () => { |
|
|
|
|
}, |
|
|
|
@ -142,11 +143,12 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
const validIds = validExams.map(exam => String(exam.examId)); |
|
|
|
|
|
|
|
|
|
if (validIds.length > 0) { |
|
|
|
|
const res = doCancel(validIds); |
|
|
|
|
doCancel(validIds).then(res => { |
|
|
|
|
if (!res) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
research(); |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onCancel: () => { |
|
|
|
@ -178,11 +180,12 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
const validIds = validExams.map(exam => String(exam.examId)); |
|
|
|
|
|
|
|
|
|
if (validIds.length > 0) { |
|
|
|
|
const res = doPublish(validIds); |
|
|
|
|
doPublish(validIds).then(res => { |
|
|
|
|
if (!res) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
research(); |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onCancel: () => { |
|
|
|
@ -238,11 +241,12 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
content: '你确定要发布这个考试吗?', |
|
|
|
|
onOk: () => { |
|
|
|
|
const ids = [String(examId)]; |
|
|
|
|
const res = doPublish(ids); |
|
|
|
|
doPublish(ids).then(res => { |
|
|
|
|
if (!res) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
research(); |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
onCancel: () => { |
|
|
|
|
}, |
|
|
|
@ -256,11 +260,12 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
content: '你确定要撤回这个考试吗?', |
|
|
|
|
onOk: () => { |
|
|
|
|
const ids = [String(examId)]; |
|
|
|
|
const res = doCancel(ids); |
|
|
|
|
doCancel(ids).then(res => { |
|
|
|
|
if (!res) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
research(); |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
onCancel: () => { |
|
|
|
|
}, |
|
|
|
@ -274,11 +279,12 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
content: '你确定要删除这个考试吗?', |
|
|
|
|
onOk: () => { |
|
|
|
|
const ids = [String(examId)]; |
|
|
|
|
const res = doDelete(ids); |
|
|
|
|
doDelete(ids).then(res => { |
|
|
|
|
if (!res) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
research(); |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
onCancel: () => { |
|
|
|
|
}, |
|
|
|
@ -363,7 +369,7 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
key: 'validFrom', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '考试无效日期', |
|
|
|
|
title: '考试失效日期', |
|
|
|
|
dataIndex: 'validTo', |
|
|
|
|
key: 'validTo', |
|
|
|
|
}, |
|
|
|
@ -395,7 +401,7 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
render: (cellValue: number, record: Exam) => ( |
|
|
|
|
<Space size="middle"> |
|
|
|
|
<a onClick={() => handleEdit(record.examId)}>编辑</a> |
|
|
|
|
{record.publishStatus === 1 ? ( |
|
|
|
|
{record.publishStatus === 1 && ( |
|
|
|
|
<a onClick={(e) => { |
|
|
|
|
if (record.publishStatus !== 1) { |
|
|
|
|
e.preventDefault(); |
|
|
|
@ -405,21 +411,12 @@ const ExamListPage = ({ history }: { history: any }) => { |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
生成考试码 |
|
|
|
|
</a>) : ( |
|
|
|
|
<span style={{ color: 'gray' }} >生成考试码</span> |
|
|
|
|
)} |
|
|
|
|
{/*<a onClick={(e) => {*/} |
|
|
|
|
{/* handleGenerateQrCode(record);*/} |
|
|
|
|
{/*}}*/} |
|
|
|
|
{/*>*/} |
|
|
|
|
{/* 生成考试码*/} |
|
|
|
|
{/*</a>*/} |
|
|
|
|
{record.publishStatus === 0 ? ( |
|
|
|
|
</a>)} |
|
|
|
|
{record.publishStatus === 0 || record.publishStatus === 2 && ( |
|
|
|
|
<a onClick={() => handlePublishSingle(record.examId)}>发布</a> |
|
|
|
|
) : record.publishStatus === 1 ? ( |
|
|
|
|
)} |
|
|
|
|
{record.publishStatus === 1 && ( |
|
|
|
|
<a onClick={() => handleWithdrawSingle(record.examId)}>撤回</a> |
|
|
|
|
) : ( |
|
|
|
|
<span style={{ color: 'gray' }}>撤回</span> |
|
|
|
|
)} |
|
|
|
|
<a onClick={() => handleDeleteSingle(record.examId)}>删除</a> |
|
|
|
|
</Space> |
|
|
|
|