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 3cdb955e
authored
Jun 29, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
折线图
1 parent
0ac75913
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
24 deletions
src/api/modules/afterSales.js
src/components/LineChart.vue
src/views/afterSales/efficient.vue
src/views/afterSales/file.vue
src/api/modules/afterSales.js
View file @
3cdb955
...
...
@@ -8,14 +8,19 @@
import
Request
from
'../request'
var
request
=
new
Request
()
// 售后档案客户
//
品牌-
售后档案客户
const
getAfterSale
=
params
=>
{
return
request
.
get
(
'brand/aftersale'
,
params
)
}
// 门店-售后档案客户
const
getMerchantAfterSale
=
params
=>
{
return
request
.
get
(
'merchant/aftersale'
,
params
)
}
// 获取品牌售后其他信息
const
aftersaleother
=
params
=>
{
return
request
.
get
(
'brand/aftersaleother'
,
params
)
}
export
default
{
getAfterSale
,
aftersaleother
}
export
default
{
getAfterSale
,
getMerchantAfterSale
,
aftersaleother
}
src/components/LineChart.vue
View file @
3cdb955
...
...
@@ -8,8 +8,8 @@
</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.
name
"
></marquee>
<p
class=
"line-item txt-orange"
>
{{
item
.
num
}}
</p>
<marquee
class=
"line-item"
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.
label
"
></marquee>
<p
class=
"line-item txt-orange"
>
{{
item
.
value
}}
</p>
</div>
</div>
</div>
...
...
@@ -25,7 +25,7 @@ export default {
props
:
{
storeOrBrandTxt
:
{
type
:
String
,
default
:
'
门店
'
default
:
'
品牌
'
},
dataList
:
{
type
:
Array
,
...
...
@@ -42,7 +42,7 @@ export default {
rankList
:
[],
echartsLine
:
''
,
moveAttr
:
{
speed
:
9
00
,
speed
:
20
00
,
seriesIndex
:
0
,
dataIndex
:
-
1
},
...
...
@@ -57,13 +57,6 @@ export default {
mounted
()
{
this
.
lineDom
=
document
.
getElementById
(
'line-chart'
)
this
.
echartsLine
=
echarts
.
init
(
this
.
lineDom
)
this
.
chartBindEvent
()
},
watch
:
{
dataList
()
{
this
.
drawLine
()
}
},
methods
:
{
...
...
@@ -114,7 +107,7 @@ export default {
},
getRankList
(
idx
,
attrName
=
'topList'
)
{
this
.
rankList
=
this
.
dataList
[
idx
][
attrName
]
this
.
$set
(
this
,
'rankList'
,
this
.
dataList
[
idx
][
attrName
])
},
drawLine
()
{
...
...
@@ -124,9 +117,24 @@ export default {
this
.
echartsLine
.
setOption
(
this
.
lineOptions
)
// // 鼠标划入
// this.echartsLine.on('click', data => {
// clearInterval(this.timer)
// this.chartAction('downplay')
// })
// // 鼠标划出
// this.echartsLine.on('mouseout', () => {
// this.moveAttr.dataIndex = -1
// this.autoMove()
// })
// console.log(this.echartsLine)
this
.
chartBindEvent
()
this
.
getRankList
(
0
)
this
.
autoMove
()
//
this.autoMove()
},
handleRankChange
(
value
)
{
...
...
src/views/afterSales/efficient.vue
View file @
3cdb955
...
...
@@ -8,7 +8,6 @@
<
template
>
<div>
<div
class=
"title"
>
有效客户
</div>
<LineChart
@
handleRankChange=
"handleRankChange"
:rankList=
"rankList"
></LineChart>
</div>
</
template
>
...
...
src/views/afterSales/file.vue
View file @
3cdb955
...
...
@@ -15,7 +15,7 @@
<div
v-if=
"isEmpty"
class=
"empty"
>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
</div>
<LineChart
v-else
:dataList=
"dataLis
t"
></LineChart>
<LineChart
v-else
ref=
"lineChartRef"
:dataList
.
sync=
"dataList"
:storeOrBrandTxt=
"storeOrBrandTx
t"
></LineChart>
</div>
</div>
</
template
>
...
...
@@ -34,6 +34,7 @@ export default {
data
()
{
return
{
isEmpty
:
true
,
storeOrBrandTxt
:
'品牌'
,
dataList
:
[]
}
},
...
...
@@ -42,7 +43,8 @@ export default {
},
methods
:
{
init
(
val
)
{
console
.
log
(
val
)
// console.log(val)
this
.
isEmpty
=
true
var
params
=
{
req
:
{
// corporateGroupName: '广汇',
...
...
@@ -53,19 +55,24 @@ export default {
queryType
:
val
.
reportType
||
0
}
}
this
.
api
.
afterSales
.
getAfterSale
(
params
).
then
(
res
=>
{
var
brandName
=
val
.
brand
?
val
.
brand
.
name
:
''
this
.
storeOrBrandTxt
=
brandName
?
'门店'
:
'品牌'
if
(
brandName
)
{
params
.
req
.
brandName
=
brandName
}
this
.
api
.
afterSales
[
brandName
?
'getMerchantAfterSale'
:
'getAfterSale'
](
params
).
then
(
res
=>
{
var
{
code
,
data
}
=
res
switch
(
+
code
)
{
case
0
:
this
.
dataList
=
[]
console
.
log
(
!
data
.
dataList
.
map
(
item
=>
item
.
num
).
every
(
item
=>
item
===
0
))
if
(
!
data
.
dataList
.
map
(
item
=>
item
.
num
).
every
(
item
=>
item
===
0
))
{
this
.
isEmpty
=
false
this
.
dealList
(
data
.
dataList
)
this
.
$nextTick
(()
=>
{
this
.
$refs
.
lineChartRef
.
drawLine
()
})
}
break
// default:
// alert(message)
}
})
},
...
...
@@ -73,8 +80,8 @@ export default {
var
topList
=
[]
var
lastList
=
[]
list
.
forEach
(
item
=>
{
const
topTempList
=
JSON
.
parse
(
item
.
topList
)
const
lastTempList
=
JSON
.
parse
(
item
.
lastList
)
const
topTempList
=
item
.
topList
==
'null'
?
[]
:
JSON
.
parse
(
item
.
topList
)
const
lastTempList
=
item
.
lastList
==
'null'
?
[]
:
JSON
.
parse
(
item
.
lastList
)
topList
=
[]
lastList
=
[]
Object
.
keys
(
topTempList
).
forEach
(
item
=>
{
...
...
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