parent
d9ed2349bf
commit
2093726dba
@ -0,0 +1,133 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-10-15 13:27:50
|
||||
* @LastEditTime: 2021-11-11 17:49:37
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: /data-show/src/views/BrandComparison/brandTonalDistribution/index.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="bd-outter" v-loading="load">
|
||||
<v-label-div title="整体调性对比" :showLine="false" :eStyle="{ 'border-style': 'none' }"> </v-label-div>
|
||||
<div class="bd-d1">
|
||||
<div class="dd1" style="margin-left: 16px">
|
||||
<span class="s1"></span><span class="s2">正面</span>
|
||||
</div>
|
||||
<div class="dd1" style="margin-left: 24px">
|
||||
<span class="s1" :style="{ background: '#54BF93' }"></span
|
||||
><span class="s2">中性</span>
|
||||
</div>
|
||||
<div class="dd1" style="margin-left: 24px">
|
||||
<span class="s1" :style="{ background: '#CC9D12' }"></span
|
||||
><span class="s2">负面</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bd-inner">
|
||||
<roundata
|
||||
v-for="(item,index) in list"
|
||||
:key="index"
|
||||
:title="item.key"
|
||||
:color="colors[index]"
|
||||
:style="index === 0 ? 'margin-left: 4rem': 'margin-left: 7.5rem'"
|
||||
:data="item.value"
|
||||
></roundata>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEventAffectionsC } from "@/api/ModelComparison";
|
||||
import roundata from "./roundata";
|
||||
export default {
|
||||
name: "eventBrandTonalDistribution",
|
||||
components: {
|
||||
roundata,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
load: false,
|
||||
form: {
|
||||
token: "",
|
||||
sBrand: "",
|
||||
sSeriesName: "",
|
||||
iContrastType: 2
|
||||
},
|
||||
colors: ['#3373CC', '#63AECC', '#54BF93', '#CC9D12', '#CC7733', '#CC5B41'],
|
||||
list: [
|
||||
|
||||
]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
this.form.token = this.getToken;
|
||||
let arr = this.getMComparison;
|
||||
let brands = [];
|
||||
let models = [];
|
||||
arr.forEach(ele => {
|
||||
brands.push(ele.brand);
|
||||
models.push(ele.model);
|
||||
});
|
||||
this.form.sBrand = brands.toString();
|
||||
this.form.sSeriesName = models.toString();
|
||||
this.getData();
|
||||
},
|
||||
//
|
||||
getData() {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.load = true;
|
||||
let obj = Object.assign({}, this.getCtime2, this.form);
|
||||
getEventAffectionsC(obj).then((res) => {
|
||||
let data = res.data || [];
|
||||
this.list = data;
|
||||
this.load = false;
|
||||
resolve(data)
|
||||
}).catch(() => {
|
||||
reject(false)
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.bd-outter {
|
||||
width: 100%;
|
||||
height: 460px;
|
||||
margin-top: 16px;
|
||||
.bd-d1 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
height: 36px;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
.dd1 {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
.s1 {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
background: #3373cc;
|
||||
}
|
||||
.s2 {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
.bd-inner {
|
||||
width: 100%;
|
||||
height: calc(100% - 48px);
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,70 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-10-15 13:41:17
|
||||
* @LastEditTime: 2021-11-11 17:45:37
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: /data-show/src/views/BrandComparison/brandTonalDistribution/roundata/index.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="bd-item-round">
|
||||
<div class="bd-item-r-cav">
|
||||
<v-echarts :opt="opt"></v-echarts>
|
||||
</div>
|
||||
<span class="bd-item-r-c-s1" :style="{color: color}">{{title}}</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import createOpt from "./opt";
|
||||
export default {
|
||||
name: "roundata",
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
data: {
|
||||
handler(val) {
|
||||
this.opt = createOpt(val)
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.bd-item-round {
|
||||
display: inline-block;
|
||||
.bd-item-r-cav {
|
||||
width: 193px;
|
||||
height: 206px;
|
||||
}
|
||||
.bd-item-r-c-s1 {
|
||||
display: block;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue