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 @@ ...@@ -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)
} }
......
...@@ -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%', '72%'] default: () => ['55%', '75%']
}, },
colors: { colors: {
type: Array, type: Array,
...@@ -62,7 +58,8 @@ export default { ...@@ -62,7 +58,8 @@ export default {
handler(newVal) { handler(newVal) {
this.initData() this.initData()
this.draw() this.draw()
} },
immediate:false
} }
}, },
...@@ -215,14 +212,19 @@ export default { ...@@ -215,14 +212,19 @@ export default {
.pie-box { .pie-box {
background: #262525; background: #262525;
position: relative; position: relative;
flex:1;
.center-content { .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 {
font-size: 0.24vw; overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.8vw;
color: #fff; color: #fff;
--step: 0; --step: 0;
counter-reset: count var(--step); counter-reset: count var(--step);
...@@ -233,8 +235,10 @@ export default { ...@@ -233,8 +235,10 @@ export default {
} }
} }
&-desc { &-desc {
font-size: 0.2vw; font-size: 0.5vw;
color: #606266; color: #606266;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
animation: rotateIn 2s infinite; animation: rotateIn 2s infinite;
} }
......
...@@ -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')
}) })
} }
} }
......
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
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 @@ ...@@ -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>
...@@ -25,7 +27,14 @@ export default { ...@@ -25,7 +27,14 @@ export default {
props: ['height'], props: ['height'],
data() { data() {
return { return {
yData: datas.Customer.valueType.value.map(item => item.name) barChart: '',
chart: {
id: 'analyzePie',
radius:['60%', '78%']
},
analyzeData:[],
option: {},
barData: []
} }
}, },
mounted() { mounted() {
...@@ -98,7 +107,32 @@ export default { ...@@ -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 @@ ...@@ -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>
...@@ -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'
} }
......
...@@ -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'
} }
......
...@@ -12,21 +12,28 @@ ...@@ -12,21 +12,28 @@
<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',
mixins: [salesMixin],
data() { data() {
return { return {
type: 'entertype',
brandList: [],
chart: { chart: {
id: 'enterCategory-pie' id: 'enterCategory-pie'
} }
} }
},
methods: {
pieAction(data) {}
} }
} }
</script> </script>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!