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
02204c3f
Commit
02204c3f
authored
Sep 06, 2017
by
nikogu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List & Dashboard Design Review
parent
f649e4b9
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
54 additions
and
23 deletions
+54
-23
src/components/Charts/MiniArea/index.js
src/components/Charts/MiniArea/index.js
+2
-1
src/components/Charts/MiniProgress/index.js
src/components/Charts/MiniProgress/index.js
+10
-7
src/components/Charts/MiniProgress/index.less
src/components/Charts/MiniProgress/index.less
+1
-0
src/components/Charts/Pie/index.js
src/components/Charts/Pie/index.js
+3
-1
src/components/TagCloud/index.js
src/components/TagCloud/index.js
+1
-1
src/layouts/PageHeaderLayout.js
src/layouts/PageHeaderLayout.js
+2
-1
src/routes/Dashboard/Analysis.js
src/routes/Dashboard/Analysis.js
+5
-1
src/routes/Dashboard/Analysis.less
src/routes/Dashboard/Analysis.less
+5
-0
src/routes/Dashboard/Monitor.js
src/routes/Dashboard/Monitor.js
+24
-10
src/routes/Dashboard/Workplace.js
src/routes/Dashboard/Workplace.js
+1
-1
No files found.
src/components/Charts/MiniArea/index.js
View file @
02204c3f
...
@@ -18,7 +18,7 @@ class MiniArea extends PureComponent {
...
@@ -18,7 +18,7 @@ class MiniArea extends PureComponent {
}
}
renderChart
(
data
)
{
renderChart
(
data
)
{
const
{
height
=
0
,
fit
=
true
,
color
=
'
#33abfb
'
,
line
,
xAxis
,
yAxis
}
=
this
.
props
;
const
{
height
=
0
,
fit
=
true
,
color
=
'
#33abfb
'
,
line
,
xAxis
,
yAxis
,
animate
=
true
}
=
this
.
props
;
if
(
!
data
||
(
data
&&
data
.
length
<
1
))
{
if
(
!
data
||
(
data
&&
data
.
length
<
1
))
{
return
;
return
;
...
@@ -31,6 +31,7 @@ class MiniArea extends PureComponent {
...
@@ -31,6 +31,7 @@ class MiniArea extends PureComponent {
container
:
this
.
node
,
container
:
this
.
node
,
forceFit
:
fit
,
forceFit
:
fit
,
height
:
height
+
54
,
height
:
height
+
54
,
animate
,
plotCfg
:
{
plotCfg
:
{
margin
:
[
36
,
0
,
30
,
0
],
margin
:
[
36
,
0
,
30
,
0
],
},
},
...
...
src/components/Charts/MiniProgress/index.js
View file @
02204c3f
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Popover
}
from
'
antd
'
;
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
const
MiniProgress
=
({
target
,
color
,
strokeWidth
,
percent
})
=>
(
const
MiniProgress
=
({
target
,
color
,
strokeWidth
,
percent
})
=>
(
<
div
className
=
{
styles
.
miniProgress
}
>
<
div
className
=
{
styles
.
miniProgress
}
>
<
Popover
title
=
{
null
}
content
=
{
`目标值:
${
target
}
%`
}
>
<
div
<
div
className
=
{
styles
.
target
}
className
=
{
styles
.
target
}
style
=
{{
left
:
(
target
?
`
${
target
}
%`
:
null
)
}}
style
=
{{
left
:
(
target
?
`
${
target
}
%`
:
null
)
}}
...
@@ -11,6 +13,7 @@ const MiniProgress = ({ target, color, strokeWidth, percent }) => (
...
@@ -11,6 +13,7 @@ const MiniProgress = ({ target, color, strokeWidth, percent }) => (
<
span
style
=
{{
backgroundColor
:
(
color
||
null
)
}}
/
>
<
span
style
=
{{
backgroundColor
:
(
color
||
null
)
}}
/
>
<
span
style
=
{{
backgroundColor
:
(
color
||
null
)
}}
/
>
<
span
style
=
{{
backgroundColor
:
(
color
||
null
)
}}
/
>
<
/div
>
<
/div
>
<
/Popover
>
<
div
className
=
{
styles
.
progressWrap
}
>
<
div
className
=
{
styles
.
progressWrap
}
>
<
div
<
div
className
=
{
styles
.
progress
}
className
=
{
styles
.
progress
}
...
...
src/components/Charts/MiniProgress/index.less
View file @
02204c3f
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
height: 100%;
height: 100%;
}
}
.target {
.target {
cursor: pointer;
position: absolute;
position: absolute;
top: 0;
top: 0;
bottom: 0;
bottom: 0;
...
...
src/components/Charts/Pie/index.js
View file @
02204c3f
...
@@ -14,8 +14,10 @@ class Pie extends Component {
...
@@ -14,8 +14,10 @@ class Pie extends Component {
}
}
componentWillReceiveProps
(
nextProps
)
{
componentWillReceiveProps
(
nextProps
)
{
if
(
this
.
props
.
data
!==
nextProps
.
data
)
{
this
.
renderChart
(
nextProps
.
data
);
this
.
renderChart
(
nextProps
.
data
);
}
}
}
handleRef
=
(
n
)
=>
{
handleRef
=
(
n
)
=>
{
this
.
node
=
n
;
this
.
node
=
n
;
...
...
src/components/TagCloud/index.js
View file @
02204c3f
...
@@ -79,7 +79,7 @@ class TagCloud extends PureComponent {
...
@@ -79,7 +79,7 @@ class TagCloud extends PureComponent {
height
,
height
,
// 设定文字大小配置函数(默认为12-40px的随机大小)
// 设定文字大小配置函数(默认为12-40px的随机大小)
size
:
words
=>
(((
words
.
value
-
min
)
/
(
max
-
min
))
*
1
0
)
+
12
,
size
:
words
=>
(((
words
.
value
-
min
)
/
(
max
-
min
))
*
1
2
)
+
6
,
// 设定文字内容
// 设定文字内容
text
:
words
=>
words
.
name
,
text
:
words
=>
words
.
name
,
...
...
src/layouts/PageHeaderLayout.js
View file @
02204c3f
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
PageHeader
from
'
../components/PageHeader
'
;
import
PageHeader
from
'
../components/PageHeader
'
;
export
default
({
children
,
wrapperClassName
,
...
restProps
})
=>
(
export
default
({
children
,
wrapperClassName
,
top
,
...
restProps
})
=>
(
<
div
style
=
{{
margin
:
'
-24px -24px 0
'
}}
className
=
{
wrapperClassName
}
>
<
div
style
=
{{
margin
:
'
-24px -24px 0
'
}}
className
=
{
wrapperClassName
}
>
{
top
}
<
PageHeader
{...
restProps
}
/
>
<
PageHeader
{...
restProps
}
/
>
{
children
?
<
div
style
=
{{
margin
:
'
24px 24px 0
'
}}
>
{
children
}
<
/div> : null
}
{
children
?
<
div
style
=
{{
margin
:
'
24px 24px 0
'
}}
>
{
children
}
<
/div> : null
}
<
/div
>
<
/div
>
...
...
src/routes/Dashboard/Analysis.js
View file @
02204c3f
...
@@ -60,6 +60,10 @@ export default class Analysis extends Component {
...
@@ -60,6 +60,10 @@ export default class Analysis extends Component {
this
.
setState
({
this
.
setState
({
rangePickerValue
,
rangePickerValue
,
});
});
this
.
props
.
dispatch
({
type
:
'
chart/fetchSalesData
'
,
});
}
}
selectDate
=
(
type
)
=>
{
selectDate
=
(
type
)
=>
{
...
...
src/routes/Dashboard/Analysis.less
View file @
02204c3f
...
@@ -3,8 +3,13 @@
...
@@ -3,8 +3,13 @@
.iconGroup {
.iconGroup {
i {
i {
transition: color 0.32s;
color: @text-color-secondary;
cursor: pointer;
cursor: pointer;
margin-left: 16px;
margin-left: 16px;
&:hover {
color: @text-color;
}
}
}
}
}
.rankingList {
.rankingList {
...
...
src/routes/Dashboard/Monitor.js
View file @
02204c3f
...
@@ -11,12 +11,15 @@ import { fixedZero } from '../../utils/utils';
...
@@ -11,12 +11,15 @@ import { fixedZero } from '../../utils/utils';
import
styles
from
'
./Monitor.less
'
;
import
styles
from
'
./Monitor.less
'
;
const
activeData
=
[];
function
getActiveData
()
{
for
(
let
i
=
0
;
i
<
24
;
i
+=
1
)
{
const
activeData
=
[];
for
(
let
i
=
0
;
i
<
24
;
i
+=
1
)
{
activeData
.
push
({
activeData
.
push
({
x
:
`
${
fixedZero
(
i
)}
:00`
,
x
:
`
${
fixedZero
(
i
)}
:00`
,
y
:
(
i
*
50
)
+
(
Math
.
floor
(
Math
.
random
()
*
200
)),
y
:
(
i
*
50
)
+
(
Math
.
floor
(
Math
.
random
()
*
200
)),
});
});
}
return
activeData
;
}
}
const
MapData
=
[];
const
MapData
=
[];
...
@@ -33,13 +36,23 @@ const targetTime = new Date().getTime() + 3900000;
...
@@ -33,13 +36,23 @@ const targetTime = new Date().getTime() + 3900000;
monitor
:
state
.
monitor
,
monitor
:
state
.
monitor
,
}))
}))
export
default
class
Monitor
extends
PureComponent
{
export
default
class
Monitor
extends
PureComponent
{
state
=
{
activeData
:
getActiveData
(),
}
componentDidMount
()
{
componentDidMount
()
{
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
type
:
'
monitor/fetchTags
'
,
type
:
'
monitor/fetchTags
'
,
});
});
}
setInterval
(()
=>
{
this
.
setState
({
activeData
:
getActiveData
(),
});
},
1000
);
}
render
()
{
render
()
{
const
{
activeData
=
[]
}
=
this
.
state
;
const
{
monitor
}
=
this
.
props
;
const
{
monitor
}
=
this
.
props
;
const
{
tags
}
=
monitor
;
const
{
tags
}
=
monitor
;
...
@@ -90,6 +103,7 @@ export default class Monitor extends PureComponent {
...
@@ -90,6 +103,7 @@ export default class Monitor extends PureComponent {
/>
/>
<
div
style
=
{{
marginTop
:
32
}}
>
<
div
style
=
{{
marginTop
:
32
}}
>
<
MiniArea
<
MiniArea
animate
=
{
false
}
line
line
color
=
"
#5DD1DD
"
color
=
"
#5DD1DD
"
height
=
{
84
}
height
=
{
84
}
...
@@ -129,7 +143,7 @@ export default class Monitor extends PureComponent {
...
@@ -129,7 +143,7 @@ export default class Monitor extends PureComponent {
bordered
=
{
false
}
bordered
=
{
false
}
>
>
<
Gauge
<
Gauge
title
=
"
跳出
率
"
title
=
"
核销
率
"
height
=
{
164
}
height
=
{
164
}
percent
=
{
87
}
percent
=
{
87
}
/
>
/
>
...
@@ -143,7 +157,7 @@ export default class Monitor extends PureComponent {
...
@@ -143,7 +157,7 @@ export default class Monitor extends PureComponent {
style
=
{{
marginBottom
:
24
}}
style
=
{{
marginBottom
:
24
}}
bordered
=
{
false
}
bordered
=
{
false
}
>
>
<
Row
style
=
{{
padding
:
'
18px 0 19px 0
'
}}
>
<
Row
gutter
=
{
4
}
style
=
{{
padding
:
'
18px 0 19px 0
'
}}
>
<
Col
span
=
{
8
}
>
<
Col
span
=
{
8
}
>
<
Pie
<
Pie
percent
=
{
28
}
percent
=
{
28
}
...
@@ -174,7 +188,7 @@ export default class Monitor extends PureComponent {
...
@@ -174,7 +188,7 @@ export default class Monitor extends PureComponent {
<
/Card
>
<
/Card
>
<
/Col
>
<
/Col
>
<
Col
sm
=
{
8
}
xs
=
{
24
}
style
=
{{
marginBottom
:
24
}}
>
<
Col
sm
=
{
8
}
xs
=
{
24
}
style
=
{{
marginBottom
:
24
}}
>
<
Card
title
=
"
热门搜索
"
bordered
=
{
false
}
>
<
Card
title
=
"
热门搜索
"
bordered
=
{
false
}
bodyStyle
=
{{
height
:
214
}}
>
<
TagCloud
<
TagCloud
data
=
{
tags
}
data
=
{
tags
}
height
=
{
161
}
height
=
{
161
}
...
...
src/routes/Dashboard/Workplace.js
View file @
02204c3f
...
@@ -144,9 +144,9 @@ export default class Workplace extends PureComponent {
...
@@ -144,9 +144,9 @@ export default class Workplace extends PureComponent {
return
(
return
(
<
PageHeaderLayout
<
PageHeaderLayout
top
=
{
pageHeaderContent
}
action
=
{
pageHeaderAction
}
action
=
{
pageHeaderAction
}
title
=
{
pageHeaderTitle
}
title
=
{
pageHeaderTitle
}
content
=
{
pageHeaderContent
}
>
>
<
Row
gutter
=
{
24
}
>
<
Row
gutter
=
{
24
}
>
<
Col
lg
=
{
16
}
md
=
{
24
}
sm
=
{
24
}
xs
=
{
24
}
>
<
Col
lg
=
{
16
}
md
=
{
24
}
sm
=
{
24
}
xs
=
{
24
}
>
...
...
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