增加排序参数

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

@ -442,6 +442,16 @@ class Asset extends Component {
});
}
handleTableChange = (pagination, filters, sorter) => {
let query = {
...this.state.queryParams,
'order': sorter.order,
'field': sorter.field
}
this.loadTableData(query);
}
render() {
const columns = [{
@ -465,7 +475,8 @@ class Asset extends Component {
{short}
</Tooltip>
);
}
},
sorter: true,
}, {
title: '连接协议',
dataIndex: 'protocol',
@ -529,7 +540,8 @@ class Asset extends Component {
{dayjs(text).fromNow()}
</Tooltip>
)
}
},
sorter: true,
},
{
title: '操作',
@ -767,6 +779,7 @@ class Asset extends Component {
showTotal: total => `总计 ${total}`
}}
loading={this.state.loading}
onChange={this.handleTableChange}
/>
{