|
|
@@ -47,6 +47,9 @@ class ChartList extends React.Component {
|
|
|
this.setBodyWidth();
|
|
|
dispatch({ type: 'chart/fetchList' })
|
|
|
dispatch({ type: 'chart/remoteGroupList' });
|
|
|
+ this.setState({
|
|
|
+ page: chart.page || 1
|
|
|
+ });
|
|
|
this.bodyRef.current.parentNode.scrollTo(0, chart.listScrollTop)
|
|
|
window.addEventListener('resize', this.setBodyWidth);
|
|
|
}
|
|
|
@@ -54,7 +57,10 @@ class ChartList extends React.Component {
|
|
|
componentWillUnmount() {
|
|
|
const { dispatch } = this.props;
|
|
|
window.removeEventListener('resize', this.setBodyWidth);
|
|
|
- dispatch({ type: 'chart/setField', name: 'listScrollTop', value: this.bodyRef.current.parentNode.scrollTop });
|
|
|
+ dispatch({ type: 'chart/setFields', fields: [
|
|
|
+ { name: 'listScrollTop', value: this.bodyRef.current.parentNode.scrollTop },
|
|
|
+ { name: 'page', value: this.state.page },
|
|
|
+ ] });
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -397,6 +403,8 @@ class ChartList extends React.Component {
|
|
|
onPageChange = (pageNumber) => {
|
|
|
this.setState({
|
|
|
page: pageNumber
|
|
|
+ }, () => {
|
|
|
+ this.bodyRef.current.parentNode.scrollTo(0, 0)
|
|
|
})
|
|
|
}
|
|
|
|