Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
ed80ed39
Commit
ed80ed39
authored
Aug 25, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. fixed analysis
2. updated radar
parent
de0e1421
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
112 additions
and
59 deletions
+112
-59
Radar.vue
src/components/chart/Radar.vue
+12
-36
TransferBar.vue
src/components/chart/TransferBar.vue
+60
-0
index.js
src/router/index.js
+10
-5
Analysis.vue
src/views/dashboard/Analysis.vue
+1
-1
Workplace.vue
src/views/dashboard/Workplace.vue
+29
-17
No files found.
src/components/chart/Radar.vue
View file @
ed80ed39
...
...
@@ -11,40 +11,6 @@
</
template
>
<
script
>
const
DataSet
=
require
(
'@antv/data-set'
)
const
sourceData
=
[
{
item
:
'引用'
,
a
:
70
,
b
:
30
,
c
:
40
},
{
item
:
'口碑'
,
a
:
60
,
b
:
70
,
c
:
40
},
{
item
:
'产量'
,
a
:
50
,
b
:
60
,
c
:
40
},
{
item
:
'贡献'
,
a
:
40
,
b
:
50
,
c
:
40
},
{
item
:
'热度'
,
a
:
60
,
b
:
70
,
c
:
40
},
{
item
:
'引用'
,
a
:
70
,
b
:
50
,
c
:
40
}
]
const
dv
=
new
DataSet
.
View
().
source
(
sourceData
)
dv
.
transform
({
type
:
'fold'
,
fields
:
[
'a'
,
'b'
,
'c'
],
key
:
'user'
,
value
:
'score'
})
const
scale
=
[
{
dataKey
:
'score'
,
min
:
0
,
max
:
80
},
/* {
dataKey: 'user',
type: 'cat',
values: ['个人', '团队', '部门'],
alias: '类型'
}*/
]
const
data
=
dv
.
rows
const
axis1Opts
=
{
dataKey
:
'item'
,
line
:
null
,
...
...
@@ -68,12 +34,22 @@
}
}
const
scale
=
[
{
dataKey
:
'score'
,
min
:
0
,
max
:
80
},
{
dataKey
:
'user'
,
alias
:
'类型'
}
]
export
default
{
name
:
'Radar'
,
props
:
[
'data'
],
data
()
{
return
{
sourceData
,
data
,
axis1Opts
,
axis2Opts
,
scale
...
...
src/components/chart/TransferBar.vue
0 → 100644
View file @
ed80ed39
<
template
>
<div
:style=
"
{ padding: '0 0 32px 32px' }">
<h4
:style=
"
{ marginBottom: '20px' }">
{{
title
}}
</h4>
<v-chart
height=
"254"
:data=
"data"
:scale=
"scale"
:forceFit=
"true"
:padding=
"['auto', 'auto', '40', '50']"
>
<v-tooltip
/>
<v-axis
/>
<v-bar
position=
"x*y"
/>
</v-chart>
</div>
</
template
>
<
script
>
const
tooltip
=
[
'x*y'
,
(
x
,
y
)
=>
({
name
:
x
,
value
:
y
})
]
const
scale
=
[{
dataKey
:
'x'
,
title
:
'日期(天)'
,
alias
:
'日期(天)'
,
min
:
2
},
{
dataKey
:
'y'
,
title
:
'流量(Gb)'
,
alias
:
'流量(Gb)'
,
min
:
1
}]
export
default
{
name
:
"Bar"
,
props
:
[
'title'
],
data
()
{
return
{
data
:
[],
scale
,
tooltip
}
},
created
()
{
this
.
getMonthBar
()
},
methods
:
{
getMonthBar
()
{
this
.
$http
.
get
(
'/analysis/month-bar'
)
.
then
(
res
=>
{
this
.
data
=
res
.
result
})
}
}
}
</
script
>
\ No newline at end of file
src/router/index.js
View file @
ed80ed39
...
...
@@ -28,15 +28,14 @@ export const constantRouterMap = [
},
{
path
:
'/404'
,
component
:
()
=>
import
(
'../views
/404'
)
component
:
()
=>
import
(
/* webpackChunkName: "fail" */
'../views/exception
/404'
)
},
{
path
:
'/'
,
component
:
Layout
,
redirect
:
'/login'
,
name
:
'首页'
,
hidden
:
true
,
children
:
[]
hidden
:
true
}
]
...
...
@@ -235,9 +234,14 @@ export const asyncRouterMap = [
]
},
{
path
:
'/
my
'
,
path
:
'/
settings
'
,
component
:
()
=>
import
(
'../views/user/Index'
),
name
:
'my'
,
name
:
'settings'
,
hidden
:
true
,
meta
:
{
title
:
'用户设置'
,
icon
:
'profile'
}
},
{
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
}
]
\ No newline at end of file
src/views/dashboard/Analysis.vue
View file @
ed80ed39
...
...
@@ -89,7 +89,7 @@
<a-tab-pane
loading=
"true"
tab=
"销售额"
key=
"1"
>
<a-row>
<a-col
:xl=
"16"
:lg=
"12"
:md=
"12"
:sm=
"24"
:xs=
"24"
>
<bar
title=
"销售额
趋势
"
/>
<bar
title=
"销售额
排行
"
/>
</a-col>
<a-col
:xl=
"8"
:lg=
"12"
:md=
"12"
:sm=
"24"
:xs=
"24"
>
<rank-list
title=
"门店销售排行榜"
:list=
"rankList"
/>
...
...
src/views/dashboard/Workplace.vue
View file @
ed80ed39
...
...
@@ -27,11 +27,14 @@
<div>
<a-card-grid
:key=
"i"
v-for=
"(item, i) in projects"
>
<a-card
:bordered=
"false"
:body-style=
"
{ padding: 0 }">
<a-card-meta
:description=
"item.description"
>
<a-card-meta>
<div
slot=
"title"
class=
"card-title"
>
<a-avatar
size=
"small"
:src=
"item.cover"
/>
<a>
{{
item
.
title
}}
</a>
</div>
<div
slot=
"description"
class=
"card-description"
>
{{
item
.
description
}}
</div>
</a-card-meta>
<div
class=
"project-item"
>
<a
href=
"/#/"
>
科学搬砖组
</a>
...
...
@@ -71,9 +74,10 @@
<a-button
size=
"small"
type=
"primary"
ghost
icon=
"plus"
>
添加
</a-button>
</div>
</a-card>
<a-card
title=
"XX 指数"
style=
"margin-bottom: 24px"
:loading=
"
l
oading"
:bordered=
"false"
:body-style=
"
{ padding: 0 }">
<a-card
title=
"XX 指数"
style=
"margin-bottom: 24px"
:loading=
"
radarL
oading"
:bordered=
"false"
:body-style=
"
{ padding: 0 }">
<div
style=
"min-height: 400px;"
>
<radar
:data=
"axisData"
:scale=
"scale"
:axis1Opts=
"axis1Opts"
:axis2Opts=
"axis2Opts"
/>
<!-- :scale="scale" :axis1Opts="axis1Opts" :axis2Opts="axis2Opts" -->
<radar
:data=
"radarData"
/>
</div>
</a-card>
<a-card
:loading=
"loading"
title=
"团队"
:bordered=
"false"
>
...
...
@@ -200,16 +204,22 @@
})
},
initRadar
()
{
const
dv
=
new
DataSet
.
View
().
source
(
this
.
axisData
)
this
.
radarLoading
=
true
this
.
$http
.
get
(
'/workplace/radar'
)
.
then
(
res
=>
{
dv
.
transform
({
type
:
'flod'
,
fields
:
[
'a'
,
'b'
,
'c'
],
key
:
'user'
,
value
:
'score'
})
const
dv
=
new
DataSet
.
View
().
source
(
res
.
result
)
dv
.
transform
({
type
:
'fold'
,
fields
:
[
'个人'
,
'团队'
,
'部门'
],
key
:
'user'
,
value
:
'score'
})
this
.
radarData
=
dv
.
rows
this
.
radarData
=
dv
.
rows
this
.
radarLoading
=
false
})
}
}
}
...
...
@@ -217,6 +227,7 @@
<
style
lang=
"scss"
scoped
>
.project-list
{
.card-title
{
font-size
:
0
;
...
...
@@ -234,6 +245,12 @@
}
}
}
.card-description
{
color
:
rgba
(
0
,
0
,
0
,
0.45
);
height
:
44px
;
line-height
:
22px
;
overflow
:
hidden
;
}
.project-item
{
display
:
flex
;
margin-top
:
8px
;
...
...
@@ -256,12 +273,7 @@
float
:
right
;
}
}
.ant-card-meta-description
{
color
:
rgba
(
0
,
0
,
0
,
0.45
);
height
:
44px
;
line-height
:
22px
;
overflow
:
hidden
;
}
}
.item-group
{
...
...
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