Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-custom
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 374b8230
authored
Aug 11, 2023
by
杨明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed
1 parent
c3b13da8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
src/components/echarts/multipleEchart.vue
src/components/echarts/multipleEchart.vue
View file @
374b823
...
...
@@ -56,16 +56,35 @@ export default {
handler
(
val
)
{
this
.
dateArray
=
this
.
totalData
.
map
(
item
=>
item
.
dateTime
)
//日期
this
.
customerCount
=
this
.
totalData
.
map
(
item
=>
item
.
newCustomerCount
)
this
.
customerRatio
=
this
.
totalData
.
map
(
item
=>
item
.
customerRatio
*
100
)
this
.
customerRatio
=
this
.
totalData
.
map
(
item
=>
this
.
Solution
(
item
.
customerRatio
,
100
)
)
this
.
entmicroCount
=
this
.
totalData
.
map
(
item
=>
item
.
newEntmicroCount
)
this
.
entmicroRatio
=
this
.
totalData
.
map
(
item
=>
item
.
entmicroRatio
*
100
)
this
.
entmicroRatio
=
this
.
totalData
.
map
(
item
=>
this
.
Solution
(
item
.
entmicroRatio
,
100
)
)
this
.
initChart
()
}
}
},
methods
:
{
Solution
(
a
,
b
)
{
if
(
a
===
0
||
b
===
0
)
return
0
//
let
m
=
0
//精度
let
s1
=
a
.
toString
()
let
s2
=
b
.
toString
()
if
(
s1
.
indexOf
(
'.'
)
==
-
1
&&
s2
.
indexOf
(
'.'
)
==
-
1
)
{
return
a
*
b
}
else
{
//计算s1小数点后的位数
m
=
m
+
(
s1
.
indexOf
(
'.'
)
>=
0
?
s1
.
split
(
'.'
)[
1
].
length
:
0
)
//计算s2小数点后的位数
m
=
m
+
(
s2
.
indexOf
(
'.'
)
>=
0
?
s2
.
split
(
'.'
)[
1
].
length
:
0
)
//除小数点后的所有位数相乘/精度
return
(
Number
(
s1
.
replace
(
'.'
,
''
))
*
Number
(
s2
.
replace
(
'.'
,
''
)))
/
Math
.
pow
(
10
,
m
)
}
},
initChart
()
{
// 基于准备好的dom,初始化echarts实例
let
myChart
=
this
.
$echarts
.
init
(
this
.
$refs
.
myChart
)
...
...
@@ -100,7 +119,7 @@ export default {
circleColor
=
'#FEBE6B'
res
+=
`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:
${
circleColor
}
;"></span>`
+
datas
[
i
].
seriesName
+
':'
+
datas
[
i
].
data
+
'人'
+
'<br/>'
}
if
(
datas
[
i
].
seriesName
==
'企微客户环比'
)
{
if
(
datas
[
i
].
seriesName
==
'企微客户环比'
)
{
circleColor
=
'#FE9C1C'
res
+=
`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:
${
circleColor
}
;"></span>`
+
datas
[
i
].
seriesName
+
':'
+
datas
[
i
].
data
+
'%'
+
'<br/>'
}
...
...
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