|
|
|
@ -17,6 +17,7 @@ const CardList = () => {
|
|
|
|
|
const ids = params.msg.split(',');
|
|
|
|
|
|
|
|
|
|
const [currentCourse, SetCurrentCourse] = useState()
|
|
|
|
|
const [selectedMenu, setSelectedMenu] = useState('')
|
|
|
|
|
|
|
|
|
|
/** 获取主题下课程 */
|
|
|
|
|
const { data } = useRequest(() => {
|
|
|
|
@ -33,6 +34,7 @@ const CardList = () => {
|
|
|
|
|
result.subject.startTime= result.subject.learning_start_time.split(' ')[0];
|
|
|
|
|
result.subject.endTime= result.subject.learning_end_time.split(' ')[0];
|
|
|
|
|
console.log('result9999',result);
|
|
|
|
|
setSelectedMenu(result.chapter_list[0].chapter_id.toString())
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -81,7 +83,12 @@ const CardList = () => {
|
|
|
|
|
hoverable={false}
|
|
|
|
|
className={styles.card}
|
|
|
|
|
actions={[]}
|
|
|
|
|
extra={<><span style={{ padding: 10 }}>开始学习时间: {subject_data ? subject_data.startTime : '--'}</span><span style={{ padding: 10 }}>距离结束时间:{subject_data ? subject_data.distance_end_time : '--'}</span><span style={{padding:10}}>学习结束时间:{subject_data?subject_data.endTime:'--'}</span><span style={{ padding: 10 }}>考核学时:{subject_data ? subject_data.total_course_hours : '--'}小时</span></>}
|
|
|
|
|
extra={<>
|
|
|
|
|
<span style={{ padding: 10 }}>学习开始时间: {subject_data ? subject_data.startTime : '--'}</span>
|
|
|
|
|
<span style={{ padding: 10 }}>距离结束时间:{subject_data ? subject_data.distance_end_time : '--'}</span>
|
|
|
|
|
<span style={{padding:10}}>学习结束时间:{subject_data?subject_data.endTime:'--'}</span>
|
|
|
|
|
<span style={{ padding: 10 }}>考核学时:{subject_data ? subject_data.total_course_hours : '--'}学时</span>
|
|
|
|
|
</>}
|
|
|
|
|
>
|
|
|
|
|
<Card.Meta
|
|
|
|
|
avatar={<Image preview={false} width={200} height={150} src={`/dsideal_yy/html/${subject_data.attachment_json.url}`} fallback="../fallback.svg" />}
|
|
|
|
@ -100,7 +107,7 @@ const CardList = () => {
|
|
|
|
|
<>
|
|
|
|
|
<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}
|
|
|
|
|
<Progress percent={subject_data ? parseInt(subject_data.subject_learning_progress * 100) : 0}
|
|
|
|
|
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
|
|
|
|
|
/>
|
|
|
|
|
</span></Col>
|
|
|
|
@ -139,7 +146,7 @@ const CardList = () => {
|
|
|
|
|
<Col span={6} style={{ paddingRight: 24 }}>
|
|
|
|
|
<Menu
|
|
|
|
|
mode="inline"
|
|
|
|
|
selectedKeys={[chapter_list.length !== 0 ? chapter_list[0].chapter_id.toString() : '']}
|
|
|
|
|
selectedKeys={[selectedMenu]}
|
|
|
|
|
defaultOpenKeys={['sub1']}
|
|
|
|
|
style={{ height: '100%', width: '100%' }}
|
|
|
|
|
>
|
|
|
|
@ -151,6 +158,7 @@ const CardList = () => {
|
|
|
|
|
<Menu.Item
|
|
|
|
|
key={item.chapter_id}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setSelectedMenu(item.chapter_id.toString())
|
|
|
|
|
run({ subject_id: item.subject_id, chapter_id: item.chapter_id })
|
|
|
|
|
}}
|
|
|
|
|
>{item.chapter_name}</Menu.Item>
|
|
|
|
@ -161,6 +169,7 @@ const CardList = () => {
|
|
|
|
|
|
|
|
|
|
</SubMenu>
|
|
|
|
|
</Menu>
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={18} style={{ background: '#ffffff', padding: 24, minHeight: '20rem' }}>
|
|
|
|
|
{
|
|
|
|
@ -171,9 +180,9 @@ const CardList = () => {
|
|
|
|
|
<div style={{ marginBottom: '2rem', }}>
|
|
|
|
|
<div style={{ paddingRight: '1rem', width: '10%', display: 'inline-block' }}>第{item?.sort_no}讲</div>
|
|
|
|
|
<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: '10%', display: 'inline-block' }}>{item?.course_hours*60}分钟</div>
|
|
|
|
|
<div style={{ paddingRight: '1rem', width: '30%', display: 'inline-block' }}>
|
|
|
|
|
<Progress percent={item?.learning_progress * 100}
|
|
|
|
|
<Progress percent={item?parseInt(item.learning_progress * 100):0}
|
|
|
|
|
format={(percent) => percent === 100 ? '100%' : `${percent}%`}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|