Store.vue
1.06 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
<!--
* @Description:
* @Author: huyue
* @Date: 2023-08-16 14:35:35
* @LastEditors: huyue
* @LastEditTime: 2023-08-22 10:56:30
-->
<template>
<div>
<div class="title title-icon">
<span class="icon"></span>
<span class="title-bg">门店类型</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id" :list="storeData" :keys="chart.keys" :formatter="chart.formatter" :colors="chart.colors"></pie-chart>
<OperationaLegend :list="storeData" :colors="chart.colors"></OperationaLegend>
</div>
</div>
</template>
<script>
import OperationaLegend from './OperationaLegend.vue'
export default {
name: 'Store',
components: {
OperationaLegend
},
data() {
return {
chart: {
id: 'store',
keys: ['name', 'num'],
colors: ['#34AFFF', '#16E193', '#FDF006', '#EB6001'],
formatter: 'rate'
},
storeData: []
}
},
created() {
this.$bus.$on('clientData', data => {
this.storeData = data.storeData
})
}
}
</script>