Commit 5425415f by chenshu

fix:修复管理端部分问题

parent 6e5f9023
......@@ -141,22 +141,26 @@ export default class OfflineCourseData extends React.Component {
return columns;
}
handleChangeTable = () => {
handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter;
const { query } = this.props;
const { query } = this.state;
let orderEnum;
// 按创建时间升序排序
if (columnKey === 'joinInTime' && order === 'ascend') { orderEnum = 'JOIN_IN_DESC'; }
if (columnKey === 'joinOutTime' && order === 'ascend') { orderEnum = 'JOIN_IN_ASC'; }
// 按创建时间降序排序
if (columnKey === 'joinInTime' && order === 'descend') { orderEnum = 'JOIN_OUT_DESC';;}
if (columnKey === 'joinOutTime' && order === 'descend') { orderEnum = 'JOIN_OUT_ASC';;}
if (columnKey === 'joinInTime' && order === 'ascend') {
orderEnum = 'JOIN_IN_ASC';
} else if (columnKey === 'joinOutTime' && order === 'ascend') {
orderEnum = 'JOIN_OUT_ASC';
} else if (columnKey === 'joinInTime' && order === 'descend') {
orderEnum = 'JOIN_IN_DESC';
} else if (columnKey === 'joinOutTime' && order === 'descend') {
orderEnum = 'JOIN_OUT_DESC';
}
const _query = {
...query,
orderEnum,
};
this.setState({ query: _query }, () => {
this.getDateDetail(query.current);
this.getDateDetail(_query.current);
})
}
......@@ -337,7 +341,7 @@ export default class OfflineCourseData extends React.Component {
loading={loading}
dataSource={data}
onChange={this.handleChangeTable}
rowKey={(row) => row.liveCourseId}
rowKey={(row) => row.userId}
/>
<PageControl
current={query.current - 1}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment