Commit 72ab07ba by 前端

fixed

1 parent 8aaf526d
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: 售后数据 * @Description: 售后数据
* @Author: huyue * @Author: huyue
* @Date: 2022-06-28 16:55:48 * @Date: 2022-06-28 16:55:48
* @LastEditors: huyue * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-06-28 19:13:34 * @LastEditTime: 2022-10-27 13:55:36
*/ */
// 私域用户池总览数据 // 私域用户池总览数据
const getoverview = params => { const getoverview = params => {
...@@ -14,6 +14,10 @@ const getoverview = params => { ...@@ -14,6 +14,10 @@ const getoverview = params => {
const getDistribution = params => { const getDistribution = params => {
return window.$HTTP.get('privateDomainUserPool/getDistribution', params) return window.$HTTP.get('privateDomainUserPool/getDistribution', params)
} }
// 用户数、企微客户数、企微群数、小程序、个微客户数 趋势图
const getTrend = params => {
return window.$HTTP.get('privateDomainUserPool/getTrend', params)
}
// // 获取品牌售后其他信息 // // 获取品牌售后其他信息
// const aftersaleother = params => { // const aftersaleother = params => {
...@@ -25,4 +29,4 @@ const getDistribution = params => { ...@@ -25,4 +29,4 @@ const getDistribution = params => {
// return window.$HTTP.get('merchant/aftersaleother', params) // return window.$HTTP.get('merchant/aftersaleother', params)
// } // }
export default { getoverview, getDistribution } export default { getoverview, getDistribution, getTrend }
...@@ -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 10:26:09 * @LastEditTime: 2022-10-27 14:32:16
* @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
--> -->
...@@ -34,9 +34,9 @@ export default { ...@@ -34,9 +34,9 @@ export default {
type: String, type: String,
default: '品牌' default: '品牌'
}, },
dataList: { privateList: {
type: Array, type: Object,
default: () => [] default: () => {}
}, },
// 0-月表;1-日表 // 0-月表;1-日表
queryType: { queryType: {
...@@ -81,13 +81,18 @@ export default { ...@@ -81,13 +81,18 @@ export default {
timer: null timer: null
} }
}, },
created() { watch: {
this.lineOptions = getLineOptions() privateList: {
handler() {
this.lineOptions = getLineOptions(this.privateList)
this.chartBindEvent()
},
deep: true
}
}, },
mounted() { mounted() {
this.lineDom = document.getElementById(this.domId) this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom) this[this.domId] = echarts.init(this.lineDom)
this.chartBindEvent()
}, },
methods: { methods: {
chartBindEvent() { chartBindEvent() {
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-26 10:22:41 * @Date: 2022-10-26 10:22:41
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-26 10:28:12 * @LastEditTime: 2022-10-27 14:30:38
* @FilePath: \dj-data-view\src\components\ViewChart.vue * @FilePath: \dj-data-view\src\components\ViewChart.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="view-chart flex"> <div class="view-chart flex">
<div class="line-chart"> <div class="line-chart">
<line-chart domId="sumChart" boxHeight="17.54vh"></line-chart> <line-chart domId="sumChart" boxHeight="17.54vh" :privateList="privateList"></line-chart>
</div> </div>
<div class="pie-chart"> <div class="pie-chart">
<Age></Age> <Age></Age>
...@@ -36,9 +36,15 @@ export default { ...@@ -36,9 +36,15 @@ export default {
Mileage Mileage
}, },
data() { data() {
return {} return {
privateList: []
}
},
mounted() {
this.$bus.$on('drawPrivateChart', data => {
this.privateList = data
})
}, },
mounted() {},
methods: {} methods: {}
} }
</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:46:24 * @Date: 2022-10-25 10:46:24
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 11:26:55 * @LastEditTime: 2022-10-27 14:31:44
* @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
*/ */
...@@ -145,7 +145,10 @@ function getBarReverseOptions(obj) { ...@@ -145,7 +145,10 @@ function getBarReverseOptions(obj) {
} }
return options return options
} }
function getLineOptions() { function getLineOptions(obj) {
const { dataList, name } = obj
const statDate = dataList.map(item => item.statDate)
const num = dataList.map(item => item.num)
var options = { var options = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
...@@ -163,7 +166,7 @@ function getLineOptions() { ...@@ -163,7 +166,7 @@ function getLineOptions() {
fontSize: 14 fontSize: 14
}, },
formatter: function (item) { formatter: function (item) {
return `用户数:${item[0].value}` return `${name}:${item[0].value}`
} }
}, },
xAxis: { xAxis: {
...@@ -181,13 +184,13 @@ function getLineOptions() { ...@@ -181,13 +184,13 @@ function getLineOptions() {
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: '6%',
right: '6%', right: '6%',
top: '14%', top: '14%',
bottom: '3%', bottom: '1%',
containLabel: true containLabel: true
}, },
yAxis: { yAxis: {
...@@ -234,14 +237,13 @@ function getLineOptions() { ...@@ -234,14 +237,13 @@ function getLineOptions() {
] ]
} }
}, },
data: [666, 200, 150, 80, 70, 110, 130, 554, 3, 44, 33, 5, 666] data: num
} }
] ]
} }
return options return options
} }
function lineAndBarOptions(list) { function lineAndBarOptions(list) {
console.log(list)
const statDate = list.map(item => item.statDate) const statDate = list.map(item => item.statDate)
const totalNum = list.map(item => item.totalNum) const totalNum = list.map(item => item.totalNum)
const increNum = list.map(item => item.increNum) const increNum = list.map(item => item.increNum)
......
...@@ -45,7 +45,6 @@ const decimal = (num, fixed) => { ...@@ -45,7 +45,6 @@ const decimal = (num, fixed) => {
return Math.round(num * pow) / pow return Math.round(num * pow) / pow
} }
const toTop = () => { const toTop = () => {
let bodySrcollTop = document.body.scrollTop let bodySrcollTop = document.body.scrollTop
if (bodySrcollTop !== 0) { if (bodySrcollTop !== 0) {
...@@ -110,7 +109,7 @@ const debounce = function (func, wait = 200) { ...@@ -110,7 +109,7 @@ const debounce = function (func, wait = 200) {
const setChartFontSize = fontSize => { const setChartFontSize = fontSize => {
let clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth let clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
if (!clientWidth) return fontSize if (!clientWidth) return fontSize
return fontSize * clientWidth / 1440 return (fontSize * clientWidth) / 1440
} }
const utils = { const utils = {
getParams, getParams,
......
...@@ -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-27 11:21:13 * @LastEditTime: 2022-10-27 13:33: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
--> -->
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
<div class="business-border"> <div class="business-border">
<div class="business-title">客单价</div> <div class="business-title">客单价</div>
<div class="business-number">{{ businessNum.atv }}</div> <div class="business-number">{{ toFixNum(businessNum.atv) }}</div>
</div> </div>
</div> </div>
<div class="business-bottom flex"> <div class="business-bottom flex">
...@@ -46,6 +46,11 @@ export default { ...@@ -46,6 +46,11 @@ export default {
type: Object, type: Object,
default: {} default: {}
} }
},
methods: {
toFixNum(val) {
return this.numAddSymbol(val.toFixed(2))
}
} }
} }
</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:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 11:09:06 * @LastEditTime: 2022-10-27 13:38:57
* @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
--> -->
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
</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">{{ toFixNum(item.conversionrate) }}</div> <div class="project-content-num">{{ toFixRatio(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">{{ numAddSymbol(item.atv) }}</div> <div class="project-content-num">{{ toFixNum(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>
...@@ -53,9 +53,12 @@ export default { ...@@ -53,9 +53,12 @@ export default {
this.getBusinessType() this.getBusinessType()
}, },
methods: { methods: {
toFixNum(val) { toFixRatio(val) {
return (val * 100).toFixed(2) + '%' return (val * 100).toFixed(2) + '%'
}, },
toFixNum(val) {
return this.numAddSymbol(val.toFixed(2))
},
getBusinessType() { getBusinessType() {
this.api.sass.getBusinessType().then(res => { this.api.sass.getBusinessType().then(res => {
if (res.code == 0) { if (res.code == 0) {
...@@ -100,19 +103,19 @@ export default { ...@@ -100,19 +103,19 @@ export default {
flex: 1; flex: 1;
.project-content-item { .project-content-item {
&:first-child { &:first-child {
width: 28%; width: 27%;
} }
&:nth-child(2) { &:nth-child(2) {
width: 14%; width: 15%;
} }
&:nth-child(3) { &:nth-child(3) {
width: 14%; width: 15%;
} }
&:nth-child(4) { &:nth-child(4) {
width: 22%; width: 15%;
} }
&:nth-child(5) { &:nth-child(5) {
width: 22%; width: 28%;
} }
padding-left: 0.5vw; padding-left: 0.5vw;
.project-content-desc { .project-content-desc {
......
...@@ -35,8 +35,7 @@ module.exports = { ...@@ -35,8 +35,7 @@ module.exports = {
pathRewrite: { pathRewrite: {
'^/dev': '' '^/dev': ''
}, },
onProxyReq: (proxyReq, req, res) => { onProxyReq: (proxyReq, req, res) => {}
}
}, },
'/test': { '/test': {
target: 'http://192.168.3.126:8081', target: 'http://192.168.3.126:8081',
...@@ -45,8 +44,7 @@ module.exports = { ...@@ -45,8 +44,7 @@ module.exports = {
pathRewrite: { pathRewrite: {
'^/test': '' '^/test': ''
}, },
onProxyReq: (proxyReq, req, res) => { onProxyReq: (proxyReq, req, res) => {}
}
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!