import React, { PureComponent } from 'react'; import moment from 'moment'; import { Table, Pagination, Select, Input } from 'antd'; import RBVideoPlayer from '../../components/RBVideoPlayer'; import styles from './VideoPlayList.less'; export default class VideoPlayList extends PureComponent { constructor(props) { super(props); this.state = { currentPlayingIndex: 0, searchSelectKey: 'code', searchInputValue: '', }; } componentWillReceiveProps(nextProps) { const { dataSource } = nextProps; if (dataSource && dataSource.length) { this.setState({ currentPlayingIndex: 0 }); } } handleOnRowClick = (index) => { this.setState({ currentPlayingIndex: index }); } handleSearchSelectChange = (value) => { this.setState({ searchSelectKey: value }); } handleInputChange = (e) => { this.setState({ searchInputValue: e.target.value }); } handleFilterOperation = (params) => { const { pageSize, pageNo, onFilterClick } = this.props; const { searchSelectKey, searchInputValue } = this.state; onFilterClick({ pageNo, pageSize, [searchSelectKey]: searchInputValue, ...params, }); } handleSearchBtnClick = () => { this.handleFilterOperation(); } handleTablePageChange = (page, pageSize) => { this.handleFilterOperation({ pageSize, pageNo: page, }); } handleTablePageSizeChange = (current, size) => { this.handleFilterOperation({ pageSize: size, pageNo: current, }); } render() { const { dataSource, loading, totalSize, pageSize, pageNo } = this.props; const renderQuality = (quality) => { if (quality === 'high') { return '高清'; } else { return '标清'; } }; const renderItem = (data) => { return (
{'编号: '} {`${data.code}`}
{'名称: '} {`${data.name}`}
{'格式: '} {`${renderQuality(data.quality)}[${data.format}]`}
{'时间: '} {`${moment(data.gmtModified).format('YYYY-MM-DD HH:mm:ss')}`}