ActivityTrends.vue
1.78 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
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-03 15:31:53
* @LastEditors: huyue
* @LastEditTime: 2023-08-03 16:43:18
-->
<!-- 近一年活动场次趋势图 -->
<template>
<div class="activity-box">
<box-title title="近一年活动场次趋势图"></box-title>
<BarChart
v-if="!isEmpty"
ref="activityTrendChartRef"
class="bar-chart"
isMultiple
:barWidth="'24'"
domId="activityTrendChart"
height="26.22vh"
:dataList.sync="dataList"
:colorList="colorList"
:tooltipFormatterObj="tooltips.amountTooltip"
></BarChart>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
export default {
name: 'ActivityTrends',
components: {
BarChart
},
data() {
return {
isEmpty: false,
dataList: [],
tooltips: {
amountTooltip: {
label: '场次',
attrName: 'actiNum'
}
},
colorList: [
['#2AD191', '#00A89E', '#061422'],
['#22D8FF', '#223FA9', '#061422']
]
}
},
created() {
// this.getActivityTrend()
},
mounted() {
// this.$refs.activityTrendChartRef.drawBar()
this.getActivityTrend()
},
methods: {
async getActivityTrend() {
const _result = await this.api.crowdFunding.getActivityTrend()
const _data = _result.data.dataList
if (!_data.length) {
this.isEmpty = true
return
}
this.dataList = _data
this.$nextTick(() => {
this.$refs.activityTrendChartRef.drawBar()
})
}
}
}
</script>
<style lang="scss" scoped>
.activity-box {
width: 36.94vw;
height: 34vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.bar-chart {
padding-left: 1.39vw;
}
}
</style>