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 77daaa03
authored
Jun 30, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
c2532d2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
16 deletions
src/views/afterSales/analyze.vue
src/views/customer/sex.vue
src/views/afterSales/analyze.vue
View file @
77daaa0
...
@@ -42,7 +42,7 @@ export default {
...
@@ -42,7 +42,7 @@ export default {
barChart
:
''
,
barChart
:
''
,
option
:
{},
option
:
{},
barData
:
[],
barData
:
[],
key
:
1
,
key
:
'重要价值'
,
isBrand
:
false
,
isBrand
:
false
,
brandName
:
''
brandName
:
''
}
}
...
@@ -154,18 +154,23 @@ export default {
...
@@ -154,18 +154,23 @@ export default {
}
}
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
getChart
()
this
.
getChart
()
this
.
initPieData
()
this
.
initPieData
(
this
.
key
)
})
})
}
}
})
})
},
},
initPieData
(
name
)
{
initPieData
(
name
)
{
const
distributionRank
=
this
.
distributionRank
[
this
.
key
]
this
.
analyzeData
=
[]
Object
.
keys
(
distributionRank
).
forEach
(
item
=>
{
datas
.
Customer
.
valueType
.
value
.
map
(
item
=>
{
this
.
analyzeData
.
push
({
if
(
item
.
name
==
name
)
{
name
:
item
,
const
distributionRank
=
this
.
distributionRank
[
item
.
value
]
value
:
distributionRank
[
item
]
Object
.
keys
(
distributionRank
).
forEach
(
item
=>
{
})
this
.
analyzeData
.
push
({
name
:
item
,
value
:
distributionRank
[
item
]
})
})
}
})
})
},
},
init
(
newVal
)
{
init
(
newVal
)
{
...
...
src/views/customer/sex.vue
View file @
77daaa0
...
@@ -11,12 +11,12 @@
...
@@ -11,12 +11,12 @@
<span
class=
"icon"
></span>
<span
class=
"icon"
></span>
<span>
客户性别
</span>
<span>
客户性别
</span>
</div>
</div>
<div
class=
"container flex"
>
<div
class=
"container flex"
>
<template
v-if=
"clientData.length > 0"
>
<template
v-if=
"clientData.length > 0"
>
<pie-chart
:id=
"chart.id"
:list=
"clientData"
:colors=
"chart.colors"
@
pieAction=
"pieAction"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"clientData"
:colors=
"chart.colors"
@
pieAction=
"pieAction"
></pie-chart>
<ran-king
:list=
"brandList"
></ran-king>
<ran-king
:list=
"brandList"
></ran-king>
</
template
>
</
template
>
<div
class=
"empty"
style=
"height:12.7vh"
v-else
>
<div
class=
"empty"
style=
"height:
12.7vh"
v-else
>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
<img
src=
"../../assets/images/empty.png"
alt=
""
/>
</div>
</div>
</div>
</div>
...
@@ -26,20 +26,23 @@
...
@@ -26,20 +26,23 @@
import
{
clientMixin
}
from
'../../mixins/index'
import
{
clientMixin
}
from
'../../mixins/index'
export
default
{
export
default
{
name
:
'Sex'
,
name
:
'Sex'
,
mixins
:
[
clientMixin
],
mixins
:
[
clientMixin
],
data
()
{
data
()
{
return
{
return
{
type
:
'gender'
,
type
:
'gender'
,
chart
:
{
chart
:
{
id
:
'sex-pie'
,
id
:
'sex-pie'
,
colors
:
[
"#EB6001"
,
"#BF98FF"
,
"#FF6E76"
]
colors
:
[
'#EB6001'
,
'#BF98FF'
,
'#FF6E76'
]
}
}
}
}
},
},
methods
:{
methods
:
{
pieAction
(
data
){
pieAction
(
data
)
{
console
.
log
(
this
.
distributionRank
,
'客户性别'
)
this
.
brandList
=
[]
this
.
brandList
=
this
.
distributionRank
&&
this
.
distributionRank
[
data
.
name
]
&&
Object
.
keys
(
this
.
distributionRank
[
data
.
name
])
let
array
=
this
.
distributionRank
&&
this
.
distributionRank
[
data
.
name
]
for
(
let
i
of
array
)
{
this
.
brandList
.
push
(
Object
.
keys
(
i
)[
0
])
}
}
}
}
}
}
}
...
...
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