Store.vue 1.06 KB
<!--
 * @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>