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 25065fe5
authored
Jul 23, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交样式
1 parent
300e59d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
63 deletions
src/components/LineChart.vue
src/components/ViewTabs.vue
src/views/afterSales/analyze.vue
src/components/LineChart.vue
View file @
25065fe
...
...
@@ -163,8 +163,9 @@ export default {
})
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
.
lineOptions
.
yAxis
.
scale
=
true
// this.lineOptions.yAxis.min = Math.min(...seriesDate)
// this.lineOptions.yAxis.max = Math.max(...seriesDate)
this
[
this
.
domId
].
setOption
(
this
.
lineOptions
)
// 默认展示tooltip
this
.
chartAction
()
...
...
src/components/ViewTabs.vue
View file @
25065fe
...
...
@@ -102,11 +102,11 @@ import * as echarts from 'echarts'
export
default
{
name
:
'ViewTabs'
,
mixins
:
[
changeMixin
],
data
()
{
data
()
{
return
{
tabs
,
tabHead
:
[],
tabTitle
:
'客户总数'
,
tabTitle
:
'客户总数'
,
tabType
:
'total'
,
tabIndex
:
0
,
delayTimer
:
3000
,
...
...
@@ -126,10 +126,9 @@ export default {
updata
:
Date
.
now
()
}
},
mounted
()
{
},
mounted
()
{},
methods
:
{
init
(
params
)
{
init
(
params
)
{
this
.
isGroup
=
true
let
req
=
{
queryType
:
params
.
reportType
||
0
...
...
@@ -144,20 +143,22 @@ export default {
this
.
getOverallbase
(
'publiccus'
)
this
.
getOveralltrend
(
'total'
)
},
changeType
(
type
)
{
let
title
=
{
'total'
:
'客户总数'
,
'wechat'
:
'企微客户数'
,
'wechatGroup'
:
'企微群数'
,
'applet'
:
'小程序客户数'
,
'publiccus'
:
'公众号客户数'
}
changeType
(
type
)
{
let
title
=
{
total
:
'客户总数'
,
wechat
:
'企微客户数'
,
wechatGroup
:
'企微群数'
,
applet
:
'小程序客户数'
,
publiccus
:
'公众号客户数'
}
this
.
tabTitle
=
title
[
type
]
this
.
tabType
=
type
this
.
getOveralltrend
(
type
)
},
getOverallbase
(
queryItem
)
{
let
{
req
:
{
queryType
}
}
=
this
getOverallbase
(
queryItem
)
{
let
{
req
:
{
queryType
}
}
=
this
const
params
=
{
queryItem
,
queryType
,
...
...
@@ -192,64 +193,66 @@ export default {
}
}
this
.
pageData
[
queryItem
]
=
dataList
}
})
},
ObjectToArray
(
obj
)
{
ObjectToArray
(
obj
)
{
let
arr
=
[]
if
(
obj
&&
obj
!==
'null'
)
{
obj
=
obj
.
replace
(
'null'
,
'"未知"'
)
let
item
=
JSON
.
parse
(
obj
)
if
(
Array
.
isArray
(
item
))
item
.
map
(
e
=>
{
Object
.
keys
(
e
).
map
(
name
=>
arr
.
push
({
name
,
num
:
e
[
name
]
}))
})
if
(
Array
.
isArray
(
item
))
item
.
map
(
e
=>
{
Object
.
keys
(
e
).
map
(
name
=>
arr
.
push
({
name
,
num
:
e
[
name
]
}))
})
else
Object
.
keys
(
item
).
map
(
name
=>
arr
.
push
({
name
,
num
:
item
[
name
]
}))
}
return
arr
},
getOveralltrend
(
queryItem
)
{
let
{
req
:
{
queryType
}
}
=
this
getOveralltrend
(
queryItem
)
{
let
{
req
:
{
queryType
}
}
=
this
const
params
=
{
queryItem
,
queryType
,
querystartTime
:
queryType
==
1
?
this
.
getNDate
(
-
30
)
:
this
.
getNMonth
(
-
12
),
queryendTime
:
queryType
==
1
?
this
.
getNDate
(
-
1
)
:
this
.
getNMonth
(
-
1
),
queryendTime
:
queryType
==
1
?
this
.
getNDate
(
-
1
)
:
this
.
getNMonth
(
-
1
)
}
this
.
api
.
overview
[
this
.
isGroup
?
'getBrandOveralltrend'
:
'getMerchantOveralltrend'
](
params
).
then
(({
data
,
code
})
=>
{
this
.
flag
=
true
if
(
code
==
0
)
{
if
(
!
data
.
dataList
.
map
(
item
=>
item
.
totalNum
).
every
(
item
=>
item
===
0
))
{
this
.
isEmpty
=
false
this
.
$nextTick
(()
=>
{
this
.
canvas
=
echarts
.
init
(
this
.
$refs
.
canvas
)
this
.
draw
(
data
.
dataList
,
queryType
)
})
this
.
api
.
overview
[
this
.
isGroup
?
'getBrandOveralltrend'
:
'getMerchantOveralltrend'
](
params
)
.
then
(({
data
,
code
})
=>
{
this
.
flag
=
true
if
(
code
==
0
)
{
if
(
!
data
.
dataList
.
map
(
item
=>
item
.
totalNum
).
every
(
item
=>
item
===
0
))
{
this
.
isEmpty
=
false
this
.
$nextTick
(()
=>
{
this
.
canvas
=
echarts
.
init
(
this
.
$refs
.
canvas
)
this
.
draw
(
data
.
dataList
,
queryType
)
})
}
}
}
}).
catch
(()
=>
{
this
.
flag
=
true
})
})
.
catch
(()
=>
{
this
.
flag
=
true
})
},
chartAction
(
dataList
)
{
this
.
canvas
.
dispatchAction
({
type
:
'showTip'
,
type
:
'showTip'
,
seriesIndex
:
0
,
dataIndex
:
dataList
.
length
-
1
})
},
draw
(
lineData
,
queryType
)
{
draw
(
lineData
,
queryType
)
{
let
data
=
[],
Min
=
0
,
Min
=
0
,
xData
=
[],
title
=
{
'total'
:
'客户总数'
,
'wechat'
:
'企微客户数'
,
'wechatGroup'
:
'企微群数'
,
'applet'
:
'小程序客户数'
,
'publiccus'
:
'公众号客户数'
total
:
'客户总数'
,
wechat
:
'企微客户数'
,
wechatGroup
:
'企微群数'
,
applet
:
'小程序客户数'
,
publiccus
:
'公众号客户数'
},
{
tabType
}
=
this
lineData
.
map
(
e
=>
{
...
...
@@ -296,10 +299,11 @@ export default {
},
yAxis
:
{
type
:
'value'
,
min
:
Min
,
// min: Min,
scale
:
true
,
splitLine
:
{
lineStyle
:
{
color
:
'rgba(96,98,102,0.2)'
color
:
'rgba(96,98,102,0.2)'
}
},
axisLabel
:
{
...
...
@@ -326,16 +330,16 @@ export default {
y
:
0
,
x2
:
0
,
y2
:
1
,
colorStops
:
[
{
offset
:
0
,
color
:
'rgba(254, 84, 0, 0.3)'
},
{
offset
:
1
,
color
:
'rgba(254, 84, 0, 0.01)'
}
]
colorStops
:
[
{
offset
:
0
,
color
:
'rgba(254, 84, 0, 0.3)'
},
{
offset
:
1
,
color
:
'rgba(254, 84, 0, 0.01)'
}
]
}
},
data
...
...
@@ -343,7 +347,7 @@ export default {
]
}
this
.
canvas
.
setOption
(
options
)
this
.
chartAction
(
lineData
)
this
.
chartAction
(
lineData
)
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
canvas
.
resize
()
})
...
...
src/views/afterSales/analyze.vue
View file @
25065fe
...
...
@@ -64,8 +64,10 @@ export default {
tooltip
:
{
trigger
:
'axis'
,
axisPointer
:
{
type
:
'shadow'
// color: '#fff'
type
:
'shadow'
,
shadowStyle
:
{
color
:
'rgba(235,96,1,0.30'
}
},
borderWidth
:
0
,
backgroundColor
:
'rgba(68,68,68,0.80)'
,
...
...
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