考试信息

master
xialiang 3 years ago
parent f2af123d41
commit 1c6082ce88

@ -127,8 +127,23 @@ export default defineConfig({
{
name: '模拟考试',
icon: 'dashboard',
path: '/test',
component: './test',
path: '/RulesList',
routes: [
{
name: '考试概况(暂时废弃)',
icon: 'smile',
path: '/examination/intro',
component: './examination/intro',
hideInMenu: true,
},
{
name: '考试信息',
icon: 'smile',
path: '/examination/info/:examination_id',
component: './examination/info',
hideInMenu: true,
},
]
},
{
path: '/examination',
@ -142,6 +157,13 @@ export default defineConfig({
component: './examination/intro',
hideInMenu: true,
},
{
name: '考试信息',
icon: 'smile',
path: '/examination/info/:examination_id',
component: './examination/info',
hideInMenu: true,
},
{
name: '考试试卷',
icon: 'smile',

@ -63,7 +63,7 @@ const examinationColumns = [
dataIndex: 'appyTime',
key: 'appyTime',
render: (dom, entity) => {
return <div>{entity.apply_start_time}<br />{entity.apply_end_time}</div>
return <div>{entity.apply_start_time}<br />{entity.apply_end_time}</div>
},
},
@ -72,7 +72,7 @@ const examinationColumns = [
dataIndex: 'examTime',
key: 'examTime',
render: (dom, entity) => {
return <div>{entity.examination_start_time}<br />{entity.examination_end_time}</div>
return <div>{entity.examination_start_time}<br />{entity.examination_end_time}</div>
},
},
{
@ -80,7 +80,26 @@ const examinationColumns = [
dataIndex: 'option',
key: 'option',
render: (_, record, index, action) => {
return record?.status === 0 ? <Button type="primary" onClick={() => { history.push('/registration') }} style={{ minWidth: 88 }}></Button> : <Button type="text" onClick={() => { history.push('/examination/paper') }} style={{ minWidth: 88 }}></Button>
// return record?.status === 0 ? <Button type="primary" onClick={() => { history.push('/registration' + record.examination_id) }}>去报名</Button> : <Button type="primary" onClick={() => { history.push('/examination/paper') }}> 参加考试</Button >
switch (record.status_type) {
case 0:
return "待报名"
break;
case 1:
return "报名中"
break;
case 2:
return "待考试"
break;
case 3:
return <Button onClick={() => { history.push('/examination/info/' + record.examination_id) }}></Button>
break;
case 4:
return "考试完成"
break;
default:
break;
}
},
},
];
@ -97,7 +116,7 @@ const certificateColumns = [
dataIndex: 'examTime',
key: 'examTime',
render: (dom, entity) => {
return <div>{entity.examination_start_time}<br />{entity.examination_end_time}</div>
return <div>{entity.examination_start_time}<br />{entity.examination_end_time}</div>
},
},
@ -209,7 +228,7 @@ const Workplace: FC = () => {
return (
<>
<Row gutter={24}>
<Col xl={12} lg={12} md={12} sm={12} xs={12}>
<Col xl={10} lg={10} md={10} sm={10} xs={10}>
<Card
className={styles.projectList}
style={{ marginBottom: 24 }}
@ -259,7 +278,7 @@ const Workplace: FC = () => {
<Progress percent={lastLearningList?.learning_progress} />
</Card>
</Col>
<Col xl={12} lg={12} md={12} sm={12} xs={12}>
<Col xl={14} lg={14} md={14} sm={14} xs={14}>
<Card
style={{ marginBottom: 24 }}
title="资质考试"

@ -0,0 +1,154 @@
import { PlusOutlined } from '@ant-design/icons';
import { Button, Card, Descriptions, Alert, Typography } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import { useRequest, useParams } from 'umi';
import { getExaminationById, getRulesById } from './service';
import type { CardListItemDataType } from './data.d';
import styles from './style.less';
import { useEffect, useRef } from 'react';
import type { ProDescriptionsActionType } from '@ant-design/pro-descriptions';
import ProDescriptions from '@ant-design/pro-descriptions';
const { Paragraph } = Typography;
import ProCard from '@ant-design/pro-card';
const CardList = () => {
const params = useParams();
// 获取考试详情
// const { loading: personExaminationLoading, data: examinationInfo = [] } = useRequest(
// () => getExaminationById(
// {
// examination_id: params.examination_id
// }), {
// formatResult: (result) => {
// return result.bean;
// }
// });
// useEffect(() => {
// console.log('examinationInfo', examinationInfo)
// })
const actionRef = useRef<ProDescriptionsActionType>();
return (
<PageContainer content={''} extraContent={''}>
<ProCard>
<ProDescriptions
actionRef={actionRef}
title="考试详情"
request={async () => {
const examinationInfo = await getExaminationById({ examination_id: params.examination_id })
const rulesInfo = await getRulesById({ id: examinationInfo.bean.rules_id })
const exData = { data: { ...examinationInfo.bean, ...rulesInfo.bean } }
console.log("exData", exData);
return exData;
}}
layout='horizontal'
columns={[
{
title: '考试项目',
key: 'text',
dataIndex: 'examination_name',
},
{
title: '考试时间',
key: 'state2',
render: (dom, entity, index, action) => {
return entity.examination_start_time + " - " + entity.examination_end_time
},
},
{
title: '考试时长',
key: 'examination_time',
dataIndex: 'examination_time',
valueType: 'text',
render: (dom, entity, index, action) => {
// return entity.examination_start_time + " - " + entity.examination_start_time
const d1 = new Date(entity.examination_start_time);
const d2 = new Date(entity.examination_end_time);
const examination_time = parseInt((d2 - d1) / 1000 / 60)
return examination_time + "分钟"
},
},
{
title: '满分',
key: 'sum_score',
dataIndex: 'sum_score',
valueType: 'text',
},
{
title: '通过标准',
key: 'pass_score',
dataIndex: 'pass_score',
valueType: 'text',
},
{
title: '操作',
valueType: 'option',
render: () => [
<a target="_blank" rel="noopener noreferrer" key="link">
</a>,
<a target="_blank" rel="noopener noreferrer" key="warning">
</a>,
<a target="_blank" rel="noopener noreferrer" key="view">
</a>,
],
},
]}
column={1}
>
<ProDescriptions.Item >
<Button type="primary"></Button>
</ProDescriptions.Item>
<ProDescriptions.Item >
<Alert message="考试开始后,不可随意离开,离开答题页,依然记录时间。" showIcon type="error" style={{ width: "100%" }} />
</ProDescriptions.Item>
{/* <ProDescriptions.Item dataIndex="考试项目" layout='horizontal' />
<ProDescriptions.Item label="考试时间" dataIndex="examination_name" >
{this.data.id}
</ProDescriptions.Item>
<ProDescriptions.Item label="考试时长" dataIndex="examination_name" />
<ProDescriptions.Item label="满分" dataIndex="sum_score" />
<ProDescriptions.Item label="通过标准" dataIndex="pass_score" />
<ProDescriptions.Item label="操作">
<Button
type="primary"
onClick={() => {
actionRef.current?.reload();
}}
key="reload"
>
</Button>
<Button key="rest"></Button>
</ProDescriptions.Item> */}
</ProDescriptions >
</ProCard>
</PageContainer >
);
};
export default CardList;

@ -1,10 +1,31 @@
import { request } from 'umi';
import type { CardListItemDataType } from './data.d';
export async function queryFakeList(params: {
count: number;
/**
*
* /dsideal_yy/zygh/training/examination/getExaminationById
* @param params
* @returns
*/
export async function getExaminationById(params: {
page_size: number;
//count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('/api/card_fake_list', {
return request('/dsideal_yy/zygh/training/examination/getExaminationById', {
params,
});
}
/**
*
* /dsideal_yy/zygh/training/rules/getRulesById
* @param params
* @returns
*/
export async function getRulesById(params: {
page_size: number;
//count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('/dsideal_yy/zygh/training/rules/getRulesById', {
params,
});
}
Loading…
Cancel
Save