ProductRank.vue
1.54 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
<template>
<div class='product'>
<div class='title title-icon'>
<span class='icon'></span>
<span>产品排名前10</span>
</div>
<div class='container flex' v-if='productData'>
<pie-chart height='12vh' :id="'glproduct'" :list='productData' :keys='chart.keys'></pie-chart>
<Legend :list='productData' :showName="'product'"></Legend>
<!-- <template v-if="showType=='gl'">-->
<!-- <pie-chart height='12vh' :id="'glproduct'" :list='glProductData' :keys='chart.keys'></pie-chart>-->
<!-- <Legend :list='glProductData' :showName="'product'"></Legend>-->
<!-- </template>-->
<!-- <template v-if="showType=='gh'">-->
<!-- <pie-chart height='12vh' :id="'ghproduct'" :list='ghProductData' :keys='chart.keys'></pie-chart>-->
<!-- <Legend :list='ghProductData' :showName="'product'"></Legend>-->
<!-- </template>-->
</div>
</div>
</template>
<script>
export default {
name: 'ProductRank',
props: {
showType: {
type: String,
default: ''
}
},
data() {
return {
chart: {
id: 'glproduct',
keys: ['product', 'totalNum'],
// colors: ['#4FA0FF', '#7CFFB2', '#FDF006', '#EB6001', '#EB6001']
},
productData: null,
// ghProductData: [],
}
},
mounted() {
this.$bus.$on('productRanking', data => {
this.productData = data.datalist
})
},
methods:{
}
}
</script>
<style scoped lang='scss'>
.product{
background: #0b0e31;
width: 20vw;
height: 21vh;
.container{
margin-top:3vh;
}
}
</style>