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.

93 lines
2.3 KiB

<!--
* @Author: your name
* @Date: 2021-10-14 19:41:24
* @LastEditTime: 2021-11-09 13:20:35
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/WeiboDetails/weiboTonalDistribution/index.vue
-->
<template>
<div class="wtd-outter" v-loading="load">
<v-label-div title="调性分布"> </v-label-div>
<vue-scroll>
<div class="wtd-inner">
<div class="wtd-item" v-for="(item,index) in sourceData"
:key="index">
<v-percent :percentage="item.positive"></v-percent>
<span class="s1">{{item.show}}</span>
<v-percent color="#b78e11" :percentage="item.negative" reverse></v-percent>
</div>
</div>
</vue-scroll>
</div>
</template>
<script>
import { getBoauthenAffectionsWeiBo0528 } from "@/api/WeiboDetails";
export default {
name: "weiboTonalDistribution",
data() {
return {
load: false,
form: {
token: "",
sBrand: "",
},
sourceData: [],
};
},
created() {
this.form.token = this.getToken;
this.form.sBrand = this.getBrand.brandname || '奥迪';
this.getData();
},
methods: {
getData() {
let obj = Object.assign({}, this.getCtime2, this.form);
this.load = true;
getBoauthenAffectionsWeiBo0528(obj).then(res => {
let data = res.data;
let labelData = [];
data.forEach(ele => {
let o = {
show: ele.key,
positive:
ele.value[0].value*1.0 / (ele.value[0].value*1.0 + ele.value[2].value*1.0),
negative:
ele.value[2].value*1.0 / (ele.value[0].value*1.0 + ele.value[2].value*1.0),
};
labelData.push(o);
});
this.sourceData = labelData;
this.load = false;
});
},
},
};
</script>
<style lang="less" scoped>
.wtd-outter {
width: 460px;
height: 460px;
border: 2px solid #0f2a4d;
margin-left: 16px;
padding-bottom: 50px;
.wtd-inner {
width: 100%;
padding: 20px 16px;
.wtd-item {
display: flex;
justify-content: space-between;
margin-bottom: 36px;
.s1 {
display: block;
color: #fff;
font-size: 14px;
font-weight: 500;
}
}
}
}
</style>