ActivityRate.vue
1.37 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
<template>
<div class="rate-box">
<BoxTitle :title="'各活动类型占比'" :fontSize="16"></BoxTitle>
<pie-chart :id="chart.id" :keys="chart.keys" :list="activityListData" :formatter="'total'" :formatterName="'累计营销活动'" :formtUnit="'场'" :height="chart.height" :colors="chart.colors"></pie-chart>
<Legend class="legend" :list="activityListData" :legentList="legentList" :colors="chart.colors"></Legend>
</div>
</template>
<script>
import { activityListData } from "../const/index"
export default {
name: 'ActivityRate',
data() {
return {
chart: {
id: 'shadowPie',
keys: ['isused', 'num'],
height: '17.7vh',
colors: ['#6578FF', '#16E193', '#FFE73C', '#EB6001']
},
activityListData,
legentList: [
{
name: 'isused',
width: '4vw'
},
{
name: 'rate',
type: 'decimal',
width: '2.5vw'
},
{
name: 'num',
width: '2.25vw',
unitIcon: '场'
}
]
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.rate-box {
box-sizing: border-box;
width: 15vw;
height: 34.23vh;
background-image: url(../../../assets/images/rate-bg.png);
background-size: 100% 100%;
padding: 3.61vh 1.59vw 2.69vh 1.04vw;
}
.legend {
margin-top: 2vh;
}
</style>