<template>
  <div><dv-scroll-board :config="baoxian" style="width:85%;height:300px;text-align: center;margin: 0 auto;" />
  </div>
</template>
<script>
import { bxcbhbchartInfo } from "../../../servuces/prove";
export default {
  data () {
    return {
      //保险承保核保
      baoxian: {
        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.bxcbhbchartapi()
  },
  methods: {
    bxcbhbchartapi () {
      bxcbhbchartInfo().then(res => {
        console.log('保险承保核保', res.data);
        const keyindex = {
          'name': 0,
          'first_amount': 1,
          'amount': 2,
          'again_amount': 3,
          'lp_amount': 4,
          'lpbl': 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.baoxian.data = item_values
        console.log(this.baoxian.data);
        this.baoxian = { ...this.baoxian }

      })
    }
  }
}
</script>