增加排序参数

This commit is contained in:
dushixiang
2021-03-05 17:33:13 +08:00
parent 0ef8f4276e
commit 1472ec73a7
18 changed files with 206 additions and 29 deletions

View File

@ -259,6 +259,16 @@ class UserGroup extends Component {
})
}
handleTableChange = (pagination, filters, sorter) => {
let query = {
...this.state.queryParams,
'order': sorter.order,
'field': sorter.field
}
this.loadTableData(query);
}
render() {
const columns = [{
@ -271,6 +281,7 @@ class UserGroup extends Component {
}, {
title: '名称',
dataIndex: 'name',
sorter: true,
}, {
title: '授权资产',
dataIndex: 'assetCount',
@ -293,7 +304,8 @@ class UserGroup extends Component {
{dayjs(text).fromNow()}
</Tooltip>
)
}
},
sorter: true,
},
{
title: '操作',
@ -422,6 +434,7 @@ class UserGroup extends Component {
showTotal: total => `总计 ${total}`
}}
loading={this.state.loading}
onChange={this.handleTableChange}
/>
{/* 为了屏蔽ant modal 关闭后数据仍然遗留的问题*/}