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 9cb0ec13
authored
Jun 29, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
饼图接口对接
1 parent
96aa2179
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
141 additions
and
33 deletions
src/api/customer.js
src/api/modules/sales.js
src/components/PieChart.vue
src/mixins/clientMixin.js
src/mixins/index.js
src/mixins/salesMixin.js
src/views/afterSales/analyze.vue
src/views/afterSales/mileage.vue
src/views/customer/age.vue
src/views/customer/buyCar.vue
src/views/salesData/enterCategory.vue
src/api/customer.js
deleted
100644 → 0
View file @
96aa217
import
Request
from
'./request'
var
request
=
new
Request
()
const
client
=
{
// 获取品牌年龄/性别/购车年限
overalldistribution
:
params
=>
{
return
request
.
get
(
'brand/overalldistribution'
,
params
)
}
}
export
default
client
src/api/modules/sales.js
View file @
9cb0ec1
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*/
*/
import
Request
from
'../request'
import
Request
from
'../request'
const
request
=
new
Request
()
const
request
=
new
Request
()
const
getSales
=
params
=>
{
const
getSales
=
params
=>
{
return
request
.
get
(
'brand/sale'
,
params
)
return
request
.
get
(
'brand/sale'
,
params
)
}
}
...
...
src/components/PieChart.vue
View file @
9cb0ec1
...
@@ -26,17 +26,13 @@ export default {
...
@@ -26,17 +26,13 @@ export default {
type
:
String
,
type
:
String
,
default
:
'12.7vh'
default
:
'12.7vh'
},
},
width
:
{
type
:
String
,
default
:
'7.2vw'
},
list
:
{
list
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
},
radius
:
{
radius
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[
'55%'
,
'7
2
%'
]
default
:
()
=>
[
'55%'
,
'7
5
%'
]
},
},
colors
:
{
colors
:
{
type
:
Array
,
type
:
Array
,
...
@@ -63,13 +59,13 @@ export default {
...
@@ -63,13 +59,13 @@ export default {
this
.
initData
()
this
.
initData
()
this
.
draw
()
this
.
draw
()
},
},
immediate
:
tru
e
immediate
:
fals
e
}
}
},
},
mounted
()
{
mounted
()
{
//
this.initData()
this
.
initData
()
//
this.draw()
this
.
draw
()
},
},
methods
:
{
methods
:
{
...
@@ -216,13 +212,18 @@ export default {
...
@@ -216,13 +212,18 @@ export default {
.pie-box
{
.pie-box
{
background
:
#262525
;
background
:
#262525
;
position
:
relative
;
position
:
relative
;
.center-content
{
flex
:
1
;
.center-content
{
position
:
absolute
;
position
:
absolute
;
top
:
50%
;
top
:
50%
;
left
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
transform
:
translate
(
-50%
,
-50%
);
text-align
:
center
;
text-align
:
center
;
max-width
:
40%
;
&-num
{
&-num
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
font-size
:
0.8vw
;
font-size
:
0.8vw
;
color
:
#fff
;
color
:
#fff
;
--step
:
0
;
--step
:
0
;
...
@@ -234,8 +235,10 @@ export default {
...
@@ -234,8 +235,10 @@ export default {
}
}
}
}
&
-desc
{
&
-desc
{
font-size
:
0.
4
vw
;
font-size
:
0.
5
vw
;
color
:
#606266
;
color
:
#606266
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
white-space
:
nowrap
;
animation
:
rotateIn
2s
infinite
;
animation
:
rotateIn
2s
infinite
;
}
}
...
...
src/mixins/clientMixin.js
View file @
9cb0ec1
...
@@ -3,6 +3,7 @@ export default {
...
@@ -3,6 +3,7 @@ export default {
return
{
return
{
now
:
new
Date
().
format
(
'yyyy-MM-dd'
),
now
:
new
Date
().
format
(
'yyyy-MM-dd'
),
clientData
:
[],
clientData
:
[],
brandList
:
[],
distributionRank
:
''
distributionRank
:
''
}
}
},
},
...
@@ -29,9 +30,7 @@ export default {
...
@@ -29,9 +30,7 @@ export default {
value
:
distribution
[
item
]
value
:
distribution
[
item
]
})
})
})
})
console
.
log
(
res
.
data
.
dataList
[
0
].
distributionRank
)
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
// console.log(this.distributionRank,'this.distributionRank')
})
})
}
}
}
}
...
...
src/mixins/index.js
View file @
9cb0ec1
import
changeMixin
from
'./changeMixin'
import
changeMixin
from
'./changeMixin'
import
clientMixin
from
'./clientMixin'
import
clientMixin
from
'./clientMixin'
import
salesMixin
from
'./salesMixin'
export
{
export
{
changeMixin
,
changeMixin
,
clientMixin
clientMixin
,
salesMixin
}
}
\ No newline at end of file
\ No newline at end of file
src/mixins/salesMixin.js
0 → 100644
View file @
9cb0ec1
export
default
{
data
()
{
return
{
now
:
new
Date
().
format
(
'yyyy-MM-dd'
),
salesData
:
[]
}
},
created
()
{
this
.
getSalesData
()
},
methods
:
{
getSalesData
()
{
const
params
=
{
req
:
{
corporateGroupName
:
'集团1'
,
queryItem
:
this
.
type
,
// queryTime: this.now,
queryTime
:
'2022-06-23'
,
queryType
:
0
}
}
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')
})
}
}
}
src/views/afterSales/analyze.vue
View file @
9cb0ec1
...
@@ -12,7 +12,9 @@
...
@@ -12,7 +12,9 @@
<div
class=
"content-left bg"
>
<div
class=
"content-left bg"
>
<div
id=
"analyzeBar"
style=
"height: 100%"
></div>
<div
id=
"analyzeBar"
style=
"height: 100%"
></div>
</div>
</div>
<div
class=
"contetn-right bg"
>
右边
</div>
<div
class=
"contetn-right bg"
>
<pie-chart
:id=
"chart.id"
:list=
"analyzeData"
:height=
"height - 4.9 + 'vh'"
:radius=
"chart.radius"
@
pieAction=
"pieAction"
></pie-chart>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -26,6 +28,11 @@ export default {
...
@@ -26,6 +28,11 @@ export default {
data
()
{
data
()
{
return
{
return
{
barChart
:
''
,
barChart
:
''
,
chart
:
{
id
:
'analyzePie'
,
radius
:[
'60%'
,
'78%'
]
},
analyzeData
:[],
option
:
{},
option
:
{},
barData
:
[]
barData
:
[]
}
}
...
@@ -129,6 +136,9 @@ export default {
...
@@ -129,6 +136,9 @@ export default {
this
.
getChart
()
this
.
getChart
()
})
})
},
pieAction
(
data
){
}
}
}
}
}
}
...
...
src/views/afterSales/mileage.vue
View file @
9cb0ec1
...
@@ -8,11 +8,73 @@
...
@@ -8,11 +8,73 @@
<
template
>
<
template
>
<div>
<div>
<div
class=
"title"
>
售后车辆里程
</div>
<div
class=
"title"
>
售后车辆里程
</div>
<div
class=
"flex"
>
<pie-chart
:id=
"chart.id"
:list=
"mileageData"
:height=
"height - 4.9 + 'vh'"
:radius=
"chart.radius"
@
pieAction=
"pieAction"
></pie-chart>
<div
class=
"ranking-container"
></div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'Mileage'
name
:
'Mileage'
,
props
:
[
'height'
],
data
()
{
return
{
mileageData
:
[],
distributionRank
:
''
,
rankingData
:
[],
chart
:
{
id
:
'mileagePie'
,
radius
:
[
'60%'
,
'78%'
]
}
}
},
mounted
()
{
this
.
getValueType
()
},
methods
:
{
getValueType
()
{
const
params
=
{
req
:
{
corporateGroupName
:
'集团1'
,
queryItem
:
'mileage'
,
queryTime
:
'2022-06-23'
,
queryType
:
0
}
}
this
.
api
.
afterSales
.
aftersaleother
(
params
).
then
(
res
=>
{
let
distribution
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
const
keys
=
Object
.
keys
(
distribution
)
keys
.
forEach
((
item
,
index
)
=>
{
this
.
mileageData
.
push
({
name
:
item
,
value
:
distribution
[
item
]
})
})
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
console
.
log
(
this
.
distributionRank
,
'mileage'
)
})
},
pieAction
(
data
)
{
let
distributionRank
=
this
.
distributionRank
[
data
.
name
]
for
(
const
key
in
distributionRank
)
{
this
.
rankingData
.
push
({
brand
:
key
,
value
:
distributionRank
[
key
]
})
}
console
.
log
(
this
.
rankingData
,
'================'
)
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
.ranking-container
{
margin-left
:
0.6vw
;
box-sizing
:
border-box
;
height
:
21.5vh
;
width
:
10.8vw
;
background
:
#262525
;
}
</
style
>
src/views/customer/age.vue
View file @
9cb0ec1
...
@@ -26,7 +26,6 @@ export default {
...
@@ -26,7 +26,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
type
:
'age'
,
type
:
'age'
,
brandList
:[],
chart
:
{
chart
:
{
id
:
'age-pie'
id
:
'age-pie'
}
}
...
...
src/views/customer/buyCar.vue
View file @
9cb0ec1
...
@@ -26,7 +26,6 @@ export default {
...
@@ -26,7 +26,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
type
:
'buycarRange'
,
type
:
'buycarRange'
,
brandList
:
[],
chart
:
{
chart
:
{
id
:
'car-pie'
id
:
'car-pie'
}
}
...
...
src/views/salesData/enterCategory.vue
View file @
9cb0ec1
...
@@ -11,22 +11,29 @@
...
@@ -11,22 +11,29 @@
<span
class=
"icon"
></span>
<span
class=
"icon"
></span>
<span>
进店类型
</span>
<span>
进店类型
</span>
</div>
</div>
<div
class=
"container flex"
>
<div
class=
"container flex"
>
<pie-chart
:id=
"chart.id"
></pie-chart>
<pie-chart
:id=
"chart.id"
:list=
"salesData"
@
pieAction=
"pieAction"
></pie-chart>
<ran-king></ran-king>
<ran-king
:list=
"brandList"
></ran-king>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
salesMixin
}
from
'../../mixins/index'
export
default
{
export
default
{
name
:
'EnterCategory'
,
name
:
'EnterCategory'
,
data
()
{
mixins
:
[
salesMixin
],
data
()
{
return
{
return
{
type
:
'entertype'
,
brandList
:
[],
chart
:
{
chart
:
{
id
:
'enterCategory-pie'
id
:
'enterCategory-pie'
}
}
}
}
},
methods
:
{
pieAction
(
data
)
{}
}
}
}
}
</
script
>
</
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