import React from 'react'; import './index.less'; import { Icon } from 'antd'; import Page from '@src/containers/Page'; import UserLayout from '../../../layouts/User'; import UserTable from '../../../components/UserTable'; import UserAction from '../../../components/UserAction'; import menu from '../index'; import Tabs from '../../../components/Tabs'; const columns = [ { key: '', title: '题型', fixSort: true }, { key: '', title: '题目ID', fixSort: true }, { key: '', title: '内容' }, { key: '', title: '耗时', sort: true }, { key: '', title: '错误率', sort: true }, { key: '', title: '最近做题' }, { key: '', title: '' }, ]; export default class extends Page { initState() { return { filterMap: {}, sortMap: {}, data: [], selectList: [], allChecked: false, page: 1, total: 1, }; } onFilter(value) { this.setState({ filterMap: value }); } onSort(value) { this.setState({ sortMap: value }); } onDataChange(page) { this.setState({ page, allChecked: false, selectList: [] }); } onAll(checked) { if (checked) { const { data = [] } = this.state; const list = []; data.forEach(item => { list.push(item.key); }); this.setState({ selectList: list, allChecked: true }); } else { this.setState({ selectList: [], allChecked: false }); } } onAction() {} onSelect(selectList) { this.setState({ selectList }); } renderView() { const { config } = this.props; return ; } renderTable() { const { filterMap = {}, sortMap = {}, selectList = [], data = [], allChecked, page, total } = this.state; return (
this.onFilter(value)} /> 2019-06-03 15:30 组卷50题,做对30题。移除正确题目
} onAll={checked => this.onAll(checked)} onAction={key => this.onAction(key)} /> this.onSelect(l)} onSort={v => this.onSort(v)} onChange={p => this.onDataChange(p)} /> ); } }