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.
117 lines
4.2 KiB
117 lines
4.2 KiB
<!--
|
|
* @Author: your name
|
|
* @Date: 2021-10-14 19:41:24
|
|
* @LastEditTime: 2021-11-05 10:02:09
|
|
* @LastEditors: Please set LastEditors
|
|
* @Description: In User Settings Edit
|
|
* @FilePath: /data-show/src/views/WeiboDetails/weiboTonalDistribution/index.vue
|
|
-->
|
|
<template>
|
|
<div class="wtd-outter">
|
|
<v-label-div title="调性分布"> </v-label-div>
|
|
<div class="wtd-inner">
|
|
<div class="wtd-item" v-for="(value,key) in obj"
|
|
:key="key">
|
|
<v-percent :percentage="value.positive"></v-percent>
|
|
<span class="s1">{{value.show}}</span>
|
|
<v-percent color="#b78e11" :percentage="value.negative" reverse></v-percent>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { getBoauthenAffectionsWeiBo0528 } from "@/api/WeiboDetails";
|
|
export default {
|
|
name: "wtd-outter",
|
|
data() {
|
|
return {
|
|
form: {
|
|
token: "",
|
|
sBrand: "",
|
|
},
|
|
obj: {
|
|
bigV:{positive:0.1,negative:0.1,show:"个人大V"},
|
|
media:{positive:0.1,negative:0.1,show:"媒体"},
|
|
enterprice:{positive:0.1,negative:0.1,show:"企业"},
|
|
goverment:{positive:0.1,negative:0.1,show:"企业"},
|
|
famousPerson:{positive:0.1,negative:0.1,show:"名人"},
|
|
uncertified:{positive:0.1,negative:0.1,show:"未认证"},
|
|
certified:{positive:0.1,negative:0.1,show:"已认证"}
|
|
},
|
|
};
|
|
},
|
|
created() {
|
|
this.form.token = this.getToken;
|
|
this.form.sBrand = this.getBrand.brandname || this.Brand;
|
|
this.getData();
|
|
},
|
|
methods: {
|
|
getData() {
|
|
let obj = Object.assign({}, this.getCtime2, this.form);
|
|
getBoauthenAffectionsWeiBo0528(obj).then(res => {
|
|
let data = res.data;
|
|
data.forEach(ele => {
|
|
switch (ele.key) {
|
|
case ("个人大V"):
|
|
this.obj.bigV.positive = ele.value[0]/(ele.value[0].value+ele.value[2].value+0.1); //index[0]为正面数据
|
|
this.obj.bigV.negative = ele.value[2].value/(ele.value[0].value+ele.value[2].value+0.1); //index[2]为负面数据
|
|
break;
|
|
case ("媒体"):
|
|
this.obj.media.positive = ele.value[0].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
this.obj.media.negative = ele.value[2].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
break;
|
|
case ("企业"):
|
|
this.obj.enterprice.positive = ele.value[0].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
this.obj.enterprice.negative = ele.value[2].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
break;
|
|
case ("政府"):
|
|
this.obj.goverment.positive = ele.value[0].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
this.obj.goverment.negative = ele.value[2].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
break;
|
|
case ("名人"):
|
|
this.obj.famousPerson.positive = ele.value[0].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
this.obj.famousPerson.negative = ele.value[2].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
break;
|
|
case ("非认证"):
|
|
this.obj.uncertified.positive = ele.value[0].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
this.obj.uncertified.negative = ele.value[2].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
break;
|
|
case ("已认证"):
|
|
this.obj.certified.positive = ele.value[0].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
this.obj.certified.negative = ele.value[2].value/(ele.value[0].value+ele.value[2].value+0.1);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
})
|
|
});
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.wtd-outter {
|
|
width: 460px;
|
|
height: 460px;
|
|
border: 2px solid #0f2a4d;
|
|
margin-left: 16px;
|
|
.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>
|