提交 5c8dfe88 authored 作者: 王绍森's avatar 王绍森

8504 创新创业管理/大学生科研实践创新课题/课题分类设置,19971001 分页失效

上级 98ff3614
......@@ -75,11 +75,14 @@ class ListWithAddEditTemplate extends React.Component {
if (!headerList) return;
this.setState({ headerList });
this.columns = headerList.filter(i => !i.isHidden).slice(0, 10).map(item => ({
title: item.title,
dataIndex: item.name,
render: date.includes(item.type) && dateRender,
}));
this.columns = headerList
.filter(i => !i.isHidden)
.slice(0, 10)
.map(item => ({
title: item.title,
dataIndex: item.name,
render: date.includes(item.type) && dateRender,
}));
const operation = {
title: '操作',
render: (_, record) => {
......@@ -161,7 +164,10 @@ class ListWithAddEditTemplate extends React.Component {
getPage = () => {
const { objId, filters = {} } = this.props;
const { formValues, pageData: pagination } = this.state;
const {
formValues,
pageData: { pagination },
} = this.state;
const query = { ...formValues, ...filters };
const pageNo = pagination.current ? pagination.current : 1;
const pageSize = pagination.pageSize ? pagination.pageSize : 10;
......@@ -184,21 +190,12 @@ class ListWithAddEditTemplate extends React.Component {
};
handleStandardTableChange = (pagination, filtersArg, sorter) => {
const filters = Object.keys(filtersArg).reduce((obj, key) => {
const newObj = { ...obj };
newObj[key] = getValue(filtersArg[key]);
return newObj;
}, {});
const params = {
pageNo: pagination.current,
pageSize: pagination.pageSize,
...filters,
};
if (sorter.field) {
params.sorter = `${sorter.field}_${sorter.order}`;
}
this.getPage(params);
this.setState(
({ pageData }) => ({
pageData: { ...pageData, pagination },
}),
this.getPage
);
};
handleAdd = () => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论