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
a8ef08b6
Commit
a8ef08b6
authored
Jun 29, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #1750 Excessive loading in the workplace
parent
eaf60da7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
20 deletions
+22
-20
src/components/PageHeader/index.js
src/components/PageHeader/index.js
+3
-3
src/models/setting.js
src/models/setting.js
+1
-0
src/routes/Dashboard/Workplace.js
src/routes/Dashboard/Workplace.js
+18
-17
No files found.
src/components/PageHeader/index.js
View file @
a8ef08b6
import
React
,
{
PureComponent
,
createElement
}
from
'
react
'
;
import
React
,
{
PureComponent
,
createElement
}
from
'
react
'
;
import
pathToRegexp
from
'
path-to-regexp
'
;
import
pathToRegexp
from
'
path-to-regexp
'
;
import
{
Breadcrumb
,
Tabs
}
from
'
antd
'
;
import
{
Breadcrumb
,
Tabs
,
Card
}
from
'
antd
'
;
import
classNames
from
'
classnames
'
;
import
classNames
from
'
classnames
'
;
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
import
{
urlToList
}
from
'
../_utils/pathTools
'
;
import
{
urlToList
}
from
'
../_utils/pathTools
'
;
...
@@ -190,7 +190,7 @@ export default class PageHeader extends PureComponent {
...
@@ -190,7 +190,7 @@ export default class PageHeader extends PureComponent {
}
}
const
{
breadcrumb
}
=
this
.
state
;
const
{
breadcrumb
}
=
this
.
state
;
return
(
return
(
<
div
className
=
{
clsString
}
>
<
Card
className
=
{
clsString
}
bodyStyle
=
{{
padding
:
0
}
}
>
{
breadcrumb
}
{
breadcrumb
}
<
div
className
=
{
styles
.
detail
}
>
<
div
className
=
{
styles
.
detail
}
>
{
logo
&&
<
div
className
=
{
styles
.
logo
}
>
{
logo
}
<
/div>
}
{
logo
&&
<
div
className
=
{
styles
.
logo
}
>
{
logo
}
<
/div>
}
...
@@ -216,7 +216,7 @@ export default class PageHeader extends PureComponent {
...
@@ -216,7 +216,7 @@ export default class PageHeader extends PureComponent {
{
tabList
.
map
(
item
=>
<
TabPane
tab
=
{
item
.
tab
}
key
=
{
item
.
key
}
/>
)
}
{
tabList
.
map
(
item
=>
<
TabPane
tab
=
{
item
.
tab
}
key
=
{
item
.
key
}
/>
)
}
<
/Tabs
>
<
/Tabs
>
)}
)}
<
/
div
>
<
/
Card
>
);
);
}
}
}
}
src/models/setting.js
View file @
a8ef08b6
...
@@ -9,6 +9,7 @@ const defaultSetting = {
...
@@ -9,6 +9,7 @@ const defaultSetting = {
fixSiderbar
:
false
,
fixSiderbar
:
false
,
colorWeak
:
'
close
'
,
colorWeak
:
'
close
'
,
};
};
export
default
{
export
default
{
namespace
:
'
setting
'
,
namespace
:
'
setting
'
,
state
:
defaultSetting
,
state
:
defaultSetting
,
...
...
src/routes/Dashboard/Workplace.js
View file @
a8ef08b6
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import
moment
from
'
moment
'
;
import
moment
from
'
moment
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
{
Link
}
from
'
dva/router
'
;
import
{
Link
}
from
'
dva/router
'
;
import
{
Row
,
Col
,
Card
,
List
,
Avatar
,
Spin
}
from
'
antd
'
;
import
{
Row
,
Col
,
Card
,
List
,
Avatar
}
from
'
antd
'
;
import
{
Radar
}
from
'
components/Charts
'
;
import
{
Radar
}
from
'
components/Charts
'
;
import
EditableLinkGroup
from
'
components/EditableLinkGroup
'
;
import
EditableLinkGroup
from
'
components/EditableLinkGroup
'
;
...
@@ -117,23 +117,20 @@ export default class Workplace extends PureComponent {
...
@@ -117,23 +117,20 @@ export default class Workplace extends PureComponent {
chart
:
{
radarData
},
chart
:
{
radarData
},
}
=
this
.
props
;
}
=
this
.
props
;
const
pageHeaderContent
=
(
const
pageHeaderContent
=
<
Spin
spinning
=
{
currentUserLoading
}
>
currentUser
&&
Object
.
keys
(
currentUser
).
length
?
(
{
currentUser
&&
Object
.
keys
(
currentUser
).
length
?
(
<
div
className
=
{
styles
.
pageHeaderContent
}
>
<
div
className
=
{
styles
.
pageHeaderContent
}
>
<
div
className
=
{
styles
.
avatar
}
>
<
div
className
=
{
styles
.
avatar
}
>
<
Avatar
size
=
"
large
"
src
=
{
currentUser
.
avatar
}
/
>
<
Avatar
size
=
"
large
"
src
=
{
currentUser
.
avatar
}
/
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
contentTitle
}
>
早安
,
{
currentUser
.
name
}
,
祝你开心每一天
!
<
/div
>
<
div
className
=
{
styles
.
contentTitle
}
>
早安
,
{
currentUser
.
name
}
,
祝你开心每一天
!
<
/div
>
<
div
>
<
div
>
{
currentUser
.
title
}
|
{
currentUser
.
group
}
{
currentUser
.
title
}
|
{
currentUser
.
group
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
:
null
}
<
/div
>
<
/Spin
>
)
:
null
;
);
const
extraContent
=
(
const
extraContent
=
(
<
div
className
=
{
styles
.
extraContent
}
>
<
div
className
=
{
styles
.
extraContent
}
>
...
@@ -156,7 +153,11 @@ export default class Workplace extends PureComponent {
...
@@ -156,7 +153,11 @@ export default class Workplace extends PureComponent {
);
);
return
(
return
(
<
PageHeaderLayout
content
=
{
pageHeaderContent
}
extraContent
=
{
extraContent
}
>
<
PageHeaderLayout
loading
=
{
currentUserLoading
}
content
=
{
pageHeaderContent
}
extraContent
=
{
extraContent
}
>
<
Row
gutter
=
{
24
}
>
<
Row
gutter
=
{
24
}
>
<
Col
xl
=
{
16
}
lg
=
{
24
}
md
=
{
24
}
sm
=
{
24
}
xs
=
{
24
}
>
<
Col
xl
=
{
16
}
lg
=
{
24
}
md
=
{
24
}
sm
=
{
24
}
xs
=
{
24
}
>
<
Card
<
Card
...
...
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