zhengpengju 3 years ago
commit bd51d4d86c

@ -99,7 +99,11 @@ const CardList = () => {
JSON.stringify(last_data)!=='{}'?
<>
<Row>
<Col span={16} style={{ display: 'inline-block', padding: 10 }}><span></span><span style={{ display: 'inline-block', width: '80%' }}><Progress percent={subject_data ? subject_data.subject_learning_progress * 100 : 0} /></span></Col>
<Col span={16} style={{ display: 'inline-block', padding: 10 }}><span></span><span style={{ display: 'inline-block', width: '80%' }}>
<Progress percent={subject_data ? subject_data.subject_learning_progress * 100 : 0}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</span></Col>
</Row>
<Row>
<Col span={10} style={{ padding: 10 }}><span></span><span>{last_data ? last_data.course_name : '--'}</span></Col>
@ -169,7 +173,9 @@ 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?.course_hours}</div>
<div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}>
<Progress percent={item?.learning_progress * 100} />
<Progress percent={item?.learning_progress * 100}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</div>
<div style={{ paddingRight: '1rem', width: '20%', display: 'inline-block', textAlign: 'right' }}>
<Button type="primary" onClick={() => {

@ -70,7 +70,12 @@ const SubjectList = () => {
<div dangerouslySetInnerHTML={{__html:item.subject_describe}}/>
</Paragraph>
</Card.Grid>
<Card.Grid hoverable={false} style={{width:'30%',textAlign:'center'}}><Progress type="circle" percent={item?.subject_learning_progress*100} /></Card.Grid>
<Card.Grid hoverable={false} style={{width:'30%',textAlign:'center'}}>
<Progress type="circle"
percent={item?.subject_learning_progress*100}
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
/>
</Card.Grid>
<Card.Grid hoverable={false} style={{width:'20%',textAlign:'center'}}>
<Button type="primary" onClick={()=>{
const info=item.data_id+','+item.data_type+','+item.subject_id;

@ -44,20 +44,20 @@ const SubjectList = () => {
hoverable
className={styles.card}
actions={[]}
extra={<><span style={{ padding: 10 }}>:{item?.learning_start_time}</span><span style={{ padding: 10 }}>{item?.distance_end_time}</span><span style={{ padding: 10 }}>{item?.total_course_hours}</span></>}
// extra={<><span style={{ padding: 10 }}>开始学习时间:{item?.learning_start_time}</span><span style={{ padding: 10 }}>距离结束时间:{item?.distance_end_time}</span><span style={{ padding: 10 }}>考核学时:{item?.total_course_hours}小时</span></>}
>
<Card.Meta
avatar={<Image preview={false} width={200} height={150} src={`${item.attachment_json.url}`} fallback="../fallback.svg" />}
avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${item.attachment_json.url}`} fallback="../fallback.svg" />}sss
title={false}
description={
<>
<Card.Grid hoverable={false} style={{ width: '50%', padding: 0 }}>
<Paragraph className={styles.item} ellipsis={{ rows: 4 }}>
{item.subject_describe}
<div dangerouslySetInnerHTML={{__html:item.subject_describe}}/>
</Paragraph>
</Card.Grid>
<Card.Grid hoverable={false} style={{ width: '30%', textAlign: 'center' }}><Progress type="circle" percent={item?.subject_learning_progress * 100} /></Card.Grid>
<Card.Grid hoverable={false} style={{ width: '20%', textAlign: 'center' }}>
{/*<Card.Grid hoverable={false} style={{ width: '30%', textAlign: 'center' }}><Progress type="circle" percent={item?.subject_learning_progress * 100} /></Card.Grid>*/}
<Card.Grid hoverable={false} style={{ width: '50%', textAlign: 'right' }}>
<Button type="primary" onClick={() => {
const info = item.data_id + ',' + item.data_type + ',' + item.subject_id;
history.push(`/mockExamination/chapterExamination/chapterList/${item.data_id}/${item.data_type}/${item.subject_id}`);

@ -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={() => {

Loading…
Cancel
Save