提交 99eed3ea authored 作者: 钟是志's avatar 钟是志

Merge remote-tracking branch 'origin/master'

......@@ -75,7 +75,10 @@ class ListWithAddEditTemplate extends React.Component {
if (!headerList) return;
this.setState({ headerList });
this.columns = headerList.filter(i => !i.isHidden).slice(0, 10).map(item => ({
this.columns = headerList
.filter(i => !i.isHidden)
.slice(0, 10)
.map(item => ({
title: item.title,
dataIndex: item.name,
render: date.includes(item.type) && dateRender,
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论