<!--
 * @Author: your name
 * @Date: 2021-10-15 11:58:33
 * @LastEditTime: 2021-10-15 15:20:41
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /data-show/src/views/BrandComparison/overallInformation/index.vue
-->
<template>
  <div class="oi-outter" v-loading="load">
    <v-label-div title="整体信息量"></v-label-div>
    <div class="oi-inner">
      <v-echarts :opt="opt"></v-echarts>
    </div>
  </div>
</template>

<script>
import { getContrastCount0528C } from "@/api/ThemeComparison";
import { createSingleColumnar } from "@/utils/gol/singleColumnar";
export default {
  name: "overallInformation",
  data() {
    return {
      load: false,
      form: {
        token: "",
        sGuid: "",
        sTimeType: 3
      },
      opt: {},
    };
  },
  created() {
    this.initData();
  },
  methods: {
    initData() {
      this.form.token = this.getToken;
      let arr = this.getTComparison;
      let sGuid = [];
      arr.forEach((ele) => {
        sGuid.push(ele.guids);
      });
      this.form.sGuid = sGuid.toString();
      this.getData();
    },
    getData() {
      let obj = Object.assign({}, this.form);
      this.load = true;
      getContrastCount0528C(obj).then((res) => {
        let data = res.data || [];
        let brandsList = [];
        let infoList = [];
        data.forEach((e) => {
          brandsList.push(e.key);
          infoList.push(e.value);
        });
        this.opt = createSingleColumnar(brandsList, infoList,'#3373CC',10);
        this.load = false;
      });
    },
  },
};
</script>

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