<template>
  <div><dv-scroll-board :config="chanyetj" style="width:85%;height:300px;text-align: center;margin: 0 auto;" />
  </div>
</template>
<script>
import { cztjchartInfo } from "../../../servuces/prove";
export default {
  data() {
    return {
      //产业统计
      chanyetj: {
        header: ['/', '索赔', '一般维修', '定保', '钣喷', '首保'],
        data: [
          // ['目标', '10', '85', '43', '46', ''],
          // ['完成', '20', '55', '54', '435', ''],
          // ['完成率', '30', '54', '33', '354', ''],
          // ['同比', '40', '24', '54', '34', ''],
          // ['同比', '40', '24', '54', '34', ''],
          // ['同比', '40', '24', '54', '34', ''],
        ],
        rowNum: 7,
        headerBGC: '#050E18',
        oddRowBGC: 'rgb(20,42,64)',
        evenRowBGC: 'rgb(9,25,44)',
        align: 'center'
      },
    }
  },
  mounted() {
    this.cztjchartapi()
  },
  methods: {
    cztjchartapi() {
      cztjchartInfo().then(res => {
        console.log('产值统计', res.data);

        const keyindex = {
          'name': 0,
          'sp': 1,
          'wx': 2,
          'db': 3,
          'bp': 4,
          'sb': 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.chanyetj.data = item_values
        this.chanyetj = { ...this.chanyetj }
      })
    }
  }
}
</script>