Commit 80a2e260 by 前端

fixed

1 parent 7d1adb73
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 09:43:15
* @FilePath: \dj-data-view\src\api\modules\customer.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 获取企业客户总览数据 // 获取企业客户总览数据
const getEnterpriseOverview = params => { const getEnterpriseOverview = params => {
return window.$HTTP.get('enterpriseCustomer/getEnterpriseOverview', params) return window.$HTTP.get('enterpriseCustomer/getEnterpriseOverview', params)
} }
// 获取门店区域/品牌/类型 // 获取门店区域/品牌/类型
const getEnterpriseDistribution = params => { const getEnterpriseDistribution = params => {
return window.$HTTP.get('enterpriseCustomer/getEnterpriseDistribution', params) return window.$HTTP.get('enterpriseCustomer/getEnterpriseDistribution', params)
} }
// 获取企业客户数据近12个月趋势图(包括:总客户数、新增客户数)
const getEnterpriseOverviewTrend = params => {
return window.$HTTP.get('enterpriseCustomer/getEnterpriseOverviewTrend', params)
}
export default { export default {
getEnterpriseOverview, getEnterpriseOverview,
getEnterpriseDistribution getEnterpriseDistribution,
getEnterpriseOverviewTrend
} }
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 10:20:25
* @FilePath: \dj-data-view\src\api\modules\customer.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 新车洽谈、新车交付、0~12个月、12个月以上(累计展业门店数、当年新增、转化率、客单价、产值)
const getBusinessType = params => {
return window.$HTTP.get('saasValueaddedTransformation/getBusinessType', params)
}
// 已展业省份--区域(省份_地图)分布(参数:新车洽谈/新车交付/0~12个月/12个月以上)
const getDevelopedProvinces = params => {
return window.$HTTP.get('saasValueaddedTransformation/getDevelopedProvinces', params)
}
// 当月进行中门店--区域(省份_地图)分布(参数:新车洽谈/新车交付/0~12个月/12个月以上)
const getMerchantInProgressThisMonth = params => {
return window.$HTTP.get('saasValueaddedTransformation/getMerchantInProgressThisMonth', params)
}
// 当月进行中门店--区域(省份_地图)分布(参数:新车洽谈/新车交付/0~12个月/12个月以上)
const getSaasValueaddedTransformationOverview = params => {
return window.$HTTP.get('/saasValueaddedTransformation/getSaasValueaddedTransformationOverview', params)
}
export default {
getBusinessType,
getDevelopedProvinces,
getMerchantInProgressThisMonth,
getSaasValueaddedTransformationOverview
}
...@@ -2,24 +2,35 @@ ...@@ -2,24 +2,35 @@
* @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 16:28:06 * @LastEditTime: 2022-10-27 10:58:34
* @FilePath: \dj-data-view\src\components\ViewSurface.vue * @FilePath: \dj-data-view\src\components\ViewSurface.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
--> -->
<template> <template>
<div class="surface box"> <div class="surface box">
<line-bar domId="surfaceChart" boxHeight="19.5vh"></line-bar> <line-bar domId="surfaceChart" boxHeight="19.5vh" :dataList="dataList"></line-bar>
</div> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import * as echarts from 'echarts'
export default { export default {
name: 'ViewSurface', name: 'ViewSurface',
data() { data() {
return {} return {
dataList: []
}
}, },
mounted() {}, mounted() {
methods: {} this.getEnterpriseOverviewTrend()
},
methods: {
getEnterpriseOverviewTrend() {
this.api.customer.getEnterpriseOverviewTrend().then(res => {
if(res.code == 0){
this.dataList = res.data.dataList
}
})
}
}
} }
</script> </script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46 * @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-26 16:36:56 * @LastEditTime: 2022-10-27 10:06:49
* @FilePath: \dj-data-view\src\components\barChart.vue * @FilePath: \dj-data-view\src\components\barChart.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
--> -->
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
} }
}, },
created() { created() {
this.lineOptions = lineAndBarOptions() this.lineOptions = lineAndBarOptions(this.dataList)
}, },
mounted() { mounted() {
this.lineDom = document.getElementById(this.domId) this.lineDom = document.getElementById(this.domId)
...@@ -91,9 +91,9 @@ export default { ...@@ -91,9 +91,9 @@ export default {
}, },
methods: { methods: {
chartBindEvent() { chartBindEvent() {
window.addEventListener('resize', () => { // window.addEventListener('resize', () => {
this[this.domId].resize() // this[this.domId].resize()
}) // })
this[this.domId].setOption(this.lineOptions) this[this.domId].setOption(this.lineOptions)
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:46:24 * @Date: 2022-10-25 10:46:24
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-26 13:48:15 * @LastEditTime: 2022-10-27 11:00:22
* @FilePath: \dj-data-view\src\components\barOptions.js * @FilePath: \dj-data-view\src\components\barOptions.js
* @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
*/ */
...@@ -124,6 +124,21 @@ function getBarReverseOptions(obj) { ...@@ -124,6 +124,21 @@ function getBarReverseOptions(obj) {
backgroundStyle: { backgroundStyle: {
color: '#6578FF' color: '#6578FF'
}, },
itemStyle: {
normal: {
label: {
show: true,
position: 'center',
textStyle: {
fontSize: 10,
color: '#fff',
height: 16,
padding: [0, 2, 2, 4],
lineHeight: 16
}
}
}
},
data: [30, 120, 200, 150, 80, 70, 110, 130] data: [30, 120, 200, 150, 80, 70, 110, 130]
} }
] ]
...@@ -140,7 +155,7 @@ function getLineOptions() { ...@@ -140,7 +155,7 @@ function getLineOptions() {
} }
}, },
padding: 5, padding: 5,
borderWidth: 0, borderWidth: 0.5,
backgroundColor: 'rgba(35, 45, 152, 1)', backgroundColor: 'rgba(35, 45, 152, 1)',
borderRadius: 4, borderRadius: 4,
textStyle: { textStyle: {
...@@ -225,7 +240,10 @@ function getLineOptions() { ...@@ -225,7 +240,10 @@ function getLineOptions() {
} }
return options return options
} }
function lineAndBarOptions() { function lineAndBarOptions(list) {
const statDate = list.map(item => item.statDate)
const totalNum = list.map(item => item.totalNum)
const increNum = list.map(item => item.increNum)
var options = { var options = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
...@@ -235,7 +253,7 @@ function lineAndBarOptions() { ...@@ -235,7 +253,7 @@ function lineAndBarOptions() {
} }
}, },
padding: 5, padding: 5,
borderWidth: 0, borderWidth: 0.5,
backgroundColor: 'rgba(35, 45, 152, 1)', backgroundColor: 'rgba(35, 45, 152, 1)',
borderRadius: 4, borderRadius: 4,
textStyle: { textStyle: {
...@@ -261,7 +279,7 @@ function lineAndBarOptions() { ...@@ -261,7 +279,7 @@ function lineAndBarOptions() {
axisLine: { axisLine: {
show: false show: false
}, },
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] data: statDate
}, },
grid: { grid: {
left: '3%', left: '3%',
...@@ -292,7 +310,7 @@ function lineAndBarOptions() { ...@@ -292,7 +310,7 @@ function lineAndBarOptions() {
color: '#6578FF' color: '#6578FF'
}, },
barWidth: '30%', barWidth: '30%',
data: [120, 200, 150, 80, 70, 110, 130, 5, 6, 98, 4, 3, 5, 555] data: increNum
}, },
{ {
type: 'line', type: 'line',
...@@ -323,7 +341,7 @@ function lineAndBarOptions() { ...@@ -323,7 +341,7 @@ function lineAndBarOptions() {
] ]
} }
}, },
data: [666, 200, 150, 80, 70, 110, 130, 554, 3, 44, 33, 5, 666] data: totalNum
} }
] ]
} }
......
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 09:44:37
* @FilePath: \dj-data-view\src\mixins\clientMixin.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export default { export default {
data() { data() {
return { return {
areaData:[], areaData: [],
brandData:[], brandData: [],
storeData:[] storeData: []
} }
}, },
created() { created() {
...@@ -12,14 +20,13 @@ export default { ...@@ -12,14 +20,13 @@ export default {
methods: { methods: {
getClientData() { getClientData() {
this.api.customer.getEnterpriseDistribution().then(res => { this.api.customer.getEnterpriseDistribution().then(res => {
if(res.code == 0){ if (res.code == 0) {
res.data.dataList.forEach(item => { res.data.dataList.forEach(item => {
if(item.queryitem == '区域排名') this.areaData = item.rankDistributions if (item.queryitem == '区域排名') this.areaData = item.rankDistributions
if(item.queryitem == '品牌分布') this.brandData = item.rankDistributions if (item.queryitem == '品牌分布') this.brandData = item.rankDistributions
if(item.queryitem == '门店类型') this.storeData = item.rankDistributions if (item.queryitem == '门店类型') this.storeData = item.rankDistributions
}); })
} }
}) })
} }
} }
......
...@@ -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-26 17:52:31 * @LastEditTime: 2022-10-26 18:08:57
* @FilePath: \dj-data-view\src\views\saas\business.vue * @FilePath: \dj-data-view\src\views\saas\business.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
--> -->
...@@ -38,6 +38,7 @@ export default { ...@@ -38,6 +38,7 @@ export default {
margin-bottom: 0.98vh; margin-bottom: 0.98vh;
.business-data { .business-data {
margin-right: 4px; margin-right: 4px;
margin-top: 2.5vh;
width: 36.11vw; width: 36.11vw;
height: 100%; height: 100%;
} }
......
...@@ -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-26 18:03:58 * @LastEditTime: 2022-10-27 11:09:54
* @FilePath: \dj-data-view\src\views\saas\business.vue * @FilePath: \dj-data-view\src\views\saas\business.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
--> -->
...@@ -41,8 +41,21 @@ export default { ...@@ -41,8 +41,21 @@ export default {
data() { data() {
return {} return {}
}, },
mounted() {}, mounted() {
methods: {} this.getBusinessType()
},
methods: {
toFixNum(val) {
return (val * 100).toFixed(2) + '%'
},
getBusinessType() {
this.api.sass.getBusinessType().then(res => {
if (res.code == 0) {
this.projectList = res.data.dataList
}
})
}
}
} }
</script> </script>
......
...@@ -2,37 +2,37 @@ ...@@ -2,37 +2,37 @@
* @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-26 14:25:05 * @LastEditTime: 2022-10-27 11:09:06
* @FilePath: \dj-data-view\src\views\saas\project.vue * @FilePath: \dj-data-view\src\views\saas\project.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
--> -->
<template> <template>
<div class="project-wrap flex"> <div class="project-wrap flex">
<div class="project-item flex" v-for="(item, index) in 4" :key="index"> <div class="project-item flex" v-for="(item, index) in projectList" :key="index">
<div class="project-left"> <div class="project-left">
<div class="project-title">新车洽谈</div> <div :class="['project-title', { fontSmall: index == 3 }]">{{ item.name }}</div>
<div class="project-icon"><img src="@/assets/images/arrow.png" alt="" /></div> <div class="project-icon"><img src="@/assets/images/arrow.png" alt="" /></div>
</div> </div>
<div class="project-right flex"> <div class="project-right flex">
<div class="project-content-item"> <div class="project-content-item">
<div class="project-content-desc">累计展业门店数</div> <div class="project-content-desc">累计展业门店数</div>
<div class="project-content-num">2,173</div> <div class="project-content-num">{{ item.totalNum }}</div>
</div> </div>
<div class="project-content-item"> <div class="project-content-item">
<div class="project-content-desc">当前新增</div> <div class="project-content-desc">当年新增</div>
<div class="project-content-num">2,173</div> <div class="project-content-num">{{ item.incrNum }}</div>
</div> </div>
<div class="project-content-item"> <div class="project-content-item">
<div class="project-content-desc">转化率</div> <div class="project-content-desc">转化率</div>
<div class="project-content-num">2,173</div> <div class="project-content-num">{{ toFixNum(item.conversionrate) }}</div>
</div> </div>
<div class="project-content-item"> <div class="project-content-item">
<div class="project-content-desc">客单价</div> <div class="project-content-desc">客单价</div>
<div class="project-content-num">2,173</div> <div class="project-content-num">{{ numAddSymbol(item.atv) }}</div>
</div> </div>
<div class="project-content-item"> <div class="project-content-item">
<div class="project-content-desc">产值</div> <div class="project-content-desc">产值</div>
<div class="project-content-num">2,173</div> <div class="project-content-num">{{ numAddSymbol(item.outputValue) }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -45,15 +45,31 @@ import datas from '../../utils/data' ...@@ -45,15 +45,31 @@ import datas from '../../utils/data'
export default { export default {
name: 'Project', name: 'Project',
data() { data() {
return {} return {
projectList: []
}
},
mounted() {
this.getBusinessType()
}, },
mounted() {}, methods: {
methods: {} toFixNum(val) {
return (val * 100).toFixed(2) + '%'
},
getBusinessType() {
this.api.sass.getBusinessType().then(res => {
if (res.code == 0) {
this.projectList = res.data.dataList
}
})
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.project-wrap { .project-wrap {
margin-top: 1.5vh;
height: 11.71vh; height: 11.71vh;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
...@@ -70,6 +86,9 @@ export default { ...@@ -70,6 +86,9 @@ export default {
font-size: 10px; font-size: 10px;
line-height: 12px; line-height: 12px;
margin-top: 0.4vh; margin-top: 0.4vh;
&.fontSmall {
font-size: 9px;
}
} }
.project-icon { .project-icon {
width: 1.25vw; width: 1.25vw;
...@@ -84,16 +103,16 @@ export default { ...@@ -84,16 +103,16 @@ export default {
width: 28%; width: 28%;
} }
&:nth-child(2) { &:nth-child(2) {
width: 18%; width: 14%;
} }
&:nth-child(3) { &:nth-child(3) {
width: 18%; width: 14%;
} }
&:nth-child(4) { &:nth-child(4) {
width: 18%; width: 22%;
} }
&:nth-child(5) { &:nth-child(5) {
width: 18%; width: 22%;
} }
padding-left: 0.5vw; padding-left: 0.5vw;
.project-content-desc { .project-content-desc {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!