You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.1 KiB

<!--
* @Author: your name
* @Date: 2021-10-25 11:34:57
* @LastEditTime: 2021-11-16 13:35:42
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/MarketingAnalysis/brandSalesRankingTOP10Ranking/index.vue
-->
<template>
<div class="bsrt-outter" v-loading="load">
<v-label-div title="品牌销量榜TOP10排行">
</v-label-div>
<div class="bsrt-inner">
<v-echarts :opt="opt" @getData="clickEchars"></v-echarts>
</div>
</div>
</template>
<script>
import { createSingleColumnar } from "@/utils/gol/singleColumnar";
import { getCheZhuBrandMKTCount0528 } from "@/api/MarketingAnalysis";
export default {
name: "brandSalesRankingTOP10Ranking",
data() {
return {
load: false,
form: {
token: ""
},
opt: {}
};
},
created() {
this.form.token = this.getToken;
this.getData();
},
methods: {
// 获取数据
getData() {
this.load = true;
let obj = Object.assign({}, this.getCtime, this.form);
getCheZhuBrandMKTCount0528(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 = createSingleColumnar(dx, ds, '#53bd90')
this.load = false;
});
},
clickEchars(data) {
let ele = data[0];
let brand = ele.axisValueLabel;
this.setHeaderType(3);
this.setBrand({brandname: brand});
this.$router.push("/brandInsight");
}
},
};
</script>
<style lang="less" scoped>
.bsrt-outter {
width: 936px;
height: 480px;
border: 2px solid #0f2a4d;
margin-left: 16px;
.bsrt-inner {
width: 100%;
height: calc(100% - 48px);
}
}
</style>