1,效果图如下
2,代码如下
@Form.create()
class StudentsList extends PureComponent {
state = {
eAdd:"",
eEdit:"",
eDestroy:"",
filteredInfo: null,
sortedInfo: null,
pageQuery:'',
};
// 排序开始
handleChange = (pagination, filters, sorter,) => {
console.log('Various parameters', sorter);
const { dispatch, form } = this.props;
const query = this.props.query;
const pageQuery=this.state.pageQuery;
const sortVlaue=sorter.field;
form.validateFields((err) => {
if (!err) {
if(sorter.order=="ascend"){
dispatch({ type: 'students/fetch', payload: { sort: sortVlaue , order: "ASC" ,query,name:pageQuery} });
this.setState({