Commit 4dfdbed3 by 胡悦

修复企业客户总览

1 parent edadcad0
...@@ -108,7 +108,14 @@ img { ...@@ -108,7 +108,14 @@ img {
user-select: none; user-select: none;
box-sizing: border-box; box-sizing: border-box;
height: 2.07vh; height: 2.07vh;
margin-top: 4px; // margin-top: 4px;
.title-bg {
display: inline-block;
height: 1.71vh;
padding-left: 0.83vw;
transform: rotate(-360deg);
background-image: linear-gradient(90deg, #003F57 0%, #111056 54%, #07173500 100%);
}
} }
.container { .container {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-08-16 16:26:49 * @Date: 2023-08-16 16:26:49
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-08-16 16:26:54 * @LastEditTime: 2023-08-22 10:54:51
--> -->
<template> <template>
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-08-16 14:34:58 * @Date: 2023-08-16 14:34:58
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-08-16 14:35:10 * @LastEditTime: 2023-08-22 10:53:20
--> -->
<template> <template>
<div> <div>
<div class="title title-icon"> <div class="title title-icon">
<span class="icon"></span> <span class="icon"></span>
<span>区域分布</span> <span class="title-bg">区域分布</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="areaData" :keys="chart.keys"></pie-chart> <pie-chart :id="chart.id" :list="areaData" :keys="chart.keys"></pie-chart>
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-08-16 14:35:24 * @Date: 2023-08-16 14:35:24
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-08-16 14:38:45 * @LastEditTime: 2023-08-22 10:56:23
--> -->
<template> <template>
<div> <div>
<div class="title title-icon"> <div class="title title-icon">
<span class="icon"></span> <span class="icon"></span>
<span>品牌分布</span> <span class="title-bg">品牌分布</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="brandData" :keys="chart.keys"></pie-chart> <pie-chart :id="chart.id" :list="brandData" :keys="chart.keys"></pie-chart>
......
...@@ -26,10 +26,6 @@ export default { ...@@ -26,10 +26,6 @@ export default {
type: String, type: String,
default: '品牌' default: '品牌'
}, },
dataList: {
type: Array,
default: () => []
},
// 0-月表;1-日表 // 0-月表;1-日表
queryType: { queryType: {
type: Number, type: Number,
...@@ -73,26 +69,40 @@ export default { ...@@ -73,26 +69,40 @@ export default {
timer: null timer: null
} }
}, },
watch: { // watch: {
dataList: { // dataList: {
handler() { // handler() {
console.log(33333333333); // console.log(33333333333);
this.lineOptions = lineAndBarOptions(this.dataList) // this.lineOptions = lineAndBarOptions(this.dataList)
this.chartBindEvent() // this.chartBindEvent()
}, // },
deep: true // deep: true
} // }
}, // },
mounted() { mounted() {
console.log(888888);
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: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${this.tooltipFormatterObj.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[this.tooltipFormatterObj.attrName])}${this.tooltipFormatterObj.addSymbol || ''}</div></div>`
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
chartBindEvent() { chartBindEvent() {
// window.addEventListener('resize', () => { // resize
// this[this.domId].resize() window.addEventListener('resize', () => {
// }) this[this.domId].resize()
})
},
drawLine(dataList) {
this.lineOptions = lineAndBarOptions(dataList)
this[this.domId].setOption(this.lineOptions) this[this.domId].setOption(this.lineOptions)
} }
} }
......
...@@ -234,6 +234,9 @@ export default { ...@@ -234,6 +234,9 @@ export default {
border-bottom: 1px solid #0a2d26; border-bottom: 1px solid #0a2d26;
height: 4.88vh; height: 4.88vh;
} }
.clew-num {
color: #FF0000;
}
} }
.bg-2 { .bg-2 {
background: #280935; background: #280935;
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 14:35:35
* @LastEditors: huyue
* @LastEditTime: 2023-08-22 10:56:30
-->
<template> <template>
<div> <div>
<div class="title title-icon"> <div class="title title-icon">
<span class="icon"></span> <span class="icon"></span>
<span>门店类型</span> <span class="title-bg">门店类型</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="storeData" :keys="chart.keys"></pie-chart> <pie-chart :id="chart.id" :list="storeData" :keys="chart.keys"></pie-chart>
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 14:46:00
* @LastEditors: huyue
* @LastEditTime: 2023-08-22 10:49:36
-->
<template> <template>
<div class="pie-group"> <div class="pie-group">
<template v-for="(i, index) in items"> <template v-for="(i, index) in items">
...@@ -29,6 +36,8 @@ export default { ...@@ -29,6 +36,8 @@ export default {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 0 8px; gap: 0 8px;
margin: 0 0.83vw;
width: calc(100% - 1.66vw);
.box { .box {
height:13.05vh; height:13.05vh;
} }
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
* @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: huyue * @LastEditors: huyue
* @LastEditTime: 2023-08-16 17:36:08 * @LastEditTime: 2023-08-22 10:17:28
* @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"> <div class="surface">
<LineBar domId="surfaceChart" boxHeight="21.46vh" :dataList="dataList"></LineBar> <LineBar ref="lineBarCharts" domId="surfaceChart" boxHeight="21.46vh" :dataList="dataList"></LineBar>
</div> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import LineBar from './LineChart.vue' import LineBar from './LineBar.vue'
export default { export default {
name: 'ViewSurface', name: 'ViewSurface',
components: { components: {
...@@ -30,8 +30,9 @@ export default { ...@@ -30,8 +30,9 @@ export default {
getEnterpriseOverviewTrend() { getEnterpriseOverviewTrend() {
this.api.operational.getEnterpriseOverviewTrend().then(res => { this.api.operational.getEnterpriseOverviewTrend().then(res => {
if (res.code == 0) { if (res.code == 0) {
console.log(res, '000000000'); console.log(res, '000000000')
this.dataList = res.data.dataList // this.dataList = res.data.dataList
this.$refs.lineBarCharts.drawLine(res.data.dataList)
} }
}) })
} }
......
...@@ -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: huyue * @LastEditors: huyue
* @LastEditTime: 2023-08-16 15:51:58 * @LastEditTime: 2023-08-22 11:21:12
* @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
*/ */
...@@ -300,22 +300,24 @@ function lineAndBarOptions(list) { ...@@ -300,22 +300,24 @@ function lineAndBarOptions(list) {
var options = { var options = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { borderWidth: 0,
lineStyle: { padding: 0,
type: 'solid' // axisPointer: {
} // lineStyle: {
}, // type: 'solid'
padding: 5, // }
borderWidth: 1, // },
backgroundColor: 'rgba(35, 45, 152, 1)', // padding: 5,
borderRadius: 4, // borderWidth: 1,
textStyle: { // backgroundColor: 'rgba(35, 45, 152, 1)',
color: 'rgba(255,255,255,1)', // borderRadius: 4,
fontSize: 10 // textStyle: {
}, // color: 'rgba(255,255,255,1)',
formatter: function (item) { // fontSize: 10
// },
formatter: function(item) {
const items = list[item[0].dataIndex] const items = list[item[0].dataIndex]
return `当月总门店数:${item[0].value}<br>当月新增:${item[1].value}<br>上月总门店数:${items.yesterdaytotalNum}<br>上月月新增:${items.yesterdayincreNum}` return `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;"><div style="display:flex;"><div style="color: #fff">当月总门店数:${item[0].value}<br>当月新增:${item[1].value}<br>上月总门店数:${items.yesterdaytotalNum}<br>上月月新增:${items.yesterdayincreNum}</div></div>`
} }
}, },
xAxis: [ xAxis: [
...@@ -355,8 +357,7 @@ function lineAndBarOptions(list) { ...@@ -355,8 +357,7 @@ function lineAndBarOptions(list) {
} }
}, },
axisLabel: { axisLabel: {
color: '#FFD241', color: '#FFF'
fontSize: '0.8em'
}, },
splitNumber: 4 splitNumber: 4
}, },
...@@ -370,8 +371,7 @@ function lineAndBarOptions(list) { ...@@ -370,8 +371,7 @@ function lineAndBarOptions(list) {
} }
}, },
axisLabel: { axisLabel: {
color: '#769EFF', color: '#FFF'
fontSize: '0.8em'
}, },
splitNumber: 4 splitNumber: 4
} }
...@@ -387,26 +387,6 @@ function lineAndBarOptions(list) { ...@@ -387,26 +387,6 @@ function lineAndBarOptions(list) {
// 平滑曲线 // 平滑曲线
smooth: true, smooth: true,
showSymbol: false, showSymbol: false,
// 折线背景色
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(254, 84, 0, 0.3)'
},
{
offset: 1,
color: 'rgba(254, 84, 0, 0.01)'
}
]
}
},
data: totalNum data: totalNum
}, },
{ {
...@@ -418,7 +398,32 @@ function lineAndBarOptions(list) { ...@@ -418,7 +398,32 @@ function lineAndBarOptions(list) {
}, },
yAxisIndex: 1, yAxisIndex: 1,
barWidth: '30%', barWidth: '30%',
data: increNum data: increNum,
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
const colorList = [
['#2AD191', '#00A89E', '#061422'],
['#22D8FF', '#223FA9', '#061422']
]
var colorItem = []
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorItem[0]
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: colorItem[1]
},
{
offset: 1, // 指100%处的颜色
color: colorItem[2]
}]
)
}
}
} }
] ]
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!