|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<!--
|
|
|
|
|
* @Author: your name
|
|
|
|
|
* @Date: 2021-11-05 13:18:12
|
|
|
|
|
* @LastEditTime: 2021-11-08 09:27:13
|
|
|
|
|
* @LastEditTime: 2021-11-18 14:51:56
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: In User Settings Edit
|
|
|
|
|
* @FilePath: /data-show/src/views/BrandComparison/brandCompateHeader/index.vue
|
|
|
|
@ -9,6 +9,7 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="bc-d1">
|
|
|
|
|
<v-label-div title="品牌对比">
|
|
|
|
|
<a-button style="margin-right: 1rem" :loading="btnLoading" @click="handlerExport" v-if="getBComparison.length > 0" v-has="'btn_brand_c_toppt'">导出报告</a-button>
|
|
|
|
|
<v-btn @click="goback">返回洞察详情</v-btn>
|
|
|
|
|
</v-label-div>
|
|
|
|
|
<div class="bc-d1-inner">
|
|
|
|
@ -29,6 +30,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getToPptTask } from "@/api/BrandInsight";
|
|
|
|
|
export default {
|
|
|
|
|
name: "brandCompateHeader",
|
|
|
|
|
props: {
|
|
|
|
@ -44,7 +46,10 @@ export default {
|
|
|
|
|
handler(val) {
|
|
|
|
|
if (val.length > 0) {
|
|
|
|
|
val.forEach((ele, index) => {
|
|
|
|
|
this.brands[index] = Object.assign(this.brands[index], ele);
|
|
|
|
|
this.brands[index] = Object.assign(
|
|
|
|
|
this.brands[index],
|
|
|
|
|
ele
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -55,6 +60,7 @@ export default {
|
|
|
|
|
return {
|
|
|
|
|
brandShow: false,
|
|
|
|
|
brandIndex: 0,
|
|
|
|
|
btnLoading: false,
|
|
|
|
|
brands: [
|
|
|
|
|
{
|
|
|
|
|
name: "",
|
|
|
|
@ -81,30 +87,30 @@ export default {
|
|
|
|
|
isDel: false,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
goback() {
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
},
|
|
|
|
|
// 打开品牌选择
|
|
|
|
|
openBrand(n) {
|
|
|
|
|
openBrand(n) {
|
|
|
|
|
this.brandShow = true;
|
|
|
|
|
this.brandIndex = n;
|
|
|
|
|
},
|
|
|
|
|
// 获取选择品牌的数据
|
|
|
|
|
handlerBrand(arr) {
|
|
|
|
|
let name = arr[0].brandname;
|
|
|
|
|
let n = this.brands.findIndex(ele => ele.name === name);
|
|
|
|
|
if(n === -1) {
|
|
|
|
|
let row = this.brands[this.brandIndex];
|
|
|
|
|
row.name = name;
|
|
|
|
|
row.isDel = true;
|
|
|
|
|
let n = this.brands.findIndex((ele) => ele.name === name);
|
|
|
|
|
if (n === -1) {
|
|
|
|
|
let row = this.brands[this.brandIndex];
|
|
|
|
|
row.name = name;
|
|
|
|
|
row.isDel = true;
|
|
|
|
|
}
|
|
|
|
|
let filterArr = this.brands.filter((ele) => {
|
|
|
|
|
return ele.name;
|
|
|
|
|
return ele.name;
|
|
|
|
|
});
|
|
|
|
|
this.$emit('change', filterArr)
|
|
|
|
|
this.$emit("change", filterArr);
|
|
|
|
|
},
|
|
|
|
|
// 删除
|
|
|
|
|
handlerDel(n) {
|
|
|
|
@ -112,12 +118,35 @@ export default {
|
|
|
|
|
row.name = "";
|
|
|
|
|
row.isDel = false;
|
|
|
|
|
let filterArr = this.brands.filter((ele) => {
|
|
|
|
|
return ele.name;
|
|
|
|
|
return ele.name;
|
|
|
|
|
});
|
|
|
|
|
this.$emit('del', n)
|
|
|
|
|
this.$emit('change', filterArr)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$emit("del", n);
|
|
|
|
|
this.$emit("change", filterArr);
|
|
|
|
|
},
|
|
|
|
|
// 导出报告
|
|
|
|
|
handlerExport() {
|
|
|
|
|
this.btnLoading = true;
|
|
|
|
|
let arr = this.getBComparison;
|
|
|
|
|
let brands = [];
|
|
|
|
|
arr.forEach((ele) => {
|
|
|
|
|
brands.push(ele.name);
|
|
|
|
|
});
|
|
|
|
|
let sBrand = brands.toString();
|
|
|
|
|
let obj = Object.assign({}, this.getCtime2, {
|
|
|
|
|
token: this.getToken,
|
|
|
|
|
iContrastType: 1,
|
|
|
|
|
sBrand: sBrand
|
|
|
|
|
});
|
|
|
|
|
getToPptTask(obj).then(() => {
|
|
|
|
|
this.$notification.open({
|
|
|
|
|
message: `数据生成中`,
|
|
|
|
|
description: '请前往个人中心查看下载进度',
|
|
|
|
|
placement: 'bottomRight',
|
|
|
|
|
});
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|