ProductRank.vue 1.54 KB
<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>