import React, { Component } from 'react'; import { Row, Col, Card, Table, Radio } from 'antd'; import { genAbsolutePicUrl } from '../../utils/utils'; import styles from './CourseItem.less'; function CourseTpl({ title, subTitle, coverUrl }) { return (
{title}
{subTitle}
); } class CourseItem extends Component { state = { openKey: 'lesson', }; handleRadioChange = (e) => { this.setState({ openKey: e.target.value }); }; render() { const { subItemList, supportList } = this.props; const lessonColumns = [{ title: '课编号', dataIndex: 'code', key: 1, width: '50%', }, { title: '课名称', dataIndex: 'title', key: 2, width: '50%', }]; const supportColumns = [{ title: '配套编号', dataIndex: 'code', key: 1, width: '50%', }, { title: '配套名称', dataIndex: 'name', key: 2, width: '50%', }]; return ( 课列表 周边配套 } style={{ height: 540 }} >{this.state.openKey === 'lesson' ? ( record.id} dataSource={subItemList} columns={lessonColumns} scroll={{ y: 400 }} className={styles.dataTable} /> ) : (
record.id} dataSource={supportList} columns={supportColumns} scroll={{ y: 400 }} className={styles.dataTable} /> )} ); } } export default CourseItem;