<template>
  <div><dv-scroll-board :config="jiaoche" style="width:90%;height:300px;text-align: center;margin: 0 auto;" />
  </div>
</template>
<script>
import { jcpmchartInfo } from "../../../servuces/prove";
export default {
  data () {
    return {
      jiaoche: {
        header: ['#', '店面', '销售顾问', '集客数量', '订单数量', '成交率'],
        data: [],
        rowNum: 7,
        headerBGC: '#050E18',
        oddRowBGC: 'rgb(20,42,64)',
        evenRowBGC: 'rgb(9,25,44)',
        align: 'center'
      }
    }
  },
  mounted () {
    this.jcpmchartapi()
  },
  methods: {
    jcpmchartapi () {
      jcpmchartInfo().then(res => {
        console.log('交车排名', res);
        const keyindex = {
          'pm': 0,
          'company': 1,
          'xsgw': 2,
          'jksl': 3,
          'ddsl': 4,
          'cjl': 5
        }

        let item_values = []
        res.data.map(obj => {
          let item_value = []
          for (let key in obj) {
            let index = keyindex[key]
            item_value[index] = obj[key] + ''
          }
          item_values.push(item_value)
        })
        this.jiaoche.data = item_values
        this.jiaoche = { ...this.jiaoche }
      })
    }
  }
}
</script>