<!--
 * @Author: xw
 * @Date: 2021-10-12 09:03:51
 * @LastEditTime: 2021-10-26 16:10:27
 * @LastEditors: Please set LastEditors
 * @Description: 品牌TOP车型
 * @FilePath: /data-show/src/views/BrandInsight/brandTop/index.vue
-->
<template>
    <div class="bt-outter" v-loading="load">
        <v-label-div title="品牌TOP车型"></v-label-div>
        <div class="bt-inner">
            <v-echarts :opt="opt"></v-echarts>
        </div>
    </div>
</template>

<script>
import {getCartypeTop10} from "@/api/BrandInsight"
import createOpt from "./opt"
export default {
    name: "brand-top",
    props: ["brand"],
    data() {
        return {
            load: false,
            form: {
               token: "",
               sBrand: '奥迪',
            },
            opt: {}
        }
    },
    created() {
        this.form.token = this.getToken;
        this.form.sBrand = this.brand;
        this.getData()
    },
    methods: {
        getData() {
            this.load = true;
            let obj = Object.assign({},this.getCommTime, this.form);
            getCartypeTop10(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>
.bt-outter {
    width: 620px;
    height: 272px;
    border: 2px solid #0f2a4d;
    margin-top: 16px;
    .bt-inner {
        width: 100%;
        height: calc(100% - 48px);
    }
}
</style>
