Commit 14b0c506 by 前端

commit

1 parent d4573a48
<template> <template>
<div class="line-box"> <div class="line-box">
<div :id="domId" class="line-chart"></div> <div :id="domId" class="line-chart"></div>
<div class="rank-box">
<div class="rank-title-block">
<p :class="['rank-title', rankFlag == 'top' ? 'rank-title-active' : '']" @click="handleRankChange('top')">前5{{ storeOrBrandTxt }}</p>
<p :class="['rank-title', rankFlag == 'last' ? 'rank-title-active' : '']" @click="handleRankChange('last')">后5{{ storeOrBrandTxt }}</p>
</div>
<div class="rank-block">
<div class="rank-line" v-for="(item, index) in rankList" :key="index">
<div class="line-item">
<marquee :direction="directionTimer" :delay="delayTimer" :text="item.label"></marquee>
</div>
<div class="line-item">
<marquee class="txt-orange" :direction="directionTimer" :delay="delayTimer" :text="item.value"></marquee>
</div>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -167,7 +150,7 @@ export default { ...@@ -167,7 +150,7 @@ export default {
this.lineOptions.yAxis.scale = true this.lineOptions.yAxis.scale = true
} else { } else {
this.lineOptions.yAxis.max = Math.ceil(Math.max(...seriesDate) / 10) * 10 this.lineOptions.yAxis.max = Math.ceil(Math.max(...seriesDate) / 10) * 10
this.lineOptions.yAxis.min = Math.floor(Math.min(...seriesDate) * 0.9 / 10) * 10 this.lineOptions.yAxis.min = Math.floor((Math.min(...seriesDate) * 0.9) / 10) * 10
} }
this[this.domId].setOption(this.lineOptions) this[this.domId].setOption(this.lineOptions)
// 默认展示tooltip // 默认展示tooltip
......
...@@ -23,7 +23,6 @@ import Area from '../views/customer/area' ...@@ -23,7 +23,6 @@ import Area from '../views/customer/area'
import Store from '../views/customer/store' import Store from '../views/customer/store'
import Brand from '../views/customer/brand' import Brand from '../views/customer/brand'
import OverSize from '../views/saas/overview.vue' import OverSize from '../views/saas/overview.vue'
export default { export default {
name: 'ViewContentLeft', name: 'ViewContentLeft',
components: { components: {
......
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 11:17:49
* @FilePath: \dj-data-view\src\components\ViewSurface.vue
* @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"></div>
</div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -20,7 +26,7 @@ export default { ...@@ -20,7 +26,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.surface { .surface {
height:21.46vh; height: 21.46vh;
margin-bottom:0.98vh; margin-bottom: 0.98vh;
} }
</style> </style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 15:05:23
* @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="line-box">
<div :id="domId" class="line-chart" :style="{ height: boxHeight }"></div>
</div>
</template>
<script>
import datas from '@/utils/data'
import * as echarts from 'echarts'
import { getBarOptions, getBarReverseOptions } from './barOptions'
export default {
name: 'barChart',
props: {
domId: {
type: String,
default: 'line-chart'
},
revese: {
type: Boolean,
default: false
},
boxHeight: {
type: String,
default: '12.83vh'
},
storeOrBrandTxt: {
type: String,
default: '品牌'
},
dataList: {
type: Array,
default: () => []
},
// 0-月表;1-日表
queryType: {
type: Number,
default: 0
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
directionTimer: datas.DefaultData.directionTimer,
delayTimer: datas.DefaultData.delayTimer,
rankFlag: 'top',
lineOptions: [],
rankList: [],
echartsLine: '',
moveAttr: {
// speed: 900,
seriesIndex: 0,
dataIndex: 0
},
timer: null
}
},
created() {
this.lineOptions = this.revese ? getBarReverseOptions() : getBarOptions()
},
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
this.chartBindEvent()
},
methods: {
chartBindEvent() {
this[this.domId].setOption(this.lineOptions)
}
}
}
</script>
<style lang="scss" scoped>
.line-box {
height: 100%;
color: #ffffff;
.txt-orange {
color: #eb6001;
}
.line-chart {
width: 100%;
}
}
</style>
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:46:24
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 15:14:13
* @FilePath: \dj-data-view\src\components\barOptions.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
function getBarOptions(obj) {
var options = {
xAxis: {
type: 'category',
axisLabel: {
color: '#606266',
fontSize: '0.8em',
rotate: 30
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
grid: {
left: '3%',
right: '6%',
top: '6%',
bottom: '0%',
containLabel: true
},
yAxis: {
nameGap: 30,
type: 'value',
splitLine: {
show: false
},
axisLabel: {
show: false
},
splitLine: {
lineStyle: {
color: '#2F314F'
}
},
splitNumber: 4
},
series: [
{
type: 'bar',
symbol: 'circle',
backgroundStyle: {
color: '#6578FF'
},
barWidth: '30%',
data: [120, 200, 150, 80, 70, 110, 130]
}
]
}
return options
}
function getBarReverseOptions(obj) {
var options = {
tooltip: {
trigger: 'axis',
showContent: false,
axisPointer: {
type: 'shadow',
shadowStyle: {
color: 'rgba(210, 210, 210, 0.2)'
}
},
borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)',
confine: true,
textStyle: {
color: '#ffffff',
fontSize: 8
}
},
yAxis: {
type: 'category',
axisLabel: {
color: '#ccc',
fontSize: '0.8em'
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
data: ['一般发展', '一般价值', '一般挽留', '重要挽留', '重要价值', '重要发展', '重要保持', '一般保持']
},
grid: {
left: '15%',
right: '0%',
top: '0%',
bottom: '0%',
containLabel: true
},
xAxis: {
nameGap: 30,
type: 'value',
splitLine: {
show: false
},
axisLabel: {
show: false
},
splitNumber: 4
},
series: [
{
type: 'bar',
symbol: 'circle',
backgroundStyle: {
color: '#6578FF'
},
data: [30, 120, 200, 150, 80, 70, 110, 130]
}
]
}
return options
}
export { getBarReverseOptions, getBarOptions }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: 公共数据 * @Description: 公共数据
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 17:38:33 * @Date: 2022-06-23 17:38:33
* @LastEditors: huyue * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-06-29 19:47:34 * @LastEditTime: 2022-10-25 10:38:15
*/ */
const DefaultData = { const DefaultData = {
defaultLineHeight: '17.32', defaultLineHeight: '17.32',
......
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 15:16:19
* @FilePath: \dj-data-view\src\views\user\analyse.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<div class="analyse"> <div class="analyse">
<div class="title title-icon"> <div class="title title-icon">
<span class="icon"></span> <span class="icon"></span>
<span>门店类型</span> <div class="title-h3">客户价值分析</div>
</div> </div>
<div class="container"> <div class="container">
<bar-chart domId="analyseChart" :revese="true" boxHeight="14.54vh"></bar-chart>
</div> </div>
</div> </div>
</template> </template>
...@@ -15,14 +22,26 @@ ...@@ -15,14 +22,26 @@
export default { export default {
name: 'Analyse', name: 'Analyse',
data() { data() {
return { return {}
}
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.analyse{ .analyse {
width:18.06vw; width: 18.06vw;
.container {
margin-top: -1vh;
}
.icon {
display: inline-block;
transform: rotate(90deg);
}
.title {
display: block;
}
.title-h3 {
width: 10px;
margin: 10px 4px;
}
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 13:49:20
* @FilePath: \dj-data-view\src\views\user\area.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<div class="area"> <div class="area">
<div class="title title-icon"> <div class="title title-icon">
...@@ -6,23 +13,22 @@ ...@@ -6,23 +13,22 @@
<span>区域分布</span> <span>区域分布</span>
</div> </div>
<div class="container"> <div class="container">
<bar-chart domId="areaChart"></bar-chart>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import '../../components'
export default { export default {
name: 'Area', name: 'Area',
data() { data() {
return { return {}
}
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.analyse{ .area {
width:15.42vw; width: 15.42vw;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 13:43:57
* @FilePath: \dj-data-view\src\views\user\brand.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<div class="brand"> <div class="brand">
<div class="title title-icon"> <div class="title title-icon">
...@@ -6,22 +13,21 @@ ...@@ -6,22 +13,21 @@
<span>品牌分布</span> <span>品牌分布</span>
</div> </div>
<div class="container"> <div class="container">
<bar-chart domId="brandChart"></bar-chart>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import '../../components'
export default { export default {
name: 'Brand', name: 'Brand',
data() { data() {
return { return {}
}
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.brand{ .brand {
width:15.42vw; width: 15.42vw;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!