Commit 3d24f49e by 李伟康

Merge branch 'dev_v1.0.0' of http://192.168.3.233:8090/gh/data-view into dev_v1.0.0

2 parents 69a7e0f1 4cb04bd9
import Request from './request'
var request = new Request()
const client = {
// 获取品牌年龄/性别/购车年限
overalldistribution: params => {
return request.get('brand/overalldistribution', params)
}
}
export default client
......@@ -7,6 +7,7 @@
*/
import Request from '../request'
const request = new Request()
const getSales = params => {
return request.get('brand/sale', params)
}
......
......@@ -26,17 +26,13 @@ export default {
type: String,
default: '12.7vh'
},
width: {
type: String,
default: '7.2vw'
},
list: {
type: Array,
default: () => []
},
radius: {
type: Array,
default: () => ['55%', '72%']
default: () => ['55%', '75%']
},
colors: {
type: Array,
......@@ -62,7 +58,8 @@ export default {
handler(newVal) {
this.initData()
this.draw()
}
},
immediate:false
}
},
......@@ -215,14 +212,19 @@ export default {
.pie-box {
background: #262525;
position: relative;
flex:1;
.center-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
max-width: 40%;
&-num {
font-size: 0.24vw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.8vw;
color: #fff;
--step: 0;
counter-reset: count var(--step);
......@@ -233,8 +235,10 @@ export default {
}
}
&-desc {
font-size: 0.2vw;
font-size: 0.5vw;
color: #606266;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
animation: rotateIn 2s infinite;
}
......
......@@ -3,6 +3,7 @@ export default {
return {
now: new Date().format('yyyy-MM-dd'),
clientData: [],
brandList: [],
distributionRank: ''
}
},
......@@ -29,9 +30,7 @@ export default {
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')
})
}
}
......
import changeMixin from './changeMixin'
import clientMixin from './clientMixin'
import salesMixin from './salesMixin'
export {
changeMixin,
clientMixin
clientMixin,
salesMixin
}
\ No newline at end of file
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')
})
}
}
}
......@@ -12,7 +12,9 @@
<div class="content-left bg">
<div id="analyzeBar" style="height: 100%"></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>
</template>
......@@ -25,7 +27,14 @@ export default {
props: ['height'],
data() {
return {
yData: datas.Customer.valueType.value.map(item => item.name)
barChart: '',
chart: {
id: 'analyzePie',
radius:['60%', '78%']
},
analyzeData:[],
option: {},
barData: []
}
},
mounted() {
......@@ -98,7 +107,32 @@ export default {
}
]
}
option && myChart.setOption(option)
this.barChart.setOption(this.option)
},
getValueType() {
const params = {
req: {
corporateGroupName: '集团1',
queryItem: 'valueanalyse',
queryTime: '2022-06-23',
queryType: 0
}
}
this.api.afterSales.aftersaleother(params).then(res => {
console.log(res)
const reqData = JSON.parse(res.data.dataList[0].distribution)
console.log(reqData)
this.barData = []
for (let i in reqData) {
this.barData.push(reqData[i])
}
console.log(this.barData)
this.getChart()
})
},
pieAction(data){
}
}
}
......
......@@ -8,11 +8,73 @@
<template>
<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>
</template>
<script>
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>
<style lang="scss" scoped>
.ranking-container {
margin-left: 0.6vw;
box-sizing: border-box;
height: 21.5vh;
width:10.8vw;
background: #262525;
}
</style>
......@@ -26,7 +26,6 @@ export default {
data() {
return {
type:'age',
brandList:[],
chart: {
id: 'age-pie'
}
......
......@@ -26,7 +26,6 @@ export default {
data() {
return {
type: 'buycarRange',
brandList: [],
chart: {
id: 'car-pie'
}
......
......@@ -11,22 +11,29 @@
<span class="icon"></span>
<span>进店类型</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id"></pie-chart>
<ran-king></ran-king>
<div class="container flex">
<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: 'EnterCategory',
data() {
mixins: [salesMixin],
data() {
return {
type: 'entertype',
brandList: [],
chart: {
id: 'enterCategory-pie'
}
}
},
methods: {
pieAction(data) {}
}
}
</script>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!