Commit 594189a8 by 匡雅琴

内部数据

1 parent 43d0c6ec
......@@ -6,15 +6,23 @@
* @LastEditTime: 2023-08-22 17:31:50
-->
<template>
<div>
内部数据
<Charts></Charts>
<div class="view-content">
<div class="content">
<InternalLeft></InternalLeft>
<InternalRight></InternalRight>
</div>
</div>
</template>
<script>
import InternalLeft from "../../internal/InternalLeft.vue"
import InternalRight from "../../internal/InternalRight.vue"
export default {
name: 'ViewInterior',
components: {
InternalLeft,
InternalRight
},
data() {
return {}
},
......@@ -25,5 +33,19 @@ export default {
</script>
<style lang="scss" scoped>
.view-content {
width: 100%;
height: 100%;
box-sizing: border-box;
position: relative;
padding: 1.78vh 24px;
gap: 0 16px;
}
.content {
display: flex;
justify-content: space-between;
// padding: 1.78vh 0 0;
// margin-top: 1.78vh;
}
</style>
<template>
<div class="left">
<div class="left-top">
<CoreIndex></CoreIndex>
<DigitalLink></DigitalLink>
</div>
<DigitalMarketing></DigitalMarketing>
</div>
</template>
<script>
import DigitalLink from './components/DigitalLink.vue'
import DigitalMarketing from './components/DigitalMarketing.vue'
import CoreIndex from './components/CoreIndex.vue'
export default {
name: 'InternalLeft',
components: {
DigitalLink,
DigitalMarketing,
CoreIndex
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.left {
width: 47.78vw;
&-top {
display: flex;
justify-content: space-between;
margin-bottom: 1.78vh;
}
}
</style>
<template>
<div class="right">
<box-title title="数字化管理"></box-title>
<Tab class="tab" :list="tabList" :width="25.5" :itemWidth="9" @changeTab="changeTab"></Tab>
<div class="digital-manager-box-content">
<StatisticsBox :list="digitalMarketingList"></StatisticsBox>
</div>
</div>
</template>
<script>
export default {
name: 'InternalRight',
data() {
return {
tabList: ['线索服务', '会员权益', '车管(虎哥E盾)'],
activeName: 0,
digitalMarketingList: [
{
name: '注册门店总数',
valueName: 'count',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
},
{
name: '活跃门店总数',
valueName: 'countvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
},
{
name: '设备订阅数量总数',
valueName: 'count',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
},
{
name: '总收入',
valueName: 'countvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
}
]
}
},
mounted() {},
methods: {
changeTab(data) {
this.activeName = data
}
}
}
</script>
<style lang="scss" scoped>
.right {
width: 47.48vw;
height: 89.33vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
/deep/.tab-item-box {
margin: 0 auto;
}
.digital-manager-box-content {
padding: 1.56vh 0.83vw;
}
}
</style>
<!--
* @Description: 柱状图
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-08-03 16:43:09
-->
<template>
<div>
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</div>
</template>
<script type="text/ecmascript-6">
import * as echarts from 'echarts'
import BarOptions from './BarOption'
import utils from '../../../utils/util'
export default {
name: 'BarChart',
props: {
domId: {
type: String,
default: ''
},
dataList: {
type: Array,
default: () => []
},
tooltipFormatterObj: {
type: Object,
default: () => {
return {
label: '数量',
attrName: 'num'
}
}
},
colorList: {
type: Array
},
height: {
type: String,
default: '15vh'
},
barWidth: String,
isMultiple: {
type: Boolean,
default: false
},
formatYAxis: Boolean
},
data() {
return {
barOptions: []
}
},
created() {
this.barOptions = BarOptions({ tooltipFormatter: this.tooltipFormatter }, this.colorList, this.isMultiple, this.barWidth, this.formatYAxis)
},
mounted() {
this.barDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barDom)
this.chartBindEvent()
},
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
},
drawBar() {
this.barOptions.xAxis.data = this.dataList.map(item => item.statMonth)
this.barOptions.series[0].data = this.dataList.map(item => item[this.tooltipFormatterObj.attrName])
this[this.domId].setOption(this.barOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
/*
* @Description: 柱状图配置
* @Author: huyue
* @Date: 2023-07-07 14:04:52
* @LastEditors: huyue
* @LastEditTime: 2023-08-03 16:42:12
*/
import * as echarts from 'echarts'
function getBarOptions(obj, colorList, isMultiple, barwidth, formatYAxis) {
const barWidth = barwidth || '14'
const multiple = isMultiple || false
const { tooltipFormatter } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
padding: 0,
formatter: tooltipFormatter || '',
confine: true
},
xAxis: {
data: []
},
barWidth: barWidth,
yAxis: {
name: '',
type: 'value',
// min: 0,
// max: 100,
splitLine: {
lineStyle: {
color: '#1d2a38'
}
},
splitNumber: 4,
axisLabel: {
// 这种做法就是在y轴的数据的值旁边拼接单位,貌似也挺方便的
formatter: function(value) {
if (formatYAxis) {
return `${value / 10000}万`
} else {
return value
}
}
}
},
grid: {
left: '0',
right: '4%',
top: '20%',
bottom: '4%',
containLabel: true
},
series: [
{
name: 'bar',
type: 'bar',
data: [],
label: {
show: false
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
var colorItem = []
if (multiple) {
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: multiple ? colorItem[0] : colorList[0]
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: multiple ? colorItem[1] : colorList[1]
},
{
offset: 1, // 指100%处的颜色
color: multiple ? colorItem[2] : colorList[2]
}]
)
}
}
}
]
}
return barLineOption
}
export default getBarOptions
<template>
<div class="core-box">
<box-title title="核心指标"></box-title>
<div class="core-box-content">
<StatisticsBox :list="coreIndexList"></StatisticsBox>
<PullDownSelect :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<inner-tab class="tab-box" :list="tabList" :width="18.3" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<BarChart ref="coreChartRef" domId="coreChart" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
</div>
</div>
</template>
<script>
import PullDownSelect from './PullDownSelect.vue'
import BarChart from './BarChart.vue'
export default {
name: 'CoreIndex',
components: {
PullDownSelect,
BarChart
},
data() {
return {
tabList: ['SaaS+门店总数', '有成交门店数', '活跃门店数'],
coreIndexList: [
{
name: '门店总数',
valueName: 'count',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
},
{
name: '留存门店总数',
valueName: 'countvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
}
],
selectList: [
{
name: '门店活跃统计',
val: 'num'
},
{
name: 'Saas门店留存率',
val: 'merNum'
}
],
selectType: '',
dataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 400
},
{
statMonth: '2023',
actiNum: 400
}
],
colorList: ['#22D8FF', '#223FA9', '#061422'],
tooltips: {
label: '场次',
attrName: 'actiNum'
}
}
},
mounted() {
this.$refs.coreChartRef.drawBar()
},
methods: {
selectVal(val) {
this.selectType = val
},
// tab切换
changeTab(val) {
// switch (val) {
// case 0:
// this.paymentData = this.dataList.totalData
// break
// case 1:
// this.paymentData = this.dataList.inProgress
// break
// case 2:
// this.paymentData = this.dataList.completed
// break
// }
}
}
}
</script>
<style lang="scss" scoped>
.core-box {
width: 23.33vw;
height: 40vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
&-content {
padding: 1.56vh 0.83vw;
}
}
</style>
<template>
<div class="link-box">
<box-title title="数字化链接"></box-title>
<div class="link-box-content">
<StatisticsBox :list="digitalLinkList"></StatisticsBox>
</div>
<PullDownSelect :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
</div>
</template>
<script>
import PullDownSelect from './PullDownSelect.vue'
export default {
name: 'DigitalLink',
components: {
PullDownSelect
},
data() {
return {
digitalLinkList: [
{
name: '成品激活设备总数',
valueName: 'count',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
},
{
name: '半成品激活设备总数',
valueName: 'countvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
}
],
selectList: [
{
name: '成品设备激活趋势',
val: 'num'
},
{
name: '半成品发货趋势',
val: 'merNum'
}
],
selectType: ''
}
},
mounted() {},
methods: {
selectVal(val) {
this.selectType = val
}
}
}
</script>
<style lang="scss" scoped>
.link-box {
width: 23.33vw;
height: 40vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
&-content {
padding: 1.56vh 0.83vw;
}
}
</style>
<template>
<div class="digital-marketing-box">
<box-title title="数字化营销"></box-title>
<Tab class="tab" :list="tabList" :width="15.9" :itemWidth="7.92" @changeTab="changeTab"></Tab>
<div class="digital-marketing-box-content">
<StatisticsBox :list="digitalMarketingList"></StatisticsBox>
<div class="digital-marketing-box-content-bottom">
<DigitalMarketingLeft></DigitalMarketingLeft>
<DigitalMarketingRight></DigitalMarketingRight>
</div>
</div>
</div>
</template>
<script>
import DigitalMarketingLeft from './DigitalMarketingLeft.vue'
import DigitalMarketingRight from './DigitalMarketingRight.vue'
export default {
name: 'DigitalMarketing',
components: {
DigitalMarketingLeft,
DigitalMarketingRight
},
data() {
return {
tabList: ['1.1精品升级', '1.3售后众筹'],
activeName: 0,
digitalMarketingList: [
{
name: '注册门店总数',
valueName: 'count',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
},
{
name: '活跃门店总数',
valueName: 'countvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
},
{
name: '订单总数',
valueName: 'count',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
},
{
name: '总产值',
valueName: 'countvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
}
]
}
},
mounted() {},
methods: {
changeTab(data) {
this.activeName = data
}
}
}
</script>
<style lang="scss" scoped>
.digital-marketing-box {
height: 47.56vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
/deep/.tab-item-box {
margin: 0 auto;
}
&-content {
padding: 1.56vh 0.83vw;
&-bottom {
display: flex;
justify-content: space-between;
}
}
}
</style>
<template>
<div class="marketing-left">
<PullDownSelect :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<BarChart ref="trendChartRef" domId="trendChart" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
import PullDownSelect from './PullDownSelect.vue'
export default {
name: 'DigitalMarketingLeft',
components: {
PullDownSelect,
BarChart
},
data() {
return {
selectList: [
{
name: '注册门店趋势',
val: 'num'
},
{
name: '活跃门店趋势',
val: 'merNum'
},
{
name: '月订单量与收入趋势',
val: 'trend'
}
],
selectType: '',
dataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 400
},
{
statMonth: '2023',
actiNum: 400
}
],
colorList: ['#2AD191', '#00A89E', '#061422'],
tooltips: {
label: '场次',
attrName: 'actiNum'
}
}
},
mounted() {
this.$refs.trendChartRef.drawBar()
},
methods: {
selectVal(val) {
this.selectType = val
}
}
}
</script>
<style lang="scss" scoped>
.marketing-left {
width: 22.78vw;
height: 25.33vh;
}
</style>
<template>
<div class="marketing-right">
<PullDownSelect :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<BarChart ref="merchantChartRef" domId="merchantChart" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
</div>
</template>
<script>
import PullDownSelect from './PullDownSelect.vue'
import BarChart from './BarChart.vue'
export default {
name: 'DigitalMarketingRight',
components: {
PullDownSelect,
BarChart
},
data() {
return {
selectList: [
{
name: '门店订单金额分布',
val: 'num'
},
{
name: '门店订单量分布',
val: 'merNum'
}
],
selectType: '',
dataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 400
},
{
statMonth: '2023',
actiNum: 400
}
],
colorList: ['#22D8FF', '#223FA9', '#061422'],
tooltips: {
label: '场次',
attrName: 'actiNum'
}
}
},
mounted() {
this.$refs.merchantChartRef.drawBar()
},
methods: {
selectVal(val) {
this.selectType = val
}
}
}
</script>
<style lang="scss" scoped>
.marketing-right {
width: 22.78vw;
height: 25.33vh;
}
</style>
<template>
<div class="down-select">
<div class="type-plugin">
<div class="trend-type-box" @click.stop="switchType">
<div class="text">{{ selectType || selectList[0].name }}</div>
<div class="trangle-icon"></div>
</div>
<SelectBox
:isShow="isShow"
isObject
:defaultValue.sync="selectList[0]"
@clickOutside="clickOutside"
:dataList.sync="selectList"
:boxWidth="boxWidth"
@selectVal="selectVal"
:labelName="'name'"
:valueName="'name'"
></SelectBox>
</div>
</div>
</template>
<script>
export default {
name: 'PullDownSelect',
props: {
selectList: {
type: Array,
default: () => []
},
boxWidth: {
type: String,
default: '9.1vw'
}
},
data() {
return {
isShow: false
}
},
mounted() {},
methods: {
switchType() {
this.isShow = !this.isShow
},
clickOutside() {
this.isShow = false
},
selectVal(val) {
// this.selectType = val.name
this.$emit('selectVal', val.name)
this.switchType()
}
}
}
</script>
<style lang="scss" scoped>
.down-select {
.type-plugin {
position: relative;
}
.trend-type-box {
display: flex;
width: fit-content;
height: 2.22vh;
line-height: 2.22vh;
padding: 0 0.83vw;
box-sizing: border-box;
background-image: linear-gradient(269deg, #5663ff00 10%, #6578ffd4 49%, #079FF1 100%);
.text {
font-weight: 500;
font-size: 14px;
color: #ffffff;
margin-right: 0.83vw;
}
.trangle-icon {
width: 0px;
height: 0px;
border: 4px solid transparent;
border-top: 4px solid #fff;
margin-top: 6%;
}
}
/deep/.select-box {
top: 2.8vh;
padding: 0.5vw 0;
.select-item {
padding: 0 0.5vw;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!