<!--
 * @Author: your name
 * @Date: 2021-10-12 18:18:20
 * @LastEditTime: 2021-10-27 10:53:04
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /data-show/src/views/BrandInsight/spreadTOPmodels/index.vue
-->
<template>
    <div class="stm-outter" v-loading="load">
        <v-label-div title="传播TOP车型" :showLine="false" :eStyle="{'border-style': 'none'}"></v-label-div>
        <div class="stm-inner">
            <v-echarts :opt="opt"></v-echarts>
        </div>
    </div>
</template>

<script>
import {agetCartypeTop10} from "@/api/BrandInsight"
import createOpt from "./opt"
export default {
    name: "spreadTOPmodels",
    props: ["brand"],
    data() {
        return {
            load: false,
            form: {
               token: "",
               sBrand: '奥迪',
            },
            opt: {}
        }
    },
    created() {
        this.form.token = this.getToken;
        this.form.sBrand = this.getBrand.brandname || this.brand;
        this.getData()
    },
    methods: {
       getData() {
          let obj = Object.assign({},this.getCommTime, this.form); 
          this.load = true;
          agetCartypeTop10(obj).then(res => {
              let data = res.data || {};
              let dx = [];
              let ds = [];
              for(let key in data) {
                  dx.push(key);
                  ds.push(data[key])
              }
              this.opt = createOpt(dx, ds); 
              this.load = false;
          })
       } 
    }
}
</script>
<style lang="less" scoped>
.stm-outter {
    width: 628px;
    height: 412px;
    margin-left: 16px;
    .stm-inner {
        width: 100%;
        height: calc(100% - 48px);
    }
}
</style>
