<!--
 * @Author: your name
 * @Date: 2021-10-25 11:03:30
 * @LastEditTime: 2021-10-26 10:45:27
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /data-show/src/views/MarketingAnalysis/brandVolumeTOP10/index.vue
-->
<template>
    <div class="bvt-outter" v-loading="load">
        <v-label-div title="品牌声量TOP10">
            <v-btn @click="goPath">营销对比</v-btn>
        </v-label-div>
        <div class="bvt-inner">
            <v-echarts :opt="opt"></v-echarts>
        </div>
    </div>
</template>

<script>
import createOpt from "./opt";
import { getBrandSourceType0528 } from "@/api/MarketingAnalysis";
export default {
    name: "brandVolumeTOP10",
    data() {
        return {
            load: false,
            form: {
                token: ""
            },
            opt: {}
        };
    },
    created() {
        this.form.token = this.getToken;
        this.getData();
    },
    methods: {
        // 获取数据
        getData() {
            let obj = Object.assign({}, this.getCTime, this.form);
            this.load = true;
            getBrandSourceType0528(obj).then((res) => {
                let data = res.data || [];
                let dx = [];
                let ds = [];
                data.forEach(ele => {
                    let key = ele.key;
                    let value = ele.value;
                    dx.push(key);
                    ds.push(value);
                });
                this.opt = createOpt(dx, ds)
                this.load = false;
            });
        },
        goPath() {

        },
    },
};
</script>

<style lang="less" scoped>
.bvt-outter {
    width: 100%;
    height: 472px;
    border: 2px solid #0f2a4d;
    .bvt-inner {
        width: 100%;
        height: calc(100% - 48px);
    }
}
</style>
