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 9346226f
authored
Jul 22, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'gh_v1.2.0' of
http://192.168.3.233:8090/gh/data-view
into gh_v1.2.0
2 parents
9b07d996
08e767d9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
77 additions
and
42 deletions
src/components/LineChart.vue
src/components/PieChart.vue
src/components/ViewTabs.vue
src/views/afterSales/efficient.vue
src/views/afterSales/file.vue
src/views/afterSales/first.vue
src/views/afterSales/keep.vue
src/views/afterSales/lost.vue
src/views/afterSales/sadayasu.vue
src/components/LineChart.vue
View file @
9346226
...
...
@@ -11,9 +11,13 @@
<div
class=
"line-item"
>
<marquee
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.label"
></marquee>
</div>
<div
class=
"line-item"
>
<
marquee
class=
"txt-orange"
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.value"
></marquee
>
<
span
class=
"txt-orange"
:direction=
"directionTimer"
:delay=
"delayTimer"
>
{{
item
.
value
}}
</span
>
</div>
<!--
<div
class=
"line-item"
>
<marquee
class=
"txt-orange"
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.value"
></marquee>
</div>
-->
</div>
</div>
</div>
...
...
@@ -137,17 +141,17 @@ export default {
// 移除图表
this
[
this
.
domId
].
on
(
'globalout'
,
()
=>
{
//
this.chartAction()
this
.
chartAction
()
this
.
getRankList
(
this
.
dataList
.
length
-
1
,
this
.
rankFlag
+
'List'
)
})
},
//
chartAction(type) {
//
this[this.domId].dispatchAction({
//
type: type || 'showTip',
// seriesIndex: +this.moveAttr.seriesIndex
,
// dataIndex: +this.moveAttr.dataIndex
//
})
//
},
chartAction
(
type
)
{
this
[
this
.
domId
].
dispatchAction
({
type
:
type
||
'showTip'
,
seriesIndex
:
0
,
dataIndex
:
this
.
dataList
.
length
-
1
})
},
getRankList
(
idx
,
attrName
=
'topList'
)
{
this
.
dataList
[
idx
][
attrName
].
length
?
this
.
$set
(
this
,
'rankList'
,
this
.
dataList
[
idx
][
attrName
])
:
this
.
resetRankList
()
},
...
...
@@ -157,10 +161,13 @@ export default {
let
month
=
new
Date
(
e
.
statDate
).
getMonth
()
this
.
lineOptions
.
xAxis
.
data
.
push
(
this
.
queryType
==
0
?
`
${
month
==
0
?
'1月'
:
`
${
Number
(
month
)
+
1
}
月`
}
`
:
e
.
statDate
.
split
(
'-'
).
slice
(
1
).
join
(
'-'
))
})
this
.
lineOptions
.
series
[
0
].
data
=
this
.
dataList
.
map
(
item
=>
item
.
num
)
var
seriesDate
=
this
.
dataList
.
map
(
item
=>
+
item
.
num
)
this
.
lineOptions
.
series
[
0
].
data
=
seriesDate
this
.
lineOptions
.
yAxis
.
min
=
Math
.
min
(...
seriesDate
)
this
.
lineOptions
.
yAxis
.
max
=
Math
.
max
(...
seriesDate
)
this
[
this
.
domId
].
setOption
(
this
.
lineOptions
)
// 默认展示tooltip
//
this.chartAction()
this
.
chartAction
()
this
.
getRankList
(
this
.
dataList
.
length
-
1
)
},
handleRankChange
(
value
)
{
...
...
src/components/PieChart.vue
View file @
9346226
...
...
@@ -3,7 +3,10 @@
<div
:id=
"id"
:style=
"
{ height: height }" class="pie-chart">
</div>
<div
class=
"center-content"
:style=
"
{ fontSize: size }">
<div
:class=
"[id, 'center-content-num']"
></div>
<div
class=
"center-content-desc"
>
{{
numDesc
}}
</div>
</div>
<div
class=
"content-desc"
>
<div
class=
"content-desc-icon"
:style=
"
{ background: descColor }">
</div>
{{
numDesc
}}
</div>
</div>
</
template
>
...
...
@@ -54,7 +57,8 @@ export default {
subtext
:
''
,
currentIndex
:
-
1
,
mainValue
:
0
,
numDesc
:
''
numDesc
:
''
,
descColor
:
''
}
},
watch
:
{
...
...
@@ -145,8 +149,10 @@ export default {
this
.
mTime
=
setInterval
(
this
.
pieActive
,
15000
)
})
this
.
echartsPie
.
on
(
'mouseover'
,
data
=>
{
console
.
log
(
data
,
'data'
)
this
.
mainValue
=
data
.
data
.
value
this
.
numDesc
=
data
.
data
.
name
this
.
descColor
=
data
.
color
this
.
setAnamiteText
()
// 停止定时器,清除之前的高亮
clearInterval
(
this
.
mTime
)
...
...
@@ -178,16 +184,18 @@ export default {
dataIndex
:
this
.
currentIndex
})
//高亮项this.currentIndex
this
.
mainValue
=
this
.
option
.
series
[
0
].
data
[
this
.
currentIndex
].
value
this
.
numDesc
=
this
.
option
.
series
[
0
].
data
[
this
.
currentIndex
].
name
this
.
descColor
=
this
.
option
.
color
[
this
.
currentIndex
]
this
.
setAnamiteText
()
},
setAnamiteText
()
{
document
.
querySelector
(
`.
${
this
.
id
}
`
).
nextElementSibling
.
style
=
'animation-iteration-count:infinite;'
//
document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
if
(
document
.
querySelector
(
`.
${
this
.
id
}
`
))
document
.
querySelector
(
`.
${
this
.
id
}
`
).
style
=
`--step:
${
this
.
mainValue
}
`
setTimeout
(()
=>
{
document
.
querySelector
(
`.
${
this
.
id
}
`
).
nextElementSibling
.
style
=
'animation-iteration-count:0'
},
3000
)
//
setTimeout(() => {
//
document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:0'
//
}, 3000)
},
//高亮
pieActive
()
{
...
...
@@ -235,7 +243,26 @@ export default {
animation
:
rotateIn
3s
infinite
;
}
}
.pie-chart
{
.content-desc
{
display
:
flex
;
align-items
:
center
;
font-size
:
8px
;
color
:
#c8c8c8
;
text-align
:
center
;
font-weight
:
400
;
position
:
absolute
;
top
:
93%
;
left
:
50%
;
transform
:
translateX
(
-50%
);
text-align
:
center
;
height
:
14px
!important
;
white-space
:
nowrap
;
&-icon
{
width
:
8px
;
height
:
4px
;
border-radius
:
2px
;
margin-right
:
4px
;
}
}
}
@property
--step
{
...
...
src/components/ViewTabs.vue
View file @
9346226
...
...
@@ -140,6 +140,7 @@ export default {
this
.
getOveralltrend
(
'total'
)
},
changeType
(
type
)
{
console
.
log
(
type
,
'type'
)
this
.
tabType
=
type
this
.
getOveralltrend
(
type
)
},
...
...
src/views/afterSales/efficient.vue
View file @
9346226
...
...
@@ -98,8 +98,8 @@ export default {
})
this
.
dataList
.
push
({
num
:
item
.
num
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
2
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
2
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
4
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
4
)
||
0
,
statDate
:
item
.
statDate
,
topList
:
topList
,
lastList
:
lastList
...
...
src/views/afterSales/file.vue
View file @
9346226
...
...
@@ -100,8 +100,8 @@ export default {
})
this
.
dataList
.
push
({
num
:
item
.
num
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
2
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
2
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
4
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
4
)
||
0
,
statDate
:
item
.
statDate
,
topList
:
topList
,
lastList
:
lastList
...
...
src/views/afterSales/first.vue
View file @
9346226
...
...
@@ -116,20 +116,20 @@ export default {
Object
.
keys
(
topTempList
).
forEach
(
item
=>
{
topList
.
push
({
label
:
item
,
value
:
topTempList
[
item
].
rate
?
topTempList
[
item
].
rate
.
toFixed
(
2
)
+
'%'
:
'- -'
value
:
topTempList
[
item
].
rate
?
topTempList
[
item
].
rate
.
toFixed
(
4
)
+
'%'
:
'- -'
})
})
Object
.
keys
(
lastTempList
).
forEach
(
item
=>
{
lastList
.
push
({
label
:
item
,
value
:
lastTempList
[
item
].
rate
?
lastTempList
[
item
].
rate
.
toFixed
(
2
)
+
'%'
:
'- -'
value
:
lastTempList
[
item
].
rate
?
lastTempList
[
item
].
rate
.
toFixed
(
4
)
+
'%'
:
'- -'
})
})
this
.
dataList
.
push
({
num
:
item
.
num
||
0
,
rate
:
item
.
rate
.
toFixed
(
2
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
2
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
2
)
||
0
,
rate
:
item
.
rate
.
toFixed
(
4
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
4
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
4
)
||
0
,
statDate
:
item
.
statDate
,
topList
:
topList
,
lastList
:
lastList
...
...
src/views/afterSales/keep.vue
View file @
9346226
...
...
@@ -108,20 +108,20 @@ export default {
Object
.
keys
(
topTempList
).
forEach
(
item
=>
{
topList
.
push
({
label
:
item
,
value
:
topTempList
[
item
].
rate
?
topTempList
[
item
].
rate
.
toFixed
(
2
)
+
'%'
:
'- -'
value
:
topTempList
[
item
].
rate
?
topTempList
[
item
].
rate
.
toFixed
(
4
)
+
'%'
:
'- -'
})
})
Object
.
keys
(
lastTempList
).
forEach
(
item
=>
{
lastList
.
push
({
label
:
item
,
value
:
lastTempList
[
item
].
rate
?
lastTempList
[
item
].
rate
.
toFixed
(
2
)
+
'%'
:
'- -'
value
:
lastTempList
[
item
].
rate
?
lastTempList
[
item
].
rate
.
toFixed
(
4
)
+
'%'
:
'- -'
})
})
this
.
dataList
.
push
({
num
:
item
.
num
||
0
,
rate
:
item
.
rate
.
toFixed
(
2
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
2
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
2
)
||
0
,
rate
:
item
.
rate
.
toFixed
(
4
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
4
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
4
)
||
0
,
statDate
:
item
.
statDate
,
topList
:
topList
,
lastList
:
lastList
...
...
src/views/afterSales/lost.vue
View file @
9346226
...
...
@@ -108,20 +108,20 @@ export default {
Object
.
keys
(
topTempList
).
forEach
(
item
=>
{
topList
.
push
({
label
:
item
,
value
:
topTempList
[
item
].
rate
?
topTempList
[
item
].
rate
.
toFixed
(
2
)
+
'%'
:
'- -'
value
:
topTempList
[
item
].
rate
?
topTempList
[
item
].
rate
.
toFixed
(
4
)
+
'%'
:
'- -'
})
})
Object
.
keys
(
lastTempList
).
forEach
(
item
=>
{
lastList
.
push
({
label
:
item
,
value
:
lastTempList
[
item
].
rate
?
lastTempList
[
item
].
rate
.
toFixed
(
2
)
+
'%'
:
'- -'
value
:
lastTempList
[
item
].
rate
?
lastTempList
[
item
].
rate
.
toFixed
(
4
)
+
'%'
:
'- -'
})
})
this
.
dataList
.
push
({
num
:
item
.
num
||
0
,
rate
:
item
.
rate
.
toFixed
(
2
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
2
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
2
)
||
0
,
rate
:
item
.
rate
.
toFixed
(
4
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
4
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
4
)
||
0
,
statDate
:
item
.
statDate
,
topList
:
topList
,
lastList
:
lastList
...
...
src/views/afterSales/sadayasu.vue
View file @
9346226
...
...
@@ -116,20 +116,20 @@ export default {
Object
.
keys
(
topTempList
).
forEach
(
item
=>
{
topList
.
push
({
label
:
item
,
value
:
topTempList
[
item
].
rate
?
topTempList
[
item
].
rate
.
toFixed
(
2
)
+
'%'
:
'- -'
value
:
topTempList
[
item
].
rate
?
topTempList
[
item
].
rate
.
toFixed
(
4
)
+
'%'
:
'- -'
})
})
Object
.
keys
(
lastTempList
).
forEach
(
item
=>
{
lastList
.
push
({
label
:
item
,
value
:
lastTempList
[
item
].
rate
?
lastTempList
[
item
].
rate
.
toFixed
(
2
)
+
'%'
:
'- -'
value
:
lastTempList
[
item
].
rate
?
lastTempList
[
item
].
rate
.
toFixed
(
4
)
+
'%'
:
'- -'
})
})
this
.
dataList
.
push
({
num
:
item
.
num
||
0
,
rate
:
item
.
rate
.
toFixed
(
2
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
2
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
2
)
||
0
,
rate
:
item
.
rate
.
toFixed
(
4
)
||
0
,
hrate
:
item
.
hrate
.
toFixed
(
4
)
||
0
,
trate
:
item
.
trate
.
toFixed
(
4
)
||
0
,
statDate
:
item
.
statDate
,
topList
:
topList
,
lastList
:
lastList
...
...
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