Commit 23dac15b authored by 李晓静's avatar 李晓静

优化url后参数

parent b5260b7a
...@@ -276,7 +276,11 @@ export default class DataView extends React.Component { ...@@ -276,7 +276,11 @@ export default class DataView extends React.Component {
onChange: (nextPage) => { onChange: (nextPage) => {
this.fetchPage(nextPage); this.fetchPage(nextPage);
this.fetch(); this.fetch();
window.history.replaceState({ pageNum: nextPage }, '', `?pageNum=${nextPage}`); window.history.replaceState(
{ pageNum: nextPage },
'',
`${window.location.search && window.location.search.indexOf('?pageNum') < 0 ? `${window.location.search}&` : '?'}pageNum=${nextPage}`,
);
}, },
onShowSizeChange: this.fetchPageSize, onShowSizeChange: this.fetchPageSize,
showQuickJumper: true, showQuickJumper: true,
...@@ -423,7 +427,7 @@ export default class DataView extends React.Component { ...@@ -423,7 +427,7 @@ export default class DataView extends React.Component {
message.success('操作成功'); message.success('操作成功');
} }
fetch() { fetch = () => {
const { beforeFetch, fetch, afterFetch } = this.props; const { beforeFetch, fetch, afterFetch } = this.props;
let onBeforeFetch = beforeFetch; let onBeforeFetch = beforeFetch;
if (typeof onBeforeFetch !== 'function') { if (typeof onBeforeFetch !== 'function') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment