Commit a43f8d7d by 前端

fixed

2 parents 0f95dfb6 7a5d7f8d
/*
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:13:34
*/
// 品牌-售后档案客户
const getAfterSale = params => {
return window.$HTTP.get('brand/aftersale', params)
}
// 门店-售后档案客户
const getMerchantAfterSale = params => {
return window.$HTTP.get('merchant/aftersale', params)
}
// 获取品牌售后其他信息
const aftersaleother = params => {
return window.$HTTP.get('brand/aftersaleother', params)
}
// 获取门店品牌售后其他信息
const afterMerchantSaleother = params => {
return window.$HTTP.get('merchant/aftersaleother', params)
}
export default { getAfterSale, aftersaleother, afterMerchantSaleother, getMerchantAfterSale }
...@@ -3,11 +3,11 @@ const getEnterpriseOverview = params => { ...@@ -3,11 +3,11 @@ const getEnterpriseOverview = params => {
return window.$HTTP.get('enterpriseCustomer/getEnterpriseOverview', params) return window.$HTTP.get('enterpriseCustomer/getEnterpriseOverview', params)
} }
// 获取门店年龄/性别/购车年限 // 获取门店区域/品牌/类型
const merchantOveralldistribution = params => { const getEnterpriseDistribution = params => {
return window.$HTTP.get('merchant/overalldistribution', params) return window.$HTTP.get('enterpriseCustomer/getEnterpriseDistribution', params)
} }
export default { export default {
getEnterpriseOverview, getEnterpriseOverview,
merchantOveralldistribution getEnterpriseDistribution
} }
/*
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:13:34
*/
// 私域用户池总览数据
const getoverview = params => {
return window.$HTTP.get('/privateDomainUserPool/getoverview', params)
}
// 客户年龄分布/车价占比/购车年限分布/里程分布
const getDistribution = params => {
return window.$HTTP.get('privateDomainUserPool/getDistribution', params)
}
// // 获取品牌售后其他信息
// const aftersaleother = params => {
// return window.$HTTP.get('brand/aftersaleother', params)
// }
// // 获取门店品牌售后其他信息
// const afterMerchantSaleother = params => {
// return window.$HTTP.get('merchant/aftersaleother', params)
// }
export default { getoverview, getDistribution }
...@@ -126,7 +126,10 @@ img { ...@@ -126,7 +126,10 @@ img {
height: 8.54vh; height: 8.54vh;
margin: 8px 6px 8px 8px; margin: 8px 6px 8px 8px;
} }
.user-container{
height:6.1vh;
margin: 5px 6px 5px 6px;
}
.empty { .empty {
display: flex; display: flex;
width: 100%; width: 100%;
......
<template> <template>
<div class="legend"> <div class="legend">
<div class="legend-item flex" v-for="item in 5"> <div class="legend-item flex" v-for="(item, index) in dataList" :key="index">
<span></span> <span :style="{ background: colors[index] }"></span>
湘 {{ item.name }}
</div> </div>
</div> </div>
</template> </template>
...@@ -10,7 +10,24 @@ ...@@ -10,7 +10,24 @@
export default { export default {
name: 'Legend', name: 'Legend',
data() { data() {
return {} return {
dataList: this.list
}
},
props: {
list: {
type: Array,
default: () => []
},
colors: {
type: Array,
default: () => [' #FF6E76', '#7CFFB2', ' #FDF006', '#4FA0FF', '#EB6001']
}
},
watch: {
list(val) {
this.dataList = val
}
}, },
mounted() {}, mounted() {},
methods: {} methods: {}
...@@ -30,12 +47,11 @@ export default { ...@@ -30,12 +47,11 @@ export default {
height: 2.44vh; height: 2.44vh;
background: #0d133b; background: #0d133b;
align-items: center; align-items: center;
font-size: 9px; font-size: 7px;
color: #fff; color: #fff;
margin: 0 2px 2px 0;
box-sizing: border-box; box-sizing: border-box;
line-height: 2.44vh; margin: 2px 2px 2px 0;
margin: 2px 2px 0 0; white-space: nowrap;
span { span {
width: 5px; width: 5px;
height: 5px; height: 5px;
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
}, },
colors: { colors: {
type: Array, type: Array,
default: () => ['#4FA0FF', '#FF6E76', '#7CFFB2', '#FDF006', '#EB6001', '#F5AA01', '#BF98FF', '#58D9F9'] default: () => [' #FF6E76', '#7CFFB2', ' #FDF006', '#4FA0FF', '#EB6001']
}, },
size: { size: {
type: String, type: String,
...@@ -76,8 +76,8 @@ export default { ...@@ -76,8 +76,8 @@ export default {
}, },
mounted() { mounted() {
// this.initData() this.initData()
// this.draw() this.draw()
}, },
methods: { methods: {
...@@ -91,6 +91,7 @@ export default { ...@@ -91,6 +91,7 @@ export default {
value: item[keys[1]] value: item[keys[1]]
}) })
}) })
console.log(this.viewData)
}, },
draw() { draw() {
if (this.mTime) clearInterval(this.mTime) if (this.mTime) clearInterval(this.mTime)
...@@ -162,8 +163,8 @@ export default { ...@@ -162,8 +163,8 @@ export default {
}, },
// 事件触发 // 事件触发
emitEvent(data) { emitEvent(data) {
this.text = data.name // this.text = data.name
this.subtext = data.value // this.subtext = data.value
this.echartsPie.setOption(this.option) this.echartsPie.setOption(this.option)
this.$emit('pieAction', data) this.$emit('pieAction', data)
}, },
...@@ -184,10 +185,10 @@ export default { ...@@ -184,10 +185,10 @@ export default {
}) })
//高亮项this.currentIndex //高亮项this.currentIndex
this.mainValue = this.option.series[0].data[this.currentIndex].value // this.mainValue = this.option.series[0].data[this.currentIndex].value
this.numDesc = this.option.series[0].data[this.currentIndex].name // this.numDesc = this.option.series[0].data[this.currentIndex].name
this.descColor = this.option.color[this.currentIndex] // this.descColor = this.option.color[this.currentIndex]
this.setAnamiteText() // this.setAnamiteText()
}, },
setAnamiteText() { setAnamiteText() {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;' // document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
......
...@@ -40,7 +40,6 @@ export default { ...@@ -40,7 +40,6 @@ export default {
methods: { methods: {
getEnterpriseOverview() { getEnterpriseOverview() {
this.api.customer.getEnterpriseOverview().then(res => { this.api.customer.getEnterpriseOverview().then(res => {
console.log(res)
if(res.code == 0){ if(res.code == 0){
this.dataList = res.data.dataList[0] this.dataList = res.data.dataList[0]
} }
......
import { changeMixin } from './index'
export default { export default {
data() { data() {
return { return {
clientData: [ areaData:[],
{ value: 1048, name: 'Search Engine' }, brandData:[],
{ value: 735, name: 'Direct' }, storeData:[]
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
],
brandList: [],
distributionRank: '',
isBrand: false,
brandName: ''
} }
}, },
mixins: [changeMixin],
created() { created() {
// this.getClientData() this.getClientData()
}, },
methods: { methods: {
getClientData() { getClientData() {
let clientApi = !this.isBrand ? '' : 'merchantOveralldistribution' this.api.customer.getEnterpriseDistribution().then(res => {
const params = { if(res.code == 0){
req: { res.data.dataList.forEach(item => {
queryItem: this.type, if(item.queryitem == '区域排名') this.areaData = item.rankDistributions
queryTime: this.getCurrentDate() if(item.queryitem == '品牌分布') this.brandData = item.rankDistributions
} if(item.queryitem == '门店类型') this.storeData = item.rankDistributions
} });
if (this.isBrand) params.req.brandName = this.brandName }
this.api.customer[clientApi](params).then(res => {
this.clientData = []
this.brandList = []
this.distributionRank = ''
if (res.data.dataList.length > 0) {
let distribution = JSON.parse(res.data.dataList[0].distribution)
// 删掉“未知”
delete distribution['未知']
let keys = Object.keys(distribution)
let total = Object.values(distribution).reduce((prev, next) => prev + next)
keys.forEach((item, index) => {
this.clientData.push({
name: item,
// value: distribution[item]
value: ((distribution[item] / total) * 100).toFixed(1)
})
})
console.log(this.clientData)
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
}
}) })
},
init(newVal) {
this.isBrand = false
if (newVal.brand) {
this.isBrand = true
this.brandName = newVal.brand.name
}
// this.getClientData()
},
pieAction(data) {
this.brandList = []
let array = this.distributionRank && this.distributionRank[data.name]
if (array && array.length > 0) {
for (let i of array) {
this.brandList.push(i && Object.keys(i)[0])
}
}
} }
} }
} }
import changeMixin from './changeMixin' import changeMixin from './changeMixin'
import clientMixin from './clientMixin' import clientMixin from './clientMixin'
import salesMixin from './salesMixin' import salesMixin from './salesMixin'
import userMixin from './userMixin'
export { export {
changeMixin, changeMixin,
clientMixin, clientMixin,
salesMixin salesMixin,
userMixin
} }
\ No newline at end of file \ No newline at end of file
export default {
data() {
return {
ageData: [],
priceData: [],
buyCarData: [],
mileageData: []
}
},
created() {
this.getDistribution()
},
methods: {
getDistribution() {
this.api.user.getDistribution().then(res => {
console.log(res)
if (res.code == 0) {
res.data.dataList.forEach(item => {
if (item.queryitem == '年龄') this.ageData = item.distribution
if (item.queryitem == '车价') this.priceData = item.distribution
if (item.queryitem == '购车年限') this.buyCarData = item.distribution
if (item.queryitem == '里程') this.mileageData = item.distribution
})
}
})
}
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 15:36:41 * @LastEditTime: 2022-10-26 17:13:06
* @FilePath: \dj-data-view\src\views\customer\area.vue * @FilePath: \dj-data-view\src\views\customer\area.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<span>区域分布</span> <span>区域分布</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart> <pie-chart :id="chart.id" :list="areaData" :keys="chart.keys"></pie-chart>
<Legend></Legend> <Legend :list="areaData"></Legend>
</div> </div>
</div> </div>
</template> </template>
...@@ -28,7 +28,8 @@ export default { ...@@ -28,7 +28,8 @@ export default {
data() { data() {
return { return {
chart: { chart: {
id: 'area' id: 'area',
keys: ['name', 'num']
} }
} }
} }
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<span>品牌分布</span> <span>品牌分布</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart> <pie-chart :id="chart.id" :list="brandData" :keys="chart.keys"></pie-chart>
<Legend></Legend> <Legend :list="brandData"></Legend>
</div> </div>
</div> </div>
</template> </template>
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
type: 'gender', type: 'gender',
chart: { chart: {
id: 'brand', id: 'brand',
colors: ['#EB6001', '#BF98FF', '#FF6E76'] keys: ['name', 'num']
} }
} }
} }
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<span>门店类型</span> <span>门店类型</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart> <pie-chart :id="chart.id" :list="storeData" :keys="chart.keys"></pie-chart>
<Legend></Legend> <Legend :list="storeData" :colors="chart.colors"></Legend>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,9 +18,10 @@ export default { ...@@ -18,9 +18,10 @@ export default {
mixins: [clientMixin], mixins: [clientMixin],
data() { data() {
return { return {
type: 'buycarRange',
chart: { chart: {
id: 'store' id: 'store',
keys: ['name', 'num'],
colors: ['#4FA0FF', '#7CFFB2', '#FDF006', '#EB6001']
} }
} }
} }
......
...@@ -5,29 +5,59 @@ ...@@ -5,29 +5,59 @@
<span class="icon"></span> <span class="icon"></span>
<span>客户年龄分布</span> <span>客户年龄分布</span>
</div> </div>
<!-- <div class="container flex"> <div class="user-container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart> <pie-chart ref="pieChart" :id="chart.id" :list="ageData" :keys="chart.keys" :radius="chart.radius" height="6.1vh" @pieAction="pieAction"></pie-chart>
<Legend></Legend> <div class="legend-item flex">
</div> --> <span :style="{ background: descColor }"></span>
{{ selectData&&selectData.name }}
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import { clientMixin } from '../../mixins/index' import { userMixin } from '../../mixins/index'
export default { export default {
name: 'Age', name: 'Age',
mixins: [clientMixin], mixins: [userMixin],
data() { data() {
return { return {
chart: { chart: {
id: 'user-age', id: 'user-age',
} keys: ['name', 'num'],
radius: ['56%', '85%']
},
selectData: '',
descColor: ''
}
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.title{ .user-box {
font-size: 10px; .title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
} }
</style> </style>
...@@ -5,29 +5,59 @@ ...@@ -5,29 +5,59 @@
<span class="icon"></span> <span class="icon"></span>
<span>购车年限</span> <span>购车年限</span>
</div> </div>
<!-- <div class="container flex"> <div class="user-container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart> <pie-chart @pieAction="pieAction" ref="pieChart" :id="chart.id" :list="buyCarData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<Legend></Legend> <div class="legend-item flex">
</div> --> <span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import { clientMixin } from '../../mixins/index' import { userMixin } from '../../mixins/index'
export default { export default {
name: 'bugCar', name: 'bugCar',
mixins: [clientMixin], mixins: [userMixin],
data() { data() {
return { return {
selectData: '',
descColor: '',
chart: { chart: {
id: 'bugCar', id: 'bugCar',
keys: ['name', 'num'],
radius: ['56%', '85%']
} }
} }
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.title{ .user-box {
font-size: 10px; .title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
} }
</style> </style>
...@@ -5,29 +5,59 @@ ...@@ -5,29 +5,59 @@
<span class="icon"></span> <span class="icon"></span>
<span>里程分布</span> <span>里程分布</span>
</div> </div>
<!-- <div class="container flex"> <div class="user-container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart> <pie-chart @pieAction="pieAction" ref="pieChart" :id="chart.id" :list="mileageData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<Legend></Legend> <div class="legend-item flex">
</div> --> <span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import { clientMixin } from '../../mixins/index' import { userMixin } from '../../mixins/index'
export default { export default {
name: 'Mileage', name: 'Mileage',
mixins: [clientMixin], mixins: [userMixin],
data() { data() {
return { return {
selectData: '',
descColor: '',
chart: { chart: {
id: 'mileage', id: 'mileage',
keys: ['name', 'num'],
radius: ['56%', '85%']
} }
} }
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.title{ .user-box {
font-size: 10px; .title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
} }
</style> </style>
...@@ -5,24 +5,60 @@ ...@@ -5,24 +5,60 @@
<span class="icon"></span> <span class="icon"></span>
<span>车价占比</span> <span>车价占比</span>
</div> </div>
<!-- <div class="container flex"> <div class="user-container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart> <pie-chart @pieAction="pieAction" ref="pieChart" :id="chart.id" :list="priceData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<Legend></Legend> <div class="legend-item flex">
</div> --> <span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import { clientMixin } from '../../mixins/index' import { userMixin } from '../../mixins/index'
export default { export default {
name: 'Price', name: 'Price',
mixins: [clientMixin], mixins: [userMixin],
data() { data() {
return { return {
selectData: '',
descColor: '',
chart: { chart: {
id: 'area', id: 'user-price',
keys: ['name', 'num'],
radius: ['56%', '85%']
} }
} }
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
} }
} }
</script> </script>
<style lang="scss" scoped>
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<template v-for="(tab, index) in userData"> <template v-for="(tab, index) in userData">
<div class="tab-item" :key="index"> <div class="tab-item" :key="index">
<div class="tab-title">{{ tab.text }}</div> <div class="tab-title">{{ tab.text }}</div>
<div class="tab-count text-linear">153</div> <div class="tab-count text-linear">{{dataList[tab.value]}}</div>
<div class="tab-increase flex-between"> <div class="tab-increase flex-between">
<div class="increase-text">当年新增</div> <div class="increase-text">当年新增</div>
<div class="increase-count">24</div> <div class="increase-count">{{dataList[tab.key]}}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -19,34 +19,47 @@ export default { ...@@ -19,34 +19,47 @@ export default {
name: 'UserTab', name: 'UserTab',
data() { data() {
return { return {
dataList: {},
userData: [ userData: [
{ {
text: '用户数', text: '用户数',
value: obj => obj.increnum, value: 'totalnum',
increase: obj => obj.increnum key: 'increnum'
}, },
{ {
text: '企微客户数', text: '企微客户数',
value: obj => obj.totalwechatnum, value: 'totalwechatnum',
increase: obj => obj.increwechatnum key: 'increwechatnum'
}, },
{ {
text: '企微群数', text: '企微群数',
value: obj => obj.totalwechatgroupnum, value: 'totalwechatgroupnum',
increase: obj => obj.increwechatgroupnum key: 'increwechatgroupnum'
}, },
{ {
text: '小程序', text: '小程序',
value: obj => obj.totalappletnum, value: 'totalappletnum',
increase: obj => obj.increappletnum key: 'increappletnum'
}, },
{ {
text: '个微客户数', text: '个微客户数',
value: obj => obj.totalsinglewechantnum, value: 'totalsinglewechantnum',
increase: obj => obj.incresinglewechantnum key: 'incresinglewechantnum'
} }
] ]
} }
},
created() {
this.getoverview()
},
methods: {
getoverview() {
this.api.user.getoverview().then(res => {
if (res.code == 0) {
this.dataList = res.data.dataList[0]
}
})
}
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!