parent
332ba5df1d
commit
dc3ed4442b
File diff suppressed because one or more lines are too long
@ -0,0 +1,211 @@
|
|||||||
|
/*
|
||||||
|
* @Author: your name
|
||||||
|
* @Date: 2021-11-10 09:50:36
|
||||||
|
* @LastEditTime: 2021-11-10 16:02:05
|
||||||
|
* @LastEditors: Please set LastEditors
|
||||||
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
* @FilePath: /data-show/src/api/ModelForumDetails/index.js
|
||||||
|
*/
|
||||||
|
import httpService from "@/request"
|
||||||
|
// 论坛洞察详情
|
||||||
|
export function getBbsCount(params) {
|
||||||
|
let obj = Object.assign({action: 'getBbsCount',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主贴内容分析-论坛传播态势
|
||||||
|
export function getBbsVolumeTime(params) {
|
||||||
|
let obj = Object.assign({action: 'getBbsVolumeTime',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主贴内容分析-论坛调性分布
|
||||||
|
export function getAffections(params) {
|
||||||
|
let obj = Object.assign({action: 'getAffections',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主贴内容分析-阅读量
|
||||||
|
export function getClicksDistribution(params) {
|
||||||
|
let obj = Object.assign({action: 'getClicksDistribution',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主贴内容分析-回复量
|
||||||
|
export function getReplyDistribution(params) {
|
||||||
|
let obj = Object.assign({action: 'getReplyDistribution',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主贴内容分析-精华率
|
||||||
|
export function getJingHuaDistribution(params) {
|
||||||
|
let obj = Object.assign({action: 'getJingHuaDistribution',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主贴内容分析-图文
|
||||||
|
export function getImgDistribution(params) {
|
||||||
|
let obj = Object.assign({action: 'getImgDistribution',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 正面话题分布-正面话题分布
|
||||||
|
export function getPositiveTopic(params) {
|
||||||
|
let obj = Object.assign({action: 'getPositiveTopic',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 负面话题分布-负面话题分布
|
||||||
|
export function getNegativeTopic(params) {
|
||||||
|
let obj = Object.assign({action: 'getNegativeTopic',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主贴/跟帖ID车型分析-主贴/跟帖ID
|
||||||
|
export function getGuanZhuSeriesname(params) {
|
||||||
|
let obj = Object.assign({action: 'getGuanZhuSeriesname',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主贴/跟帖ID车型分析-主贴/跟帖认证ID
|
||||||
|
export function getAttestationBuycars(params) {
|
||||||
|
let obj = Object.assign({action: 'getAttestationBuycars',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主贴/跟帖用户分析-性别
|
||||||
|
export function getAttestationSex(params) {
|
||||||
|
let obj = Object.assign({action: 'getAttestationSex',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主贴/跟帖用户分析-认证
|
||||||
|
export function getUserAttestation(params) {
|
||||||
|
let obj = Object.assign({action: 'getUserAttestation',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主贴/跟帖区域分布-区域分布
|
||||||
|
export function getRegion(params) {
|
||||||
|
let obj = Object.assign({action: 'getRegion',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 疑似车黑ID-疑似车黑ID
|
||||||
|
export function getCarblackUserName(params) {
|
||||||
|
let obj = Object.assign({action: 'getCarblackUserName',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 跟帖ID注册时间-跟帖ID注册时间
|
||||||
|
export function getUserRegTime(params) {
|
||||||
|
let obj = Object.assign({action: 'getUserRegTime',sType: 'BbsSeries'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -1,171 +1,272 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: your name
|
* @Author: your name
|
||||||
* @Date: 2021-10-14 10:48:56
|
* @Date: 2021-10-14 10:48:56
|
||||||
* @LastEditTime: 2021-11-09 15:00:59
|
* @LastEditTime: 2021-11-10 11:38:07
|
||||||
* @LastEditors: Please set LastEditors
|
* @LastEditors: Please set LastEditors
|
||||||
* @Description: In User Settings Edit
|
* @Description: In User Settings Edit
|
||||||
* @FilePath: /data-show/src/views/WeiboDetails/weiboCharacters/index.vue
|
* @FilePath: /data-show/src/views/WeiboDetails/weiboCharacters/index.vue
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="wc-outter" v-loading="load">
|
<div class="wc-outter" v-loading="load">
|
||||||
<v-label-div title="数据对比分析">
|
<v-label-div title="数据对比分析">
|
||||||
<div>
|
<div>
|
||||||
<v-tab-group
|
<v-tab-group :btns="['阅读量', '回复量', '精华率', '图文']" @change="handlerTab"></v-tab-group>
|
||||||
:btns="['阅读量', '回复量', '精华率', '图文']"
|
</div>
|
||||||
@change="handlerTab"
|
</v-label-div>
|
||||||
></v-tab-group>
|
<div class="wc-inner">
|
||||||
</div>
|
<div class="d1">
|
||||||
</v-label-div>
|
<v-echarts :opt="opt"></v-echarts>
|
||||||
<div class="wc-inner">
|
</div>
|
||||||
<div class="d1">
|
<div class="d2">
|
||||||
<v-echarts :opt="opt"></v-echarts>
|
<vue-scroll>
|
||||||
</div>
|
<v-label-ctx v-for="(item, index) in labelArr" :key="index" :label="item.key" :cont="item.value" :percentage="((item.value / total) * 100).toFixed(2) + '%'" :color="colors[index]" :eStyle="{ height: '8.54rem' }"></v-label-ctx>
|
||||||
<div class="d2">
|
</vue-scroll>
|
||||||
<vue-scroll>
|
</div>
|
||||||
<v-label-ctx
|
</div>
|
||||||
v-for="(item, index) in labelArr"
|
|
||||||
:key="index"
|
|
||||||
:label="item.key"
|
|
||||||
:cont="item.value"
|
|
||||||
:percentage="((item.value / total) * 100).toFixed(2) + '%'"
|
|
||||||
:color="colors[index]"
|
|
||||||
:eStyle="{ height: '8.54rem' }"
|
|
||||||
></v-label-ctx>
|
|
||||||
</vue-scroll>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getSexMergeWeiBo } from "@/api/WeiboDetails";
|
import {
|
||||||
|
getClicksDistribution,
|
||||||
|
getReplyDistribution,
|
||||||
|
getJingHuaDistribution,
|
||||||
|
getImgDistribution,
|
||||||
|
} from "@/api/ModelForumDetails";
|
||||||
import createOpt from "./opt";
|
import createOpt from "./opt";
|
||||||
export default {
|
export default {
|
||||||
name: "mfdCharacters",
|
name: "mfdCharacters",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
load: false,
|
load: false,
|
||||||
form: {
|
form: {
|
||||||
sBrand: "",
|
sBrand: "",
|
||||||
token: "",
|
token: "",
|
||||||
},
|
sSeriesName: "",
|
||||||
RegionWeiBo: [],
|
},
|
||||||
attestation: [],
|
clicksDistributio: [],
|
||||||
sex: [],
|
replyDistribution: [],
|
||||||
total: 0,
|
jingHuaDistribution: [],
|
||||||
labelArr: [],
|
imgDistribution: [],
|
||||||
|
ctotal: 0,
|
||||||
opt: createOpt(),
|
rtotal: 0,
|
||||||
colors: [
|
jtotal: 0,
|
||||||
"#54BF93",
|
itotal: 0,
|
||||||
"#3373CC",
|
total: 0,
|
||||||
"#CC9D12",
|
labelArr: [],
|
||||||
"#f15c80",
|
opt: {},
|
||||||
"#e4d354",
|
colors: [
|
||||||
"#8085e8",
|
"#3373CC",
|
||||||
"#8d4653",
|
"#54BF93",
|
||||||
"#91e8e1",
|
"#CC9D12",
|
||||||
"#f7a35c",
|
"#f15c80",
|
||||||
"#90ed7d",
|
"#e4d354",
|
||||||
"#54BF93",
|
"#8085e8",
|
||||||
"#3373CC",
|
"#8d4653",
|
||||||
"#CC9D12",
|
"#91e8e1",
|
||||||
"#f15c80",
|
"#f7a35c",
|
||||||
"#e4d354",
|
"#90ed7d",
|
||||||
"#8085e8",
|
"#54BF93",
|
||||||
"#8d4653",
|
"#3373CC",
|
||||||
"#91e8e1",
|
"#CC9D12",
|
||||||
"#f7a35c",
|
"#f15c80",
|
||||||
"#90ed7d",
|
"#e4d354",
|
||||||
],
|
"#8085e8",
|
||||||
};
|
"#8d4653",
|
||||||
},
|
"#91e8e1",
|
||||||
created() {
|
"#f7a35c",
|
||||||
this.form.token = this.getToken;
|
"#90ed7d",
|
||||||
this.form.sBrand = this.getBrand.brandname || this.brand;
|
],
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 获取后台数据
|
|
||||||
getData() {
|
|
||||||
let obj = Object.assign({}, this.getCtime2, this.form);
|
|
||||||
this.load = true;
|
|
||||||
getSexMergeWeiBo(obj).then((res) => {
|
|
||||||
let data = res.data || {};
|
|
||||||
let RegionWeiBo = data.RegionWeiBo;
|
|
||||||
let attestation = data.attestation;
|
|
||||||
let sex = data.sex;
|
|
||||||
this.RegionWeiBo = this.toArr(RegionWeiBo);
|
|
||||||
this.attestation = this.toArr(attestation);
|
|
||||||
this.sex = this.toArr(sex);
|
|
||||||
this.doVal(this.sex);
|
|
||||||
this.load = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 将对象变成数组
|
|
||||||
toArr(obj) {
|
|
||||||
let arr = [];
|
|
||||||
for (let key in obj) {
|
|
||||||
let o = {
|
|
||||||
key: key,
|
|
||||||
value: obj[key],
|
|
||||||
};
|
};
|
||||||
arr.push(o);
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
},
|
},
|
||||||
// 给页面变化值赋值
|
created() {
|
||||||
doVal(arr = []) {
|
this.form.token = this.getToken;
|
||||||
let total = 0;
|
this.form.sBrand = this.getBrand.brandname || this.brand;
|
||||||
arr.forEach((ele) => {
|
this.form.sSeriesName = this.getModel.name;
|
||||||
total += ele.value * 1;
|
this.load = true;
|
||||||
});
|
Promise.all([
|
||||||
this.total = total;
|
this.getClicksDistribution(),
|
||||||
this.labelArr = arr;
|
this.getReplyDistribution(),
|
||||||
this.opt = createOpt(this.labelArr, this.colors);
|
this.getJingHuaDistribution(),
|
||||||
|
this.getImgDistribution(),
|
||||||
|
]).then(() => {
|
||||||
|
this.handlerTab(0)
|
||||||
|
this.load = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 切换数据
|
methods: {
|
||||||
handlerTab(n) {
|
// 将对象变成数组
|
||||||
switch (n) {
|
toArr(obj) {
|
||||||
case 0:
|
let arr = [];
|
||||||
this.doVal(this.sex);
|
for (let key in obj) {
|
||||||
break;
|
let o = {
|
||||||
case 1:
|
key: key,
|
||||||
this.doVal(this.attestation);
|
value: obj[key],
|
||||||
break;
|
};
|
||||||
case 2:
|
arr.push(o);
|
||||||
this.doVal(this.RegionWeiBo);
|
}
|
||||||
break;
|
return arr;
|
||||||
default:
|
},
|
||||||
this.doVal(this.sex);
|
|
||||||
break;
|
// 切换数据
|
||||||
}
|
handlerTab(n) {
|
||||||
|
switch (n) {
|
||||||
|
case 0:
|
||||||
|
this.labelArr = this.clicksDistributio;
|
||||||
|
this.total = this.ctotal;
|
||||||
|
this.opt = createOpt(this.labelArr, this.colors);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.labelArr = this.replyDistribution;
|
||||||
|
this.total = this.rtotal;
|
||||||
|
this.opt = createOpt(this.labelArr, this.colors);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.labelArr = this.jingHuaDistribution;
|
||||||
|
this.total = this.jtotal;
|
||||||
|
this.opt = createOpt(this.labelArr, this.colors);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.labelArr = this.imgDistribution;
|
||||||
|
this.total = this.itotal;
|
||||||
|
this.opt = createOpt(this.labelArr, this.colors);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.labelArr = this.clicksDistributio;
|
||||||
|
this.total = this.ctotal;
|
||||||
|
this.opt = createOpt(this.labelArr, this.colors);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 阅读量
|
||||||
|
getClicksDistribution() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let obj = Object.assign({}, this.getCtime2, this.form);
|
||||||
|
getClicksDistribution(obj)
|
||||||
|
.then((res) => {
|
||||||
|
let data = res.data || [];
|
||||||
|
let arr = [];
|
||||||
|
let ctotal = 0;
|
||||||
|
data.forEach((ele) => {
|
||||||
|
let o = {
|
||||||
|
key: ele.name,
|
||||||
|
value: ele.value,
|
||||||
|
};
|
||||||
|
ctotal += ele.value * 1;
|
||||||
|
arr.push(o);
|
||||||
|
});
|
||||||
|
this.clicksDistributio = arr;
|
||||||
|
this.ctotal = ctotal;
|
||||||
|
resolve(true);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
reject(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 回复量
|
||||||
|
getReplyDistribution() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let obj = Object.assign({}, this.getCtime2, this.form);
|
||||||
|
getReplyDistribution(obj)
|
||||||
|
.then((res) => {
|
||||||
|
let data = res.data || [];
|
||||||
|
let arr = [];
|
||||||
|
let rtotal = 0;
|
||||||
|
data.forEach((ele) => {
|
||||||
|
let o = {
|
||||||
|
key: ele.name,
|
||||||
|
value: ele.value,
|
||||||
|
};
|
||||||
|
rtotal += ele.value * 1;
|
||||||
|
arr.push(o);
|
||||||
|
});
|
||||||
|
this.replyDistribution = arr;
|
||||||
|
this.rtotal = rtotal;
|
||||||
|
resolve(true);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
reject(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 精华率
|
||||||
|
getJingHuaDistribution() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let obj = Object.assign({}, this.getCtime2, this.form);
|
||||||
|
getJingHuaDistribution(obj)
|
||||||
|
.then((res) => {
|
||||||
|
let data = res.data || {};
|
||||||
|
let arr = [];
|
||||||
|
let jtotal = 0;
|
||||||
|
for (let key in data) {
|
||||||
|
let o = {
|
||||||
|
key: key,
|
||||||
|
value: data[key],
|
||||||
|
};
|
||||||
|
arr.push(o);
|
||||||
|
jtotal += data[key] * 1;
|
||||||
|
}
|
||||||
|
this.jingHuaDistribution = arr;
|
||||||
|
this.jtotal = jtotal;
|
||||||
|
resolve(true);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
reject(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 图文
|
||||||
|
getImgDistribution() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let obj = Object.assign({}, this.getCtime2, this.form);
|
||||||
|
getImgDistribution(obj)
|
||||||
|
.then((res) => {
|
||||||
|
let data = res.data || {};
|
||||||
|
let arr = [];
|
||||||
|
let itotal = 0;
|
||||||
|
for (let key in data) {
|
||||||
|
let o = {
|
||||||
|
key: key,
|
||||||
|
value: data[key],
|
||||||
|
};
|
||||||
|
arr.push(o);
|
||||||
|
itotal += data[key] * 1;
|
||||||
|
}
|
||||||
|
this.imgDistribution = arr;
|
||||||
|
this.itotal = itotal;
|
||||||
|
resolve(true);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
reject(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.wc-outter {
|
.wc-outter {
|
||||||
width: 618px;
|
width: 618px;
|
||||||
height: 460px;
|
height: 460px;
|
||||||
border: 2px solid #0f2a4d;
|
border: 2px solid #0f2a4d;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.wc-inner {
|
.wc-inner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 48px);
|
height: calc(100% - 48px);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
.d1 {
|
.d1 {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.d2 {
|
.d2 {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -1,119 +1,99 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: your name
|
* @Author: your name
|
||||||
* @Date: 2021-10-14 10:24:56
|
* @Date: 2021-10-14 10:24:56
|
||||||
* @LastEditTime: 2021-11-09 14:59:02
|
* @LastEditTime: 2021-11-10 10:53:19
|
||||||
* @LastEditors: Please set LastEditors
|
* @LastEditors: Please set LastEditors
|
||||||
* @Description: In User Settings Edit
|
* @Description: In User Settings Edit
|
||||||
* @FilePath: /data-show/src/views/WeiboDetails/weiboContentType/index.vue
|
* @FilePath: /data-show/src/views/WeiboDetails/weiboContentType/index.vue
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="wct-outter" v-loading="load">
|
<div class="wct-outter" v-loading="load">
|
||||||
<v-label-div title="论坛调性分布"> </v-label-div>
|
<v-label-div title="论坛调性分布"> </v-label-div>
|
||||||
<div class="wct-inner">
|
<div class="wct-inner">
|
||||||
<div class="d1">
|
<div class="d1">
|
||||||
<v-echarts :opt="opt"></v-echarts>
|
<v-echarts :opt="opt"></v-echarts>
|
||||||
</div>
|
</div>
|
||||||
<div class="d2">
|
<div class="d2">
|
||||||
<v-label-ctx
|
<v-label-ctx v-for="(item, index) in labelArr" :key="index" :label="item.key" :cont="item.value" :percentage="((item.value / total) * 100).toFixed(2) + '%'" :color="colors[index]" :eStyle="{ height: '8.54rem' }"></v-label-ctx>
|
||||||
v-for="(item, index) in labelArr"
|
</div>
|
||||||
:key="index"
|
</div>
|
||||||
:label="item.key"
|
|
||||||
:cont="item.value"
|
|
||||||
:percentage="((item.value / total) * 100).toFixed(2) + '%'"
|
|
||||||
:color="colors[index]"
|
|
||||||
:eStyle="{ height: '8.54rem' }"
|
|
||||||
></v-label-ctx>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getWtypeWeiBo0528 } from "@/api/WeiboDetails";
|
import { getAffections } from "@/api/ModelForumDetails";
|
||||||
import createOpt from "./opt";
|
import createOpt from "./opt";
|
||||||
export default {
|
export default {
|
||||||
name: "mfdContentType",
|
name: "mfdContentType",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
load: false,
|
load: false,
|
||||||
form: {
|
form: {
|
||||||
sBrand: "",
|
sBrand: "",
|
||||||
token: "",
|
token: "",
|
||||||
},
|
sSeriesName: "",
|
||||||
labelArr: [],
|
},
|
||||||
total: 0,
|
labelArr: [],
|
||||||
opt: createOpt(),
|
total: 0,
|
||||||
colors: [
|
opt: createOpt(),
|
||||||
"#54BF93",
|
colors: [
|
||||||
"#3373CC",
|
"#3373CC",
|
||||||
"#CC9D12",
|
"#54BF93",
|
||||||
"#f15c80",
|
"#CC9D12",
|
||||||
"#e4d354",
|
],
|
||||||
"#8085e8",
|
};
|
||||||
"#8d4653",
|
|
||||||
"#91e8e1",
|
|
||||||
"#f7a35c",
|
|
||||||
"#90ed7d",
|
|
||||||
"#54BF93",
|
|
||||||
"#3373CC",
|
|
||||||
"#CC9D12",
|
|
||||||
"#f15c80",
|
|
||||||
"#e4d354",
|
|
||||||
"#8085e8",
|
|
||||||
"#8d4653",
|
|
||||||
"#91e8e1",
|
|
||||||
"#f7a35c",
|
|
||||||
"#90ed7d",
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.form.token = this.getToken;
|
|
||||||
this.form.sBrand = this.getBrand.brandname || this.brand;
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getData() {
|
|
||||||
this.load = true;
|
|
||||||
let obj = Object.assign({}, this.getCtime2, this.form);
|
|
||||||
getWtypeWeiBo0528(obj).then((res) => {
|
|
||||||
let data = res.data || [];
|
|
||||||
this.doVal(data);
|
|
||||||
this.load = false;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
doVal(arr = []) {
|
created() {
|
||||||
let total = 0;
|
this.form.token = this.getToken;
|
||||||
arr.forEach((ele) => {
|
this.form.sBrand = this.getBrand.brandname || this.brand;
|
||||||
total += ele.value * 1;
|
this.form.sSeriesName = this.getModel.name;
|
||||||
});
|
this.getData();
|
||||||
this.total = total;
|
},
|
||||||
this.labelArr = arr;
|
methods: {
|
||||||
this.opt = createOpt(this.labelArr, this.colors);
|
getData() {
|
||||||
|
this.load = true;
|
||||||
|
let obj = Object.assign({}, this.getCtime2, this.form);
|
||||||
|
getAffections(obj).then((res) => {
|
||||||
|
let data = res.data || {};
|
||||||
|
let arr = [];
|
||||||
|
let total = 0;
|
||||||
|
for (let key in data) {
|
||||||
|
let o = {
|
||||||
|
key: key,
|
||||||
|
value: data[key],
|
||||||
|
};
|
||||||
|
total += data[key]*1;
|
||||||
|
arr.push(o);
|
||||||
|
}
|
||||||
|
this.labelArr = arr;
|
||||||
|
this.total = total;
|
||||||
|
this.opt = createOpt(arr, this.colors);
|
||||||
|
this.load = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.wct-outter {
|
.wct-outter {
|
||||||
width: 618px;
|
width: 618px;
|
||||||
height: 460px;
|
height: 460px;
|
||||||
border: 2px solid #0f2a4d;
|
border: 2px solid #0f2a4d;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.wct-inner {
|
.wct-inner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 48px);
|
height: calc(100% - 48px);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
.d1 {
|
.d1 {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.d2 {
|
.d2 {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in new issue