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

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

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