|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
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 } from 'antd';
|
|
|
|
|
import { Button, Card, Col, Layout, List, Menu, Progress, Row, Typography,Image } from 'antd';
|
|
|
|
|
import { PageContainer } from '@ant-design/pro-layout';
|
|
|
|
|
import { useParams, useRequest, history } from 'umi';
|
|
|
|
|
import { viewMyLearningSubject, getCourseExaminationProgressList } from './service';
|
|
|
|
@ -57,15 +57,16 @@ const CardList = () => {
|
|
|
|
|
total_question_count += item.question_count;
|
|
|
|
|
if (item.finish_count !== 0) {
|
|
|
|
|
let num = 0;
|
|
|
|
|
num = result.finish_count / result.question_count;
|
|
|
|
|
item.process = num.toFixed(4)
|
|
|
|
|
num = item.finish_count/item.question_count;
|
|
|
|
|
item.process = parseFloat(num).toFixed(2)
|
|
|
|
|
} else {
|
|
|
|
|
item.process = 0;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log('result.list',result.list)
|
|
|
|
|
if (total_finish_count !== 0) {
|
|
|
|
|
const total_num = total_finish_count / total_question_count;
|
|
|
|
|
total_process = total_num.toFixed(4)
|
|
|
|
|
total_process = parseFloat(total_num).toFixed(2)
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
total_process = 0;
|
|
|
|
@ -98,42 +99,59 @@ const CardList = () => {
|
|
|
|
|
|
|
|
|
|
const content = (
|
|
|
|
|
<div className={styles.pageHeaderContent}>
|
|
|
|
|
<Card
|
|
|
|
|
title={<a>{subject_data ? subject_data.subject_name : '--'}</a>}
|
|
|
|
|
hoverable={false}
|
|
|
|
|
className={styles.card}
|
|
|
|
|
actions={[]}
|
|
|
|
|
>
|
|
|
|
|
<Card.Meta
|
|
|
|
|
avatar={<img alt="" className={styles.cardAvatar} src={'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png'} style={{ width: '270px', height: '150px', borderRadius: '10px' }} />}
|
|
|
|
|
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 ? subject_data.subject_describe : '--'}
|
|
|
|
|
</Paragraph>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={16} style={{ display: 'inline-block', padding: 10 }}><span>章节模拟考试进度:</span><span style={{ display: 'inline-block', width: '80%' }}><Progress percent={total_process * 100} /></span></Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={4} style={{ padding: 10 }}>
|
|
|
|
|
<Button type="primary"
|
|
|
|
|
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>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Card.Grid>
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
|
|
|
|
{
|
|
|
|
|
subject_data.length!==0?
|
|
|
|
|
<Card
|
|
|
|
|
title={<a>{subject_data ? subject_data.subject_name : '--'}</a>}
|
|
|
|
|
hoverable={false}
|
|
|
|
|
className={styles.card}
|
|
|
|
|
actions={[]}
|
|
|
|
|
>
|
|
|
|
|
<Card.Meta
|
|
|
|
|
avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${subject_data.attachment_json.url}`} fallback="../fallback.svg" />}
|
|
|
|
|
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:'6rem'}}
|
|
|
|
|
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>
|
|
|
|
|
:<div/>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@ -178,7 +196,7 @@ 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?.progress * 100} />
|
|
|
|
|
<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={() => {
|
|
|
|
|