Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
ad38d93f
Commit
ad38d93f
authored
Jul 22, 2018
by
้ๅธ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimization: use state to control rendering time
parent
f3b77d43
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
.gitignore
.gitignore
+2
-0
src/pages/Dashboard/Analysis.js
src/pages/Dashboard/Analysis.js
+9
-3
src/pages/layouts/LoadingPage.js
src/pages/layouts/LoadingPage.js
+1
-3
No files found.
.gitignore
View file @
ad38d93f
...
...
@@ -34,3 +34,5 @@ functions/mock
.umi
.umi-production
# screenshot
screenshot
\ No newline at end of file
src/pages/Dashboard/Analysis.js
View file @
ad38d93f
...
...
@@ -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
...
...
src/pages/layouts/LoadingPage.js
View file @
ad38d93f
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment