ViewIntersts.vue
3.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<template>
<div class="equity-box">
<StatisticsBox :list="digitalequityList"></StatisticsBox>
<div class="equity-statistic-box">
<div class="patch-title title">按年统计客户销售金额分布的合理性</div>
<inner-tab class="inner-tab" :list="tabList" :width="12.4" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<div class="switch-box">
<div class="text">收入占比:64.89%</div>
<PriceSwitch :selectList="priceList" :unit="'万元'"></PriceSwitch>
</div>
<BarChart ref="equityChartRef" domId="equityChart" :height="'24vh'" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
</div>
<div class="income-box">
<div class="patch-title title">月收入趋势</div>
<LineChart ref="equityLineChartRef" domId="equityLineChart" :height="'28vh'" :dataList.sync="lineDataList" :tooltipFormatterObj="tooltips" :valName="tooltips.attrName"></LineChart>
</div>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
import PriceSwitch from './PriceSwitch.vue'
import LineChart from './LineCharts.vue'
import { equityPriceList } from './constant'
export default {
name: 'Viewequity',
components: {
BarChart,
PriceSwitch,
LineChart
},
data() {
return {
digitalequityList: [
{
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: 'countvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValue: '0'
}
],
tabList: ['门店数', '会员人数', '会员人数'],
priceList: equityPriceList,
dataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 400
},
{
statMonth: '2023',
actiNum: 400
}
],
colorList: ['#22D8FF', '#223FA9', '#061422'],
tooltips: {
label: '场次',
attrName: 'actiNum'
},
lineDataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 600
},
{
statMonth: '2023',
actiNum: 800
}
],
}
},
mounted() {
this.$refs.equityChartRef.drawBar()
this.$refs.equityLineChartRef.drawLine()
},
methods: {
changeTab(val) {
console.log(val)
}
}
}
</script>
<style lang="scss" scoped>
.equity-box {
.equity-statistic-box {
height: 32vh;
.inner-tab {
margin: 0.92vh 0;
}
.switch-box {
display: flex;
justify-content: space-between;
.text {
font-weight: 600;
font-size: 10px;
color: #ffffff;
}
}
}
.title {
margin-top: 1.78vh;
}
}
</style>