|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
import { AlignLeftOutlined, LaptopOutlined, NotificationOutlined, PlusOutlined, UserOutlined } from '@ant-design/icons';
|
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography,Image } from 'antd';
|
|
|
|
|
import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography, Image, message } from 'antd';
|
|
|
|
|
import { PageContainer } from '@ant-design/pro-layout';
|
|
|
|
|
import { useParams, useRequest, history } from 'umi';
|
|
|
|
|
import { viewMyLearningSubject, getCourseExaminationProgressList } from './service';
|
|
|
|
|
import { viewMyLearningSubject, getCourseExaminationProgressList, getErrorQuestionList } from './service';
|
|
|
|
|
import type { CardListItemDataType } from './data.d';
|
|
|
|
|
import styles from './style.less';
|
|
|
|
|
import SubMenu from 'antd/lib/menu/SubMenu';
|
|
|
|
@ -29,8 +29,8 @@ const CardList = () => {
|
|
|
|
|
subject_id: params?.subject_id
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},{
|
|
|
|
|
onSuccess:(result)=>{
|
|
|
|
|
}, {
|
|
|
|
|
onSuccess: (result) => {
|
|
|
|
|
setSelectedMenu(result.chapter_list[0].chapter_id.toString())
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -62,13 +62,13 @@ const CardList = () => {
|
|
|
|
|
total_question_count += item.question_count;
|
|
|
|
|
if (item.finish_count !== 0) {
|
|
|
|
|
let num = 0;
|
|
|
|
|
num = item.finish_count/item.question_count;
|
|
|
|
|
num = item.finish_count / item.question_count;
|
|
|
|
|
item.process = parseFloat(num).toFixed(2)
|
|
|
|
|
} else {
|
|
|
|
|
item.process = 0;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log('result.list',result.list)
|
|
|
|
|
console.log('result.list', result.list)
|
|
|
|
|
if (total_finish_count !== 0) {
|
|
|
|
|
const total_num = total_finish_count / total_question_count;
|
|
|
|
|
total_process = parseFloat(total_num).toFixed(2)
|
|
|
|
@ -105,7 +105,7 @@ const CardList = () => {
|
|
|
|
|
const content = (
|
|
|
|
|
<div className={styles.pageHeaderContent}>
|
|
|
|
|
{
|
|
|
|
|
subject_data.length!==0?
|
|
|
|
|
subject_data.length !== 0 ?
|
|
|
|
|
<Card
|
|
|
|
|
title={<a>{subject_data ? subject_data.subject_name : '--'}</a>}
|
|
|
|
|
hoverable={false}
|
|
|
|
@ -117,42 +117,60 @@ const CardList = () => {
|
|
|
|
|
title={false}
|
|
|
|
|
description={
|
|
|
|
|
<>
|
|
|
|
|
<Card.Grid hoverable={false} style={{ width: '100%', padding: 0, boxShadow: 'none' }}>
|
|
|
|
|
<Paragraph className={styles.item} ellipsis={{ rows: 4 }} style={{ paddingLeft: 10 }}>
|
|
|
|
|
{subject_data ?
|
|
|
|
|
<div dangerouslySetInnerHTML={{__html:subject_data.subject_describe}}/>
|
|
|
|
|
: '--'}
|
|
|
|
|
</Paragraph>
|
|
|
|
|
|
|
|
|
|
</Card.Grid>
|
|
|
|
|
<Card.Grid hoverable={false} style={{width:'25%',textAlign:'center',boxShadow: 'none'}}>
|
|
|
|
|
<Button type="primary"
|
|
|
|
|
style={{width:'10rem',height:'5rem'}}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
console.log('last_data', last_data)
|
|
|
|
|
const info = subject_data.subject_id + "," + cookie.load('person_id')
|
|
|
|
|
console.log(subject_data, 'subject_data')
|
|
|
|
|
history.push(`/mockExamination/chapterExamination/chapterList/chapterErrorListPaper/${info}`)
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
>错题练习</Button>
|
|
|
|
|
</Card.Grid>
|
|
|
|
|
<Card.Grid hoverable={false} style={{width:'50%',textAlign:'center',boxShadow: 'none'}}>
|
|
|
|
|
<span style={{ display: 'inline-block', width:'100%' }}>
|
|
|
|
|
<Progress width={70}
|
|
|
|
|
type="circle"
|
|
|
|
|
percent={parseInt(total_process * 100)}
|
|
|
|
|
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
<span>章节模拟考试进度</span>
|
|
|
|
|
</Card.Grid>
|
|
|
|
|
<Card.Grid hoverable={false} style={{ width: '100%', padding: 0, boxShadow: 'none' }}>
|
|
|
|
|
<Paragraph className={styles.item} ellipsis={{ rows: 4 }} style={{ paddingLeft: 10 }}>
|
|
|
|
|
{subject_data ?
|
|
|
|
|
<div dangerouslySetInnerHTML={{ __html: subject_data.subject_describe }} />
|
|
|
|
|
: '--'}
|
|
|
|
|
</Paragraph>
|
|
|
|
|
|
|
|
|
|
</Card.Grid>
|
|
|
|
|
<Card.Grid hoverable={false} style={{ width: '25%', textAlign: 'center', boxShadow: 'none' }}>
|
|
|
|
|
<Button type="primary"
|
|
|
|
|
style={{ width: '10rem', height: '5rem' }}
|
|
|
|
|
onClick={async () => {
|
|
|
|
|
console.log('last_data', last_data)
|
|
|
|
|
const info = subject_data.subject_id + "," + cookie.load('person_id')
|
|
|
|
|
console.log(subject_data, 'subject_data')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _data1 = await getErrorQuestionList({
|
|
|
|
|
subject_id: params.subject_id,
|
|
|
|
|
person_id: cookie.load('person_id'),
|
|
|
|
|
});
|
|
|
|
|
let num = 0
|
|
|
|
|
if (_data1.success) {
|
|
|
|
|
_data1.list.map((e, i) => {
|
|
|
|
|
num += e.question_list.length
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
console.log(_data1, '_data1', num);
|
|
|
|
|
if (num > 0) {
|
|
|
|
|
history.push(`/mockExamination/chapterExamination/chapterList/chapterErrorListPaper/${info}`)
|
|
|
|
|
} else {
|
|
|
|
|
message.error("暂无错题");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
>错题练习</Button>
|
|
|
|
|
</Card.Grid>
|
|
|
|
|
<Card.Grid hoverable={false} style={{ width: '50%', textAlign: 'center', boxShadow: 'none' }}>
|
|
|
|
|
<span style={{ display: 'inline-block', width: '100%' }}>
|
|
|
|
|
<Progress width={70}
|
|
|
|
|
type="circle"
|
|
|
|
|
percent={parseInt(total_process * 100)}
|
|
|
|
|
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
<span>章节模拟考试进度</span>
|
|
|
|
|
</Card.Grid>
|
|
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
|
|
|
|
:<div/>
|
|
|
|
|
: <div />
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -202,15 +220,18 @@ const CardList = () => {
|
|
|
|
|
<div title={item?.course_name} style={{ paddingRight: '1rem', width: '30%', display: 'inline-block', verticalAlign: 'middle', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{item?.course_name}</div>
|
|
|
|
|
<div style={{ paddingRight: '1rem', width: '10%', display: 'inline-block' }}>{item?.finish_count}题/{item?.question_count}题</div>
|
|
|
|
|
<div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}>
|
|
|
|
|
<Progress percent={item?parseInt(item.process * 100):0} format={(percent) => percent === 100 ? '100%' : `${percent}%`}/>
|
|
|
|
|
<Progress percent={item ? parseInt(item.process * 100) : 0} format={(percent) => percent === 100 ? '100%' : `${percent}%`} />
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ paddingRight: '1rem', width: '20%', display: 'inline-block', textAlign: 'right' }}>
|
|
|
|
|
<Button type="primary" onClick={() => {
|
|
|
|
|
const info = cookie.load('identity_id') + ',' + item.chapter_id + ',' + item.course_id + ',' + item.finish_count + ',' + cookie.load('person_id') + ',' + item.subject_id;
|
|
|
|
|
console.log(info)
|
|
|
|
|
history.push(`/mockExamination/chapterExamination/chapterList/chapterListPaper/${info}`)
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
disabled={item.question_count > 0 ? false : true}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const info = cookie.load('identity_id') + ',' + item.chapter_id + ',' + item.course_id + ',' + item.finish_count + ',' + cookie.load('person_id') + ',' + item.subject_id;
|
|
|
|
|
console.log(info)
|
|
|
|
|
history.push(`/mockExamination/chapterExamination/chapterList/chapterListPaper/${info}`)
|
|
|
|
|
|
|
|
|
|
}}>开始考试</Button>
|
|
|
|
|
}}>开始考试</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -224,7 +245,7 @@ const CardList = () => {
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
</PageContainer>
|
|
|
|
|
</PageContainer >
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|