<!--
  @description: 报表统计-供应商地区分布TOP
  @Modifier：肖文龙
  @routerPath:
  @date：  2021/01/29
-->
<template>
  <!-- :style="{'height':height}" -->
  <dl
    class="reportChart_crud"
  >
    <dt>
      供应商地区分布TOP10
    </dt>
    <dd>
      <tableChart
        :height="height"
        class="echart-dom"
        :option="option"
      />
    </dd>
  </dl>
</template>

<script>
/* api */
import { getDistributedAreaSupplierList } from '@api/statisticalAnalysis/reportChart.js'
/* 組件 */
import tableChart from './../../components/tableChart'// table列表渲染组件
export default {
  name: 'SupplierRegionTOP',
  components: {
    tableChart// table列表渲染组件
  },
  props: {
    height: {
      type: String,
      default: '100%'
    }
  },
  data() {
    return {
      option: {
      // 标题
        thead: [
          { lable: '地区', prop: 'supplierRegion', align: 'left' },
          { lable: '供应商数量（个）', prop: 'supplierNumbers', align: 'center' }
        ],
        // 渲染数据
        data: []
      }
    }
  },
  methods: {
    /**
     * 获取数据
     *  @param {searchData} Object 查询条件
    */
    initChart(searchData) {
      this.option.data = []
      const data = {
        ...searchData
      }
      getDistributedAreaSupplierList(data).then(res => {
        this.option.data.push(...res.data)
      })
    },
    // 查看
    detail() {

    }
  }
}
</script>
<style lang="less" scoped>
</style>
