Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
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
f8028599
Commit
f8028599
authored
7 years ago
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lots of improvement
parent
224e5667
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
81 additions
and
205 deletions
+81
-205
package.json
package.json
+1
-2
src/components/Charts/Icon/index.js
src/components/Charts/Icon/index.js
+12
-12
src/components/Charts/Icon/index.less
src/components/Charts/Icon/index.less
+15
-0
src/components/Charts/NumberInfo/index.js
src/components/Charts/NumberInfo/index.js
+1
-1
src/components/Charts/NumberInfo/index.less
src/components/Charts/NumberInfo/index.less
+7
-3
src/components/Charts/Pie/index.less
src/components/Charts/Pie/index.less
+1
-1
src/components/Charts/Trend/index.js
src/components/Charts/Trend/index.js
+4
-62
src/components/Charts/Trend/index.less
src/components/Charts/Trend/index.less
+3
-106
src/components/Result/demo/error.md
src/components/Result/demo/error.md
+2
-2
src/index.less
src/index.less
+0
-6
src/routes/Dashboard/Analysis.js
src/routes/Dashboard/Analysis.js
+23
-7
src/routes/Dashboard/Analysis.less
src/routes/Dashboard/Analysis.less
+9
-0
src/routes/Dashboard/Monitor.js
src/routes/Dashboard/Monitor.js
+1
-1
src/routes/Result/Error.js
src/routes/Result/Error.js
+2
-2
No files found.
package.json
View file @
f8028599
...
...
@@ -91,7 +91,6 @@
},
"lint-staged"
:
{
"**/*.{js,jsx}"
:
"lint-staged:js"
,
"**/*.less"
:
"stylelint --syntax less"
,
"src/**/demo/*.md"
:
"lint-staged:demo"
"**/*.less"
:
"stylelint --syntax less"
}
}
This diff is collapsed.
Click to expand it.
src/components/Charts/Icon/index.js
View file @
f8028599
import
React
from
'
react
'
;
import
{
Icon
}
from
'
antd
'
;
import
classNames
from
'
classnames
'
;
import
styles
from
'
./index.less
'
;
const
IconUp
=
({
color
})
=>
(
const
IconUp
=
({
color
,
className
,
...
rest
})
=>
(
<
Icon
style
=
{{
color
:
(
color
===
false
)
?
'
rgba(0,0,0,0.43)
'
:
'
#00a854
'
,
fontSize
:
12
,
transform
:
'
scale(0.83)
'
,
}}
{...
rest
}
className
=
{
classNames
(
styles
.
normal
,
className
,
{
[
styles
.
up
]:
color
!==
false
,
})}
type
=
"
caret-up
"
/>
);
const
IconDown
=
({
color
})
=>
(
const
IconDown
=
({
color
,
className
,
...
rest
})
=>
(
<
Icon
style
=
{{
color
:
(
color
===
false
)
?
'
rgba(0,0,0,0.43)
'
:
'
#f04134
'
,
fontSize
:
12
,
transform
:
'
scale(0.83)
'
,
}}
{...
rest
}
className
=
{
classNames
(
styles
.
normal
,
className
,
{
[
styles
.
down
]:
color
!==
false
,
})}
type
=
"
caret-down
"
/>
);
...
...
This diff is collapsed.
Click to expand it.
src/components/Charts/Icon/index.less
0 → 100644
View file @
f8028599
@import "~antd/lib/style/themes/default.less";
.normal {
color: @text-color-secondary;
font-size: 12px;
transform: scale(83%);
}
.up {
color: @green-6;
}
.down {
color: @red-6;
}
This diff is collapsed.
Click to expand it.
src/components/Charts/NumberInfo/index.js
View file @
f8028599
...
...
@@ -22,8 +22,8 @@ export default ({ theme, title, subTitle, total, subTotal, status, suffix, ...re
{
(
status
||
subTotal
)
&&
(
<
span
className
=
{
styles
.
subTotal
}
>
{
status
&&
<
Icon
type
=
{
`caret-
${
status
}
`
}
/>
}
{
subTotal
}
{
status
&&
<
Icon
type
=
{
`caret-
${
status
}
`
}
/>
}
<
/span
>
)
}
...
...
This diff is collapsed.
Click to expand it.
src/components/Charts/NumberInfo/index.less
View file @
f8028599
...
...
@@ -9,12 +9,15 @@
margin-left: 4px;
}
h4 {
color: @heading-color;
color: @text-color;
font-size: @font-size-lg;
margin-bottom: 16px;
transition: all .3s;
}
h6 {
color: @text-color-secondary;
font-size: @font-size-base;
font-weight: normal;
height: 22px;
line-height: 22px;
.textOverflow();
...
...
@@ -33,12 +36,13 @@
}
.subTotal {
color: @text-color-secondary;
font-size: @font-size-
base
;
font-size: @font-size-
lg
;
vertical-align: top;
margin-right: 0;
i {
font-size: 12px;
transform: scale(0.82);
margin-
righ
t: 4px;
margin-
lef
t: 4px;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/components/Charts/Pie/index.less
View file @
f8028599
...
...
@@ -45,7 +45,7 @@
right: 0;
}
.title {
margin-bottom:
16
px;
margin-bottom:
8
px;
}
.total {
opacity: 0;
...
...
This diff is collapsed.
Click to expand it.
src/components/Charts/Trend/index.js
View file @
f8028599
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
import
{
Icon
,
Tooltip
}
from
'
antd
'
;
import
{
Icon
}
from
'
antd
'
;
import
styles
from
'
./index.less
'
;
const
Item
=
({
title
,
flag
,
children
,
...
rest
},
{
mini
})
=>
{
const
map
=
{
xs
:
0
,
sm
:
0
,
md
:
0
,
lg
:
0
,
xlg
:
0
,
xl
:
0
,
xxl
:
0
,
};
if
(
mini
&&
mini
.
forEach
)
{
mini
.
forEach
((
size
)
=>
{
map
[
size
]
=
1
;
});
}
const
clsObj
=
{};
Object
.
keys
(
map
).
forEach
((
k
)
=>
{
clsObj
[
styles
[
k
]]
=
map
[
k
];
});
const
clsString
=
classNames
(
styles
.
trendItem
,
{
[
styles
.
mini
]:
(
typeof
mini
===
'
boolean
'
&&
mini
),
...
clsObj
,
});
const
miniContent
=
(
<
Tooltip
title
=
{
children
}
>
<
span
className
=
{
styles
.
title
}
>
{
title
}
<
/span
>
{
flag
&&
<
span
className
=
{
styles
[
flag
]}
><
Icon
type
=
{
`caret-
${
flag
}
`
}
/></
span
>
}
<
/Tooltip
>
);
const
Item
=
({
title
,
flag
,
children
,
...
rest
})
=>
{
return
(
<
div
{...
rest
}
className
=
{
clsString
}
>
<
div
{...
rest
}
className
=
{
styles
.
trendItem
}
>
<
div
className
=
{
styles
.
content
}
>
<
span
className
=
{
styles
.
title
}
>
{
title
}
<
/span
>
<
span
className
=
{
styles
.
value
}
>
{
children
}
<
/span
>
{
flag
&&
<
span
className
=
{
styles
[
flag
]}
><
Icon
type
=
{
`caret-
${
flag
}
`
}
/></
span
>
}
<
/div
>
<
div
className
=
{
styles
.
miniContent
}
>
{
miniContent
}
<
/div
>
<
/div
>
);
};
Item
.
contextTypes
=
{
mini
:
PropTypes
.
oneOfType
([
PropTypes
.
array
,
PropTypes
.
bool
,
]),
};
class
Trend
extends
React
.
Component
{
getChildContext
()
{
return
{
mini
:
this
.
props
.
mini
,
};
}
render
()
{
const
{
colorType
,
children
,
mini
,
...
rest
}
=
this
.
props
;
const
{
colorType
,
children
,
...
rest
}
=
this
.
props
;
return
(
<
div
className
=
{
colorType
?
(
styles
[
`trend
${
colorType
}
`
]
||
styles
.
trend
)
:
styles
.
trend
}
...
...
@@ -80,13 +29,6 @@ class Trend extends React.Component {
}
}
Trend
.
childContextTypes
=
{
mini
:
PropTypes
.
oneOfType
([
PropTypes
.
array
,
PropTypes
.
bool
,
]),
};
Trend
.
Item
=
Item
;
export
default
Trend
;
This diff is collapsed.
Click to expand it.
src/components/Charts/Trend/index.less
View file @
f8028599
...
...
@@ -11,11 +11,13 @@
.trendItem {
display: inline-block;
margin-right: 24px;
color: @text-color;
font-size: @font-size-base;
line-height: 22px;
height: 22px;
& + & {
margin-left: 16px;
}
.content {
display: block;
}
...
...
@@ -54,108 +56,3 @@
color: @text-color;
}
}
.mini {
.content {
display: none;
}
.miniContent {
display: block;
}
}
.reset() {
.trendItem {
.content {
display: block;
}
.miniContent {
display: none;
}
}
}
@media screen and (max-width: @screen-xxl) {
.reset();
.xxl {
.content {
display: none;
}
.miniContent {
display: block;
}
}
}
@media screen and (max-width: @screen-xl) {
.reset();
.xl {
.content {
display: none;
}
.miniContent {
display: block;
}
}
}
@media screen and (max-width: @screen-lg) {
.reset();
.lg {
.content {
display: none;
}
.miniContent {
display: block;
}
}
}
// xlg
@media screen and (max-width: 1400px) {
.reset();
.xlg {
.content {
display: none;
}
.miniContent {
display: block;
}
}
}
@media screen and (max-width: @screen-md) {
.reset();
.md {
.content {
display: none;
}
.miniContent {
display: block;
}
}
}
@media screen and (max-width: @screen-sm) {
.reset();
.sm {
.content {
display: none;
}
.miniContent {
display: block;
}
}
}
@media screen and (max-width: @screen-xs) {
.reset();
.xs {
.content {
display: none;
}
.miniContent {
display: block;
}
}
}
This diff is collapsed.
Click to expand it.
src/components/Result/demo/error.md
View file @
f8028599
...
...
@@ -15,11 +15,11 @@ const extra = (
您提交的内容有如下错误:
</
div
>
<
div
style
=
{
{
marginBottom
:
16
}
}
>
<
Icon
style
=
{
{
color
:
'
#f
04134
'
,
marginRight
:
8
}
}
type
=
"close-circle-o"
/>
您的账户已被冻结
<
Icon
style
=
{
{
color
:
'
#f
5222d
'
,
marginRight
:
8
}
}
type
=
"close-circle-o"
/>
您的账户已被冻结
<
a
style
=
{
{
marginLeft
:
16
}
}
>
立即解冻
<
Icon
type
=
"right"
/></
a
>
</
div
>
<
div
>
<
Icon
style
=
{
{
color
:
'
#f
04134
'
,
marginRight
:
8
}
}
type
=
"close-circle-o"
/>
您的账户还不具备申请资格
<
Icon
style
=
{
{
color
:
'
#f
5222d
'
,
marginRight
:
8
}
}
type
=
"close-circle-o"
/>
您的账户还不具备申请资格
<
a
style
=
{
{
marginLeft
:
16
}
}
>
立即升级
<
Icon
type
=
"right"
/></
a
>
</
div
>
</
div
>
...
...
This diff is collapsed.
Click to expand it.
src/index.less
View file @
f8028599
...
...
@@ -9,9 +9,3 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
:global {
.ant-tabs-tab-active {
font-weight: 500;
}
}
This diff is collapsed.
Click to expand it.
src/routes/Dashboard/Analysis.js
View file @
f8028599
...
...
@@ -153,6 +153,7 @@ export default class Analysis extends Component {
dataIndex
:
'
count
'
,
key
:
'
count
'
,
sorter
:
(
a
,
b
)
=>
a
.
count
-
b
.
count
,
className
:
styles
.
alignRight
,
},
{
title
:
'
周涨幅
'
,
...
...
@@ -160,8 +161,16 @@ export default class Analysis extends Component {
key
:
'
range
'
,
sorter
:
(
a
,
b
)
=>
a
.
range
-
b
.
range
,
render
:
(
text
,
record
)
=>
(
<
span
style
=
{{
textAlign
:
'
right
'
}}
>
{
text
}
%
{
record
.
status
===
1
?
<
IconDown
/>
:
<
IconUp
/>
}
<
/span
>
<
span
>
{
text
}
%
{
record
.
status
===
1
?
<
IconDown
style
=
{{
marginLeft
:
8
}}
/
>
:
<
IconUp
style
=
{{
marginLeft
:
8
}}
/
>
}
<
/span
>
),
className
:
styles
.
alignRight
,
},
];
...
...
@@ -173,7 +182,7 @@ export default class Analysis extends Component {
<
NumberInfo
title
=
{
data
.
name
}
subTitle
=
"
转化率
"
total
=
{
`
${
data
.
cvr
*
100
}
%`
}
total
=
{
<
span
style
=
{{
top
:
'
-6px
'
,
position
:
'
relative
'
}}
>
{
data
.
cvr
*
100
}
%<
/span>
}
theme
=
{(
currentKey
!==
data
.
name
)
&&
'
light
'
}
/
>
<
/Col
>
...
...
@@ -212,7 +221,7 @@ export default class Analysis extends Component {
footer
=
{
<
Field
label
=
"
日均销售额
"
value
=
{
`¥
${
numeral
(
12423
).
format
(
'
0,0
'
)}
`
}
/>
}
contentHeight
=
{
46
}
>
<
Trend
colorType
=
"
gray
"
mini
=
{[
'
xlg
'
,
'
md
'
]}
>
<
Trend
colorType
=
"
gray
"
>
<
Trend
.
Item
title
=
"
周同比
"
flag
=
"
up
"
>
12
%<
/Trend.Item
>
<
Trend
.
Item
title
=
"
日环比
"
flag
=
"
down
"
>
11
%<
/Trend.Item
>
<
/Trend
>
...
...
@@ -256,7 +265,7 @@ export default class Analysis extends Component {
action
=
{
<
Tooltip
title
=
"
指标说明
"
><
Icon
type
=
"
info-circle-o
"
/><
/Tooltip>
}
total
=
"
78%
"
footer
=
{
<
Trend
mini
=
{[
'
xlg
'
,
'
md
'
]}
>
<
Trend
>
<
Trend
.
Item
title
=
"
周同比
"
flag
=
"
up
"
>
12.3
%<
/Trend.Item
>
<
Trend
.
Item
title
=
"
日环比
"
flag
=
"
down
"
>
11
%<
/Trend.Item
>
<
/Trend
>
...
...
@@ -347,7 +356,14 @@ export default class Analysis extends Component {
<
Row
gutter
=
{
68
}
>
<
Col
sm
=
{
12
}
xs
=
{
24
}
style
=
{{
marginBottom
:
24
}}
>
<
NumberInfo
subTitle
=
{
<
span
>
搜索用户数
<
Icon
style
=
{{
marginLeft
:
8
}}
type
=
"
info-circle-o
"
/><
/span>
}
subTitle
=
{
<
span
>
搜索用户数
<
Tooltip
title
=
"
指标文案
"
>
<
Icon
style
=
{{
marginLeft
:
8
}}
type
=
"
info-circle-o
"
/>
<
/Tooltip
>
<
/span
>
}
total
=
{
numeral
(
12321
).
format
(
'
0,0
'
)}
status
=
"
up
"
subTotal
=
{
17.1
}
...
...
@@ -374,7 +390,7 @@ export default class Analysis extends Component {
<
/Row
>
<
Table
rowKey
=
{
record
=>
record
.
index
}
size
=
"
middle
"
size
=
"
small
"
columns
=
{
columns
}
dataSource
=
{
searchData
}
pagination
=
{{
...
...
@@ -405,7 +421,7 @@ export default class Analysis extends Component {
)}
style
=
{{
marginTop
:
24
}}
>
<
div
style
=
{{
marginTop
:
32
,
marginBottom
:
100
}}
>
<
div
style
=
{{
marginTop
:
8
,
marginBottom
:
77
}}
>
<
Pie
hasLegend
title
=
"
销售额
"
...
...
This diff is collapsed.
Click to expand it.
src/routes/Dashboard/Analysis.less
View file @
f8028599
...
...
@@ -123,6 +123,15 @@
right: 6px;
}
}
:global(.ant-tabs-tab-active) h4 {
color: @primary-color;
}
}
td.alignRight,
th.alignRight {
text-align: right!important;
}
@media screen and (max-width: @screen-lg) {
...
...
This diff is collapsed.
Click to expand it.
src/routes/Dashboard/Monitor.js
View file @
f8028599
...
...
@@ -144,7 +144,7 @@ export default class Monitor extends PureComponent {
<
/Card
>
<
/Col
>
<
Col
xl
=
{
8
}
lg
=
{
12
}
sm
=
{
24
}
xs
=
{
24
}
style
=
{{
marginBottom
:
24
}}
>
<
Card
title
=
"
热门搜索
"
bordered
=
{
false
}
>
<
Card
title
=
"
热门搜索
"
bordered
=
{
false
}
bodyStyle
=
{{
overflow
:
'
hidden
'
}}
>
<
TagCloud
data
=
{
tags
}
height
=
{
161
}
...
...
This diff is collapsed.
Click to expand it.
src/routes/Result/Error.js
View file @
f8028599
...
...
@@ -9,11 +9,11 @@ const extra = (
您提交的内容有如下错误
:
<
/div
>
<
div
style
=
{{
marginBottom
:
16
}}
>
<
Icon
style
=
{{
color
:
'
#f
04134
'
,
marginRight
:
8
}}
type
=
"
close-circle-o
"
/>
您的账户已被冻结
<
Icon
style
=
{{
color
:
'
#f
5222d
'
,
marginRight
:
8
}}
type
=
"
close-circle-o
"
/>
您的账户已被冻结
<
a
style
=
{{
marginLeft
:
16
}}
>
立即解冻
<
Icon
type
=
"
right
"
/><
/a
>
<
/div
>
<
div
>
<
Icon
style
=
{{
color
:
'
#f
04134
'
,
marginRight
:
8
}}
type
=
"
close-circle-o
"
/>
您的账户还不具备申请资格
<
Icon
style
=
{{
color
:
'
#f
5222d
'
,
marginRight
:
8
}}
type
=
"
close-circle-o
"
/>
您的账户还不具备申请资格
<
a
style
=
{{
marginLeft
:
16
}}
>
立即升级
<
Icon
type
=
"
right
"
/><
/a
>
<
/div
>
<
/div
>
...
...
This diff is collapsed.
Click to expand it.
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