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 72476d0b
authored
Jun 29, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
647f59e8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
22 deletions
src/api/modules/customer.js
src/mixins/clientMixin.js
src/mixins/salesMixin.js
src/views/customer/age.vue
src/views/salesData/customerCategory.vue
src/views/salesData/enterCategory.vue
src/views/salesData/infoFrom.vue
src/api/modules/customer.js
View file @
72476d0
...
...
@@ -6,6 +6,11 @@ const overalldistribution = params => {
return
request
.
get
(
'brand/overalldistribution'
,
params
)
}
// 获取门店年龄/性别/购车年限
const
merchantOveralldistribution
=
params
=>
{
return
request
.
get
(
'merchant/overalldistribution'
,
params
)
}
export
default
{
overalldistribution
overalldistribution
,
merchantOveralldistribution
}
\ No newline at end of file
src/mixins/clientMixin.js
View file @
72476d0
// import{changeMixin} from "./changeMixin"
export
default
{
data
()
{
return
{
...
...
@@ -7,6 +8,7 @@ export default {
distributionRank
:
''
}
},
// mixins: [changeMixin],
created
()
{
this
.
getClientData
()
},
...
...
@@ -32,6 +34,9 @@ export default {
})
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
})
},
init
(
newVal
){
// console.log(newVal,1111111111111111111111111)
}
}
}
src/mixins/salesMixin.js
View file @
72476d0
...
...
@@ -2,7 +2,9 @@ export default {
data
()
{
return
{
now
:
new
Date
().
format
(
'yyyy-MM-dd'
),
salesData
:
[]
salesData
:
[],
brandList
:
[],
typeRanking
:
''
}
},
created
()
{
...
...
@@ -20,18 +22,15 @@ export default {
}
}
this
.
api
.
sales
.
getSales
(
params
).
then
(
res
=>
{
console
.
log
(
res
,
'salesData'
)
// let distribution = JSON.parse(res.data.dataList[0].distribution)
// const keys = Object.keys(distribution)
// keys.forEach((item, index) => {
// this.clientData.push({
// name: item,
// value: distribution[item]
// })
// })
// console.log(res.data.dataList[0].distributionRank)
// this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
// console.log(this.distributionRank,'this.distributionRank')
let
typeNum
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
typeNum
)
Object
.
keys
(
typeNum
).
forEach
((
item
,
index
)
=>
{
this
.
salesData
.
push
({
name
:
item
,
value
:
typeNum
[
item
]
})
})
this
.
typeRanking
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
typeRanking
)
})
}
}
...
...
src/views/customer/age.vue
View file @
72476d0
...
...
@@ -34,7 +34,7 @@ export default {
methods
:{
pieAction
(
data
){
this
.
brandList
=
Object
.
keys
(
this
.
distributionRank
[
data
.
name
])
}
}
,
}
}
</
script
>
src/views/salesData/customerCategory.vue
View file @
72476d0
...
...
@@ -12,21 +12,29 @@
<span>
客户级别
</span>
</div>
<div
class=
"flex container"
>
<
!--
<pie-chart
:id=
"chart.id"
></pie-chart>
--
>
<ran-king></ran-king>
<
pie-chart
:id=
"chart.id"
:list=
"salesData"
@
pieAction=
"pieAction"
></pie-chart
>
<ran-king
:list=
"brandList"
></ran-king>
</div>
</div>
</
template
>
<
script
>
import
{
salesMixin
}
from
'../../mixins/index'
export
default
{
name
:
'CustomerCategory'
,
mixins
:
[
salesMixin
],
data
()
{
return
{
type
:
'customerlevel'
,
chart
:
{
id
:
'customerCategory-pie'
}
}
},
methods
:
{
pieAction
(
data
)
{
this
.
brandList
=
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
}
}
}
</
script
>
src/views/salesData/enterCategory.vue
View file @
72476d0
...
...
@@ -12,7 +12,7 @@
<span>
进店类型
</span>
</div>
<div
class=
"container flex"
>
<
!--
<pie-chart
:id=
"chart.id"
:list=
"salesData"
@
pieAction=
"pieAction"
></pie-chart>
--
>
<
pie-chart
:id=
"chart.id"
:list=
"salesData"
@
pieAction=
"pieAction"
></pie-chart
>
<ran-king
:list=
"brandList"
></ran-king>
</div>
</div>
...
...
@@ -26,14 +26,15 @@ export default {
data
()
{
return
{
type
:
'entertype'
,
brandList
:
[],
chart
:
{
id
:
'enterCategory-pie'
}
}
},
methods
:
{
pieAction
(
data
)
{}
pieAction
(
data
)
{
this
.
brandList
=
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
}
}
}
</
script
>
src/views/salesData/infoFrom.vue
View file @
72476d0
...
...
@@ -12,21 +12,29 @@
<span>
信息来源
</span>
</div>
<div
class=
"container flex"
>
<
!--
<pie-chart
:id=
"chart.id"
></pie-chart>
--
>
<ran-king></ran-king>
<
pie-chart
:id=
"chart.id"
:list=
"salesData"
@
pieAction=
"pieAction"
></pie-chart
>
<ran-king
:list=
"brandList"
></ran-king>
</div>
</div>
</
template
>
<
script
>
import
{
salesMixin
}
from
'../../mixins/index'
export
default
{
name
:
'InfoFrom'
,
mixins
:
[
salesMixin
],
data
()
{
return
{
type
:
'infosource'
,
chart
:
{
id
:
'infoFrom-pie'
}
}
},
methods
:
{
pieAction
(
data
)
{
this
.
brandList
=
Object
.
keys
(
this
.
typeRanking
[
data
.
name
])
}
}
}
</
script
>
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