diff --git a/.gitignore b/.gitignore index 4d66d8654dd44b693f7d0f93503557b4202f5fca..363794d7685b59dbde7ef07d215263694b34c85e 100755 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ functions/mock .umi .umi-production +# screenshot +screenshot \ No newline at end of file diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index fa4dd1bf3e02b7e3ddd4019f83f2ee6e4a62939a..c113d3408e3bfb6b9f1c8d33f7c20741f52fd8f5 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -61,6 +61,7 @@ class Analysis extends Component { this.state = { salesType: 'all', currentTabKey: '', + loading: true, rangePickerValue: getTimeDistance('year'), }; } @@ -77,6 +78,11 @@ class Analysis extends Component { dispatch({ type: 'chart/fetch', }); + setTimeout(() => { + this.setState({ + loading: false, + }); + }, 1000); }); } @@ -137,8 +143,8 @@ class Analysis extends Component { } render() { - const { rangePickerValue, salesType, currentTabKey } = this.state; - const { chart, loading } = this.props; + const { rangePickerValue, salesType, loading: propsLoding, currentTabKey } = this.state; + const { chart, loading: stateLoading } = this.props; const { visitData, visitData2, @@ -150,7 +156,7 @@ class Analysis extends Component { salesTypeDataOnline, salesTypeDataOffline, } = chart; - + const loading = propsLoding || stateLoading; const salesPieData = salesType === 'all' ? salesTypeData diff --git a/src/pages/layouts/LoadingPage.js b/src/pages/layouts/LoadingPage.js index e104ff2c3c115f440eb5851b142e7dd743580cbd..4a96dfc1aeec4905abe5480927f7e345e4c30acc 100644 --- a/src/pages/layouts/LoadingPage.js +++ b/src/pages/layouts/LoadingPage.js @@ -31,9 +31,7 @@ function formatter(data, parentPath = '', parentAuthority, parentName) { return result; }); } -/** - * 根据菜单取得重定向地址. - */ +// get meun map data const MenuData = formatter(routerConfig[1].routes); class LoadingPage extends PureComponent {