IncreMerchants.vue
1.83 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
<template>
<div class="increMerchants-box">
<box-title title="新增门店数分析"></box-title>
<BarChart
v-if="!isEmpty"
ref="increMerchantsTrendChartRef"
class="bar-chart"
isMultiple
domId="increMerchantsTrendChart"
height="44.89vh"
:dataList.sync="dataList"
:colorList="colorList"
:tooltipFormatterObj="tooltips.amountTooltip"
:barWidth="30"
></BarChart>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</template>
<script>
import { boutiqueMixin } from '@/mixins'
import BarChart from '../../crowdfunding/components/BarChart.vue'
export default {
name: 'IncreMerchants',
mixins: [boutiqueMixin],
components: {
BarChart
},
data() {
return {
isEmpty: false,
dataList: [],
tooltips: {
amountTooltip: {
label: '门店',
attrName: 'incrMer'
}
},
colorList: [
['#2AD191', '#00A89E', '#061422'],
['#22D8FF', '#223FA9', '#061422']
]
}
},
mounted() {},
methods: {
init() {
const { boutique } = this.$store.state.app
const params = {
year: boutique.year,
channelName: boutique.channel.value
}
this.getIncreMerchantTrend(params)
},
async getIncreMerchantTrend(params) {
const _result = await this.api.boutique.getIncreMerchantTrend(params)
const _data = _result.data.dataList
if (!_data.length) {
this.isEmpty = true
return
}
this.dataList = _data
this.$nextTick(() => {
this.$refs.increMerchantsTrendChartRef.drawBar()
})
}
}
}
</script>
<style lang="scss" scoped>
.increMerchants-box {
// width: 36.94vw;
// height: 34vh;
// box-shadow: inset 0 0 20px 0 #3d57ff69;
.bar-chart {
// padding-left: 1.39vw;
}
}
</style>