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 61dc2873
authored
Jul 04, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
29e4130a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
48 deletions
src/components/LineChart.vue
src/components/PieChart.vue
src/components/lineOptions.js
src/views/afterSales/analyze.vue
src/views/afterSales/keep.vue
src/views/afterSales/lost.vue
src/views/afterSales/mileage.vue
src/views/afterSales/sadayasu.vue
src/components/LineChart.vue
View file @
61dc287
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
<div
:id=
"domId"
class=
"line-chart"
></div>
<div
:id=
"domId"
class=
"line-chart"
></div>
<div
class=
"rank-box"
>
<div
class=
"rank-box"
>
<div
class=
"rank-title-block"
>
<div
class=
"rank-title-block"
>
<p
:class=
"[
'rank-title', rankFlag == 'top' ? 'rank-title-active' : ''
]"
@
click=
"handleRankChange('top')"
>
前5
{{
storeOrBrandTxt
}}
</p>
<p
:class=
"[
'rank-title', rankFlag == 'top' ? 'rank-title-active' : ''
]"
@
click=
"handleRankChange('top')"
>
前5
{{
storeOrBrandTxt
}}
</p>
<p
:class=
"[
'rank-title', rankFlag == 'last' ? 'rank-title-active' : ''
]"
@
click=
"handleRankChange('last')"
>
后5
{{
storeOrBrandTxt
}}
</p>
<p
:class=
"[
'rank-title', rankFlag == 'last' ? 'rank-title-active' : ''
]"
@
click=
"handleRankChange('last')"
>
后5
{{
storeOrBrandTxt
}}
</p>
</div>
</div>
<div
class=
"rank-block"
>
<div
class=
"rank-block"
>
<div
class=
"rank-line"
v-for=
"(item, index) in rankList"
:key=
"index"
>
<div
class=
"rank-line"
v-for=
"(item, index) in rankList"
:key=
"index"
>
...
@@ -88,6 +88,7 @@ export default {
...
@@ -88,6 +88,7 @@ export default {
mounted
()
{
mounted
()
{
this
.
lineDom
=
document
.
getElementById
(
this
.
domId
)
this
.
lineDom
=
document
.
getElementById
(
this
.
domId
)
this
[
this
.
domId
]
=
echarts
.
init
(
this
.
lineDom
)
this
[
this
.
domId
]
=
echarts
.
init
(
this
.
lineDom
)
this
.
chartBindEvent
()
},
},
methods
:
{
methods
:
{
...
@@ -96,7 +97,9 @@ export default {
...
@@ -96,7 +97,9 @@ export default {
},
},
tooltipFormatter
(
obj
)
{
tooltipFormatter
(
obj
)
{
var
currentItem
=
this
.
dataList
[
obj
[
0
].
dataIndex
]
var
currentItem
=
this
.
dataList
[
obj
[
0
].
dataIndex
]
console
.
log
(
currentItem
,
'currentItem'
)
var
txt
=
''
var
txt
=
''
txt
=
currentItem
.
statDate
this
.
tooltipFormatterObj
.
forEach
(
item
=>
{
this
.
tooltipFormatterObj
.
forEach
(
item
=>
{
if
(
txt
)
{
if
(
txt
)
{
txt
=
txt
+
'<br>'
txt
=
txt
+
'<br>'
...
@@ -119,13 +122,10 @@ export default {
...
@@ -119,13 +122,10 @@ export default {
})
})
// 绑定点击事件
// 绑定点击事件
this
[
this
.
domId
].
getZr
().
on
(
'mouseover'
,
(
params
)
=>
{
this
[
this
.
domId
].
getZr
().
on
(
'mouseover'
,
params
=>
{
const
pointInPixel
=
[
params
.
offsetX
,
params
.
offsetY
]
const
pointInPixel
=
[
params
.
offsetX
,
params
.
offsetY
]
if
(
this
[
this
.
domId
].
containPixel
(
'grid'
,
pointInPixel
))
{
if
(
this
[
this
.
domId
].
containPixel
(
'grid'
,
pointInPixel
))
{
var
xIndex
=
this
[
this
.
domId
].
convertFromPixel
({
seriesIndex
:
0
},
[
var
xIndex
=
this
[
this
.
domId
].
convertFromPixel
({
seriesIndex
:
0
},
[
params
.
offsetX
,
params
.
offsetY
])[
0
]
params
.
offsetX
,
params
.
offsetY
])[
0
]
/* 事件处理代码书写位置 */
/* 事件处理代码书写位置 */
this
.
moveAttr
.
dataIndex
=
xIndex
this
.
moveAttr
.
dataIndex
=
xIndex
this
.
getRankList
(
this
.
moveAttr
.
dataIndex
,
this
.
rankFlag
+
'List'
)
this
.
getRankList
(
this
.
moveAttr
.
dataIndex
,
this
.
rankFlag
+
'List'
)
...
@@ -162,8 +162,6 @@ export default {
...
@@ -162,8 +162,6 @@ export default {
this
[
this
.
domId
].
setOption
(
this
.
lineOptions
)
this
[
this
.
domId
].
setOption
(
this
.
lineOptions
)
this
.
chartBindEvent
()
// 默认展示tooltip
// 默认展示tooltip
this
.
chartAction
()
this
.
chartAction
()
...
...
src/components/PieChart.vue
View file @
61dc287
<
template
>
<
template
>
<div
class=
"pie-box"
>
<div
class=
"pie-box"
>
<div
:id=
"id"
:style=
"
{ height: height }" class="pie-chart">
</div>
<div
:id=
"id"
:style=
"
{ height: height }" class="pie-chart">
</div>
<div
class=
"center-content"
>
<div
class=
"center-content"
:style=
"
{fontSize:size}"
>
<div
:class=
"[id, 'center-content-num']"
></div>
<div
:class=
"[id, 'center-content-num']"
></div>
<div
class=
"center-content-desc"
>
{{
numDesc
}}
</div>
<div
class=
"center-content-desc"
>
{{
numDesc
}}
</div>
</div>
</div>
</div>
</div>
...
@@ -37,6 +37,10 @@ export default {
...
@@ -37,6 +37,10 @@ export default {
colors
:
{
colors
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[
'#4FA0FF'
,
'#FF6E76'
,
'#7CFFB2'
,
'#FDF006'
,
'#EB6001'
,
'#F5AA01'
,
'#BF98FF'
,
'#4FA0FF'
]
default
:
()
=>
[
'#4FA0FF'
,
'#FF6E76'
,
'#7CFFB2'
,
'#FDF006'
,
'#EB6001'
,
'#F5AA01'
,
'#BF98FF'
,
'#4FA0FF'
]
},
size
:{
type
:
String
,
default
:
'0.6vw'
}
}
},
},
...
@@ -207,7 +211,7 @@ export default {
...
@@ -207,7 +211,7 @@ export default {
overflow
:
hidden
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
white-space
:
nowrap
;
font-size
:
0.8
vw
;
//
font-size
:
0.6
vw
;
color
:
#fff
;
color
:
#fff
;
--step
:
0
;
--step
:
0
;
counter-reset
:
count
var
(
--step
);
counter-reset
:
count
var
(
--step
);
...
@@ -242,12 +246,4 @@ export default {
...
@@ -242,12 +246,4 @@ export default {
transform
:
rotateY
(
-1turn
);
transform
:
rotateY
(
-1turn
);
}
}
}
}
//
@keyframes
rotateIn
{
//
from
{
//
transform
:
rotateZ
(
0deg
);
//
}
//
to
{
//
transform
:
rotateZ
(
3600deg
);
//
}
//
}
</
style
>
</
style
>
src/components/lineOptions.js
View file @
61dc287
...
@@ -10,7 +10,7 @@ function getLineOptions(obj) {
...
@@ -10,7 +10,7 @@ function getLineOptions(obj) {
color
:
'#FFFFFF'
,
color
:
'#FFFFFF'
,
fontSize
:
'8px'
fontSize
:
'8px'
},
},
extraCssText
:
'width:
6
0px;'
,
extraCssText
:
'width:
10
0px;'
,
formatter
:
tooltipFormatter
||
''
formatter
:
tooltipFormatter
||
''
},
},
grid
:
{
grid
:
{
...
...
src/views/afterSales/analyze.vue
View file @
61dc287
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<div
id=
"analyzeBar"
style=
"height: 100%"
></div>
<div
id=
"analyzeBar"
style=
"height: 100%"
></div>
</div>
</div>
<div
class=
"contetn-right bg"
>
<div
class=
"contetn-right bg"
>
<pie-chart
:id=
"chart.id"
:list=
"analyzeData"
:height=
"height - 5 + 'vh'"
:radius=
"chart.radius"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"analyzeData"
:height=
"height - 5 + 'vh'"
:radius=
"chart.radius"
:size=
"chart.size"
></pie-chart>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -37,7 +37,8 @@ export default {
...
@@ -37,7 +37,8 @@ export default {
analyzeData
:
[],
analyzeData
:
[],
chart
:
{
chart
:
{
id
:
'analyzePie'
,
id
:
'analyzePie'
,
radius
:
[
'60%'
,
'78%'
]
radius
:
[
'60%'
,
'78%'
],
size
:
'0.8vw'
},
},
barChart
:
''
,
barChart
:
''
,
option
:
{},
option
:
{},
...
...
src/views/afterSales/keep.vue
View file @
61dc287
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<div
v-if=
"isEmpty"
class=
"empty"
>
<div
v-if=
"isEmpty"
class=
"empty"
>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
</div>
</div>
<LineChart
v-else
ref=
"lineChartRef"
domId=
"keepChart"
:dataList
.
sync=
"dataList"
:storeOrBrandTxt=
"storeOrBrandTxt"
:queryType=
"queryType"
></LineChart>
<LineChart
v-else
ref=
"lineChartRef"
domId=
"keepChart"
:dataList
.
sync=
"dataList"
:storeOrBrandTxt=
"storeOrBrandTxt"
:queryType=
"queryType"
:tooltipFormatterObj=
"tooltipFormatterObj"
></LineChart>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -36,10 +36,27 @@ export default {
...
@@ -36,10 +36,27 @@ export default {
isEmpty
:
true
,
isEmpty
:
true
,
storeOrBrandTxt
:
'品牌'
,
storeOrBrandTxt
:
'品牌'
,
queryType
:
0
,
queryType
:
0
,
dataList
:
[]
dataList
:
[],
tooltipFormatterObj
:
[
{
label
:
'保持率'
,
attrName
:
'rate'
,
addSymbol
:
'%'
},
{
label
:
'环比'
,
attrName
:
'hrate'
,
addSymbol
:
'%'
},
{
label
:
'同比'
,
attrName
:
'trate'
,
addSymbol
:
'%'
}
]
}
}
},
},
mounted
()
{
},
mounted
()
{},
methods
:
{
methods
:
{
init
(
val
)
{
init
(
val
)
{
this
.
isEmpty
=
true
this
.
isEmpty
=
true
...
...
src/views/afterSales/lost.vue
View file @
61dc287
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<div
v-if=
"isEmpty"
class=
"empty"
>
<div
v-if=
"isEmpty"
class=
"empty"
>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
</div>
</div>
<LineChart
v-else
ref=
"lineChartRef"
domId=
"lostChart"
:dataList
.
sync=
"dataList"
:storeOrBrandTxt=
"storeOrBrandTxt"
:queryType=
"queryType"
></LineChart>
<LineChart
v-else
ref=
"lineChartRef"
domId=
"lostChart"
:dataList
.
sync=
"dataList"
:storeOrBrandTxt=
"storeOrBrandTxt"
:queryType=
"queryType"
:tooltipFormatterObj=
"tooltipFormatterObj"
></LineChart>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -36,7 +36,24 @@ export default {
...
@@ -36,7 +36,24 @@ export default {
isEmpty
:
true
,
isEmpty
:
true
,
storeOrBrandTxt
:
'品牌'
,
storeOrBrandTxt
:
'品牌'
,
queryType
:
0
,
queryType
:
0
,
dataList
:
[]
dataList
:
[],
tooltipFormatterObj
:[
{
label
:
'流失率'
,
attrName
:
'rate'
,
addSymbol
:
'%'
},
{
label
:
'环比'
,
attrName
:
'hrate'
,
addSymbol
:
'%'
},
{
label
:
'同比'
,
attrName
:
'trate'
,
addSymbol
:
'%'
}
]
}
}
},
},
mounted
()
{
},
mounted
()
{
},
...
...
src/views/afterSales/mileage.vue
View file @
61dc287
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<div
class=
"title"
>
售后车辆里程
</div>
<div
class=
"title"
>
售后车辆里程
</div>
<template
v-if=
"mileageData.length > 0"
>
<template
v-if=
"mileageData.length > 0"
>
<div
class=
"flex container"
>
<div
class=
"flex container"
>
<pie-chart
:id=
"chart.id"
:list=
"mileageData"
:height=
"height - 5 + 'vh'"
:radius=
"chart.radius"
@
pieAction=
"pieAction"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"mileageData"
:height=
"height - 5 + 'vh'"
:radius=
"chart.radius"
@
pieAction=
"pieAction"
:size=
"chart.size"
></pie-chart>
<div
class=
"ranking-container"
>
<div
class=
"ranking-container"
>
<div
class=
"ranking-title"
>
<div
class=
"ranking-title"
>
<div
class=
"ranking-title-brand"
>
品牌
</div>
<div
class=
"ranking-title-brand"
>
品牌
</div>
...
@@ -45,7 +45,8 @@ export default {
...
@@ -45,7 +45,8 @@ export default {
rankingData
:
[],
rankingData
:
[],
chart
:
{
chart
:
{
id
:
'mileagePie'
,
id
:
'mileagePie'
,
radius
:
[
'60%'
,
'78%'
]
radius
:
[
'60%'
,
'78%'
],
size
:
'0.8vw'
},
},
delayTimer
:
3000
,
delayTimer
:
3000
,
directionTimer
:
3000
,
directionTimer
:
3000
,
...
@@ -63,7 +64,7 @@ export default {
...
@@ -63,7 +64,7 @@ export default {
const
params
=
{
const
params
=
{
req
:
{
req
:
{
queryItem
:
'mileage'
,
queryItem
:
'mileage'
,
queryTime
:
this
.
getCurrentDate
(),
queryTime
:
this
.
getCurrentDate
(),
queryType
:
this
.
watchReportParams
.
reportType
queryType
:
this
.
watchReportParams
.
reportType
}
}
...
...
src/views/afterSales/sadayasu.vue
View file @
61dc287
...
@@ -36,23 +36,6 @@ export default {
...
@@ -36,23 +36,6 @@ export default {
isEmpty
:
true
,
isEmpty
:
true
,
storeOrBrandTxt
:
'品牌'
,
storeOrBrandTxt
:
'品牌'
,
queryType
:
0
,
queryType
:
0
,
tooltipFormatterObj
:
[
{
label
:
'回店率'
,
attrName
:
'rate'
,
addSymbol
:
'%'
},
{
label
:
'环比'
,
attrName
:
'hrate'
,
addSymbol
:
'%'
},
{
label
:
'同比'
,
attrName
:
'trate'
,
addSymbol
:
'%'
}
],
dataList
:
[]
dataList
:
[]
}
}
},
},
...
...
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