Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
data-view
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e2ca2e40
authored
Jun 30, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev_v1.0.0' of
http://192.168.3.233:8090/gh/data-view
into dev_v1.0.0
2 parents
a4a9fc41
faeb3e8d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
72 additions
and
60 deletions
src/components/LineChart.vue
src/components/PieChart.vue
src/components/RanKing.vue
src/components/lineOptions.js
src/mixins/clientMixin.js
src/mixins/salesMixin.js
src/views/afterSales/analyze.vue
src/views/afterSales/mileage.vue
src/views/salesData/enterCategory.vue
src/views/salesData/infoFrom.vue
src/components/LineChart.vue
View file @
e2ca2e4
...
...
@@ -8,7 +8,9 @@
</div>
<div
class=
"rank-block"
>
<div
class=
"rank-line"
v-for=
"(item, index) in rankList"
:key=
"index"
>
<marquee
class=
"line-item"
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.label"
></marquee>
<div
class=
"line-item"
>
<marquee
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.label"
></marquee>
</div>
<p
class=
"line-item txt-orange"
>
{{
item
.
value
}}
</p>
</div>
</div>
...
...
@@ -67,9 +69,9 @@ export default {
rankList
:
[],
echartsLine
:
''
,
moveAttr
:
{
speed
:
900
,
//
speed: 900,
seriesIndex
:
0
,
dataIndex
:
-
1
dataIndex
:
0
},
timer
:
null
}
...
...
@@ -81,12 +83,12 @@ export default {
mounted
()
{
this
.
lineDom
=
document
.
getElementById
(
this
.
domId
)
this
.
echartsLine
=
echarts
.
init
(
this
.
lineDom
)
this
[
this
.
domId
]
=
echarts
.
init
(
this
.
lineDom
)
},
methods
:
{
resetRankList
()
{
this
.
rankList
=
new
Array
(
5
).
fill
({
label
:
'-
'
,
value
:
'
-'
})
this
.
rankList
=
new
Array
(
5
).
fill
({
label
:
'-
-'
,
value
:
'-
-'
})
},
tooltipFormatter
(
obj
)
{
var
currentItem
=
this
.
dataList
[
obj
[
0
].
dataIndex
]
...
...
@@ -100,41 +102,44 @@ export default {
return
txt
},
autoMove
()
{
clearInterval
(
this
.
timer
)
this
.
timer
=
setInterval
(()
=>
{
this
.
moveAttr
.
dataIndex
=
this
.
moveAttr
.
dataIndex
+
1
if
(
this
.
moveAttr
.
dataIndex
===
this
.
dataList
.
length
)
{
this
.
moveAttr
.
dataIndex
=
0
}
//
autoMove() {
//
clearInterval(this.timer)
//
this.timer = setInterval(() => {
//
this.moveAttr.dataIndex = this.moveAttr.dataIndex + 1
//
if (this.moveAttr.dataIndex === this.dataList.length) {
//
this.moveAttr.dataIndex = 0
//
}
this
.
chartAction
()
this
.
autoMove
()
this
.
getRankList
(
this
.
moveAttr
.
dataIndex
,
this
.
rankFlag
+
'List'
)
},
this
.
moveAttr
.
speed
)
},
//
this.chartAction()
//
this.autoMove()
//
this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List')
//
}, this.moveAttr.speed)
//
},
chartBindEvent
()
{
// resize
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
echartsLine
.
resize
()
this
[
this
.
domId
]
.
resize
()
})
// 鼠标划入
this
.
lineDom
.
addEventListener
(
'mouseover'
,
()
=>
{
clearInterval
(
this
.
timer
)
this
.
chartAction
(
'downplay
'
)
this
[
this
.
domId
].
on
(
'mouseover'
,
data
=>
{
this
.
moveAttr
.
seriesIndex
=
data
.
dataIndex
this
.
getRankList
(
this
.
moveAttr
.
seriesIndex
,
this
.
rankFlag
+
'List
'
)
})
// 鼠标划出
this
.
lineDom
.
addEventListener
(
'mouseout'
,
()
=>
{
this
.
moveAttr
.
dataIndex
=
-
1
this
.
autoMove
()
this
[
this
.
domId
].
on
(
'mouseout'
,
()
=>
{
console
.
log
(
'0000000000'
)
setTimeout
(()
=>
{
this
.
chartAction
()
},
1000
)
})
},
chartAction
(
type
)
{
this
.
echartsLine
.
dispatchAction
({
console
.
log
(
this
.
moveAttr
,
'???/cwq'
)
this
[
this
.
domId
].
dispatchAction
({
type
:
type
||
'showTip'
,
seriesIndex
:
this
.
moveAttr
.
seriesIndex
,
dataIndex
:
this
.
moveAttr
.
dataIndex
...
...
@@ -150,26 +155,16 @@ export default {
this
.
lineOptions
.
series
[
0
].
data
=
this
.
dataList
.
map
(
item
=>
item
.
num
)
this
.
echartsLine
.
setOption
(
this
.
lineOptions
)
// // 鼠标划入
// this.echartsLine.on('click', data => {
// clearInterval(this.timer)
// this.chartAction('downplay')
// })
this
[
this
.
domId
].
setOption
(
this
.
lineOptions
)
// // 鼠标划出
// this.echartsLine.on('mouseout', () => {
// this.moveAttr.dataIndex = -1
// this.autoMove()
// })
// console.log(this.echartsLine)
this
.
chartBindEvent
()
// 默认展示tooltip
this
.
chartAction
()
this
.
getRankList
(
0
)
this
.
autoMove
()
//
this.autoMove()
},
handleRankChange
(
value
)
{
...
...
@@ -232,6 +227,7 @@ p {
border-left
:
1px
solid
rgba
(
96
,
98
,
102
,
0.4
);
.line-item
{
height
:
1.8vh
;
width
:
100%
;
font-size
:
10px
;
padding-bottom
:
0.6vh
;
}
...
...
src/components/PieChart.vue
View file @
e2ca2e4
...
...
@@ -36,7 +36,7 @@ export default {
},
colors
:
{
type
:
Array
,
default
:
()
=>
[
'#4FA0FF'
,
'#
7CFFB2'
,
'#FDF006'
,
'#EB6001'
,
'#F5AA01'
,
'#BF98FF'
,
'#58D9F9
'
]
default
:
()
=>
[
'#4FA0FF'
,
'#
FF6E76'
,
'#7CFFB2'
,
'#FDF006'
,
'#EB6001'
,
'#F5AA01'
,
'#BF98FF'
,
'#4FA0FF
'
]
}
},
...
...
src/components/RanKing.vue
View file @
e2ca2e4
...
...
@@ -43,20 +43,23 @@ export default {
background
:
#262525
;
.ranking-title
{
background
:
rgba
(
53
,
53
,
53
,
0.6
);
font-size
:
10px
;
font-size
:
0.694vw
;
color
:
#eb6001
;
font-weight
:
400
;
padding
:
0.4vh
0
0.4vh
20%
;
box-sizing
:
border-box
;
}
.ranking
{
font-size
:
10px
;
font-size
:
0.694vw
;
color
:
#ffffff
;
letter-spacing
:
0
;
font-weight
:
400
;
padding
:
0.1vh
0
0.4
vh
8px
;
padding
:
0.2vh
0
0.3
vh
8px
;
.brand
{
line-height
:
1.9vh
;
//
line-height
:
1.9vh
;
height
:
1.9vh
;
display
:
flex
;
align-items
:
center
;
.brand-num
{
color
:
#606266
;
margin-right
:
0.6vw
;
...
...
@@ -64,6 +67,7 @@ export default {
.marquee
{
width
:
80%
;
height
:
1.9vh
;
font-weight
:
400
;
}
}
}
...
...
src/components/lineOptions.js
View file @
e2ca2e4
...
...
@@ -4,6 +4,7 @@ function getLineOptions(obj) {
tooltip
:
{
trigger
:
'axis'
,
borderWidth
:
0
,
show
:
true
,
backgroundColor
:
'rgba(68,68,68,0.80)'
,
textStyle
:
{
color
:
'#FFFFFF'
,
...
...
@@ -38,13 +39,14 @@ function getLineOptions(obj) {
series
:
[
{
type
:
'line'
,
symbol
:
'circle'
,
itemStyle
:
{
color
:
'#F5AA01'
},
// 节点,平滑曲线
symbol
:
'none'
,
// 平滑曲线
smooth
:
true
,
showSymbol
:
false
,
// 折线背景色
areaStyle
:
{
color
:
{
...
...
src/mixins/clientMixin.js
View file @
e2ca2e4
...
...
@@ -11,7 +11,7 @@ export default {
},
mixins
:
[
changeMixin
],
created
()
{
this
.
getClientData
()
//
this.getClientData()
},
methods
:
{
getClientData
()
{
...
...
@@ -22,7 +22,7 @@ export default {
queryItem
:
this
.
type
,
// queryTime: this.getCurrentDate,
queryTime
:
'2022-06-23'
,
queryType
:
this
.
watchReportParams
.
reportType
//
queryType: this.watchReportParams.reportType
}
}
if
(
this
.
isBrand
)
params
.
req
.
brandName
=
this
.
brandName
...
...
src/mixins/salesMixin.js
View file @
e2ca2e4
...
...
@@ -11,7 +11,7 @@ export default {
},
mixins
:
[
changeMixin
],
created
()
{
this
.
getSalesData
()
//
this.getSalesData()
},
methods
:
{
getSalesData
()
{
...
...
src/views/afterSales/analyze.vue
View file @
e2ca2e4
...
...
@@ -9,12 +9,12 @@
<div>
<div
class=
"title"
>
售后客户价值分析
</div>
<template
v-if=
"barData.length > 0"
>
<div
class=
"analyze-content"
:style=
"
{ height: height -
4.9 + 'vh'
}">
<div
class=
"analyze-content"
:style=
"
{ height: height -
5 + 'vh'
}">
<div
class=
"content-left bg"
>
<div
id=
"analyzeBar"
style=
"height: 100%"
></div>
</div>
<div
class=
"contetn-right bg"
>
<pie-chart
:id=
"chart.id"
:list=
"analyzeData"
:height=
"height -
4.9
+ 'vh'"
:radius=
"chart.radius"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"analyzeData"
:height=
"height -
5
+ 'vh'"
:radius=
"chart.radius"
></pie-chart>
</div>
</div>
</
template
>
...
...
@@ -186,6 +186,9 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.title
{
padding
:
1vh
0.556vw
;
}
.analyze-content
{
display
:
flex
;
padding
:
0
8px
1.8vh
;
...
...
src/views/afterSales/mileage.vue
View file @
e2ca2e4
...
...
@@ -9,15 +9,15 @@
<div>
<div
class=
"title"
>
售后车辆里程
</div>
<template
v-if=
"mileageData.length > 0"
>
<div
class=
"flex"
>
<pie-chart
:id=
"chart.id"
:list=
"mileageData"
:height=
"height -
4.9
+ 'vh'"
:radius=
"chart.radius"
@
pieAction=
"pieAction"
></pie-chart>
<div
class=
"flex
container
"
>
<pie-chart
:id=
"chart.id"
:list=
"mileageData"
:height=
"height -
5
+ 'vh'"
:radius=
"chart.radius"
@
pieAction=
"pieAction"
></pie-chart>
<div
class=
"ranking-container"
>
<div
class=
"ranking-title"
>
<div
class=
"ranking-title-brand"
>
品牌
</div>
<div>
客户数
</div>
</div>
<div
class=
"ranking"
>
<div
class=
"brand flex"
v-for=
"(item, index) in rankingData"
:key=
"index"
>
<div
class=
"brand flex"
v-for=
"(item, index) in rankingData
.slice(0,5)
"
:key=
"index"
>
<span
class=
"brand-num"
>
{{
index
+
1
}}
</span>
<marquee
class=
"marquee"
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.brand"
/>
<span>
{{
item
.
value
}}
</span>
...
...
@@ -108,6 +108,9 @@ export default {
}
</
script
>
<
style
lang=
"scss"
scoped
>
.title
{
padding
:
1vh
0.556vw
;
}
.ranking-container
{
flex
:
1
;
margin-left
:
0.6vw
;
...
...
@@ -117,20 +120,23 @@ export default {
background
:
#262525
;
.ranking-title
{
padding
:
0.5vh
1.5vw
0.4vh
1.5vw
;
font-size
:
12px
;
font-size
:
0.833vw
;
color
:
#eb6001
;
letter-spacing
:
0
;
font-weight
:
400
;
background
:
rgba
(
53
,
53
,
53
,
0.6
);
display
:
flex
;
align-items
:
center
;
div{
white-space
:
nowrap
;
}
.ranking-title-brand
{
width
:
4.9vw
;
margin-right
:
0.6vw
;
}
}
.ranking
{
font-size
:
10px
;
font-size
:
0.694vw
;
color
:
#ffffff
;
letter-spacing
:
0
;
font-weight
:
400
;
...
...
src/views/salesData/enterCategory.vue
View file @
e2ca2e4
...
...
@@ -13,7 +13,7 @@
</div>
<div
class=
"flex container"
>
<template
v-if=
"salesData.length > 0"
>
<pie-chart
:id=
"chart.id"
:list=
"salesData"
@
pieAction=
"pieAction"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"salesData"
:colors=
"chart.colors"
@
pieAction=
"pieAction"
></pie-chart>
<ran-king
:list=
"brandList"
></ran-king>
</
template
>
<div
class=
"empty"
style=
"height: 12.7vh"
v-else
>
...
...
@@ -32,7 +32,8 @@ export default {
return
{
type
:
'entertype'
,
chart
:
{
id
:
'enterCategory-pie'
id
:
'enterCategory-pie'
,
colors
:
[
'#F5AA01'
,
'#FF6E76'
,
'#4FA0FF'
]
}
}
},
...
...
src/views/salesData/infoFrom.vue
View file @
e2ca2e4
...
...
@@ -32,7 +32,7 @@ export default {
return
{
type
:
'infosource'
,
chart
:
{
id
:
'infoFrom-pie'
id
:
'infoFrom-pie'
,
}
}
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment