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
|
||||
* @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
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: /data-show/src/views/WeiboDetails/weiboCharacters/index.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="wc-outter" v-loading="load">
|
||||
<v-label-div title="数据对比分析">
|
||||
<div>
|
||||
<v-tab-group
|
||||
:btns="['阅读量', '回复量', '精华率', '图文']"
|
||||
@change="handlerTab"
|
||||
></v-tab-group>
|
||||
</div>
|
||||
</v-label-div>
|
||||
<div class="wc-inner">
|
||||
<div class="d1">
|
||||
<v-echarts :opt="opt"></v-echarts>
|
||||
</div>
|
||||
<div class="d2">
|
||||
<vue-scroll>
|
||||
<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>
|
||||
</vue-scroll>
|
||||
</div>
|
||||
<div class="wc-outter" v-loading="load">
|
||||
<v-label-div title="数据对比分析">
|
||||
<div>
|
||||
<v-tab-group :btns="['阅读量', '回复量', '精华率', '图文']" @change="handlerTab"></v-tab-group>
|
||||
</div>
|
||||
</v-label-div>
|
||||
<div class="wc-inner">
|
||||
<div class="d1">
|
||||
<v-echarts :opt="opt"></v-echarts>
|
||||
</div>
|
||||
<div class="d2">
|
||||
<vue-scroll>
|
||||
<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>
|
||||
</vue-scroll>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSexMergeWeiBo } from "@/api/WeiboDetails";
|
||||
import {
|
||||
getClicksDistribution,
|
||||
getReplyDistribution,
|
||||
getJingHuaDistribution,
|
||||
getImgDistribution,
|
||||
} from "@/api/ModelForumDetails";
|
||||
import createOpt from "./opt";
|
||||
export default {
|
||||
name: "mfdCharacters",
|
||||
data() {
|
||||
return {
|
||||
load: false,
|
||||
form: {
|
||||
sBrand: "",
|
||||
token: "",
|
||||
},
|
||||
RegionWeiBo: [],
|
||||
attestation: [],
|
||||
sex: [],
|
||||
total: 0,
|
||||
labelArr: [],
|
||||
|
||||
opt: createOpt(),
|
||||
colors: [
|
||||
"#54BF93",
|
||||
"#3373CC",
|
||||
"#CC9D12",
|
||||
"#f15c80",
|
||||
"#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() {
|
||||
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],
|
||||
name: "mfdCharacters",
|
||||
data() {
|
||||
return {
|
||||
load: false,
|
||||
form: {
|
||||
sBrand: "",
|
||||
token: "",
|
||||
sSeriesName: "",
|
||||
},
|
||||
clicksDistributio: [],
|
||||
replyDistribution: [],
|
||||
jingHuaDistribution: [],
|
||||
imgDistribution: [],
|
||||
ctotal: 0,
|
||||
rtotal: 0,
|
||||
jtotal: 0,
|
||||
itotal: 0,
|
||||
total: 0,
|
||||
labelArr: [],
|
||||
opt: {},
|
||||
colors: [
|
||||
"#3373CC",
|
||||
"#54BF93",
|
||||
"#CC9D12",
|
||||
"#f15c80",
|
||||
"#e4d354",
|
||||
"#8085e8",
|
||||
"#8d4653",
|
||||
"#91e8e1",
|
||||
"#f7a35c",
|
||||
"#90ed7d",
|
||||
"#54BF93",
|
||||
"#3373CC",
|
||||
"#CC9D12",
|
||||
"#f15c80",
|
||||
"#e4d354",
|
||||
"#8085e8",
|
||||
"#8d4653",
|
||||
"#91e8e1",
|
||||
"#f7a35c",
|
||||
"#90ed7d",
|
||||
],
|
||||
};
|
||||
arr.push(o);
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
// 给页面变化值赋值
|
||||
doVal(arr = []) {
|
||||
let total = 0;
|
||||
arr.forEach((ele) => {
|
||||
total += ele.value * 1;
|
||||
});
|
||||
this.total = total;
|
||||
this.labelArr = arr;
|
||||
this.opt = createOpt(this.labelArr, this.colors);
|
||||
created() {
|
||||
this.form.token = this.getToken;
|
||||
this.form.sBrand = this.getBrand.brandname || this.brand;
|
||||
this.form.sSeriesName = this.getModel.name;
|
||||
this.load = true;
|
||||
Promise.all([
|
||||
this.getClicksDistribution(),
|
||||
this.getReplyDistribution(),
|
||||
this.getJingHuaDistribution(),
|
||||
this.getImgDistribution(),
|
||||
]).then(() => {
|
||||
this.handlerTab(0)
|
||||
this.load = false;
|
||||
});
|
||||
},
|
||||
// 切换数据
|
||||
handlerTab(n) {
|
||||
switch (n) {
|
||||
case 0:
|
||||
this.doVal(this.sex);
|
||||
break;
|
||||
case 1:
|
||||
this.doVal(this.attestation);
|
||||
break;
|
||||
case 2:
|
||||
this.doVal(this.RegionWeiBo);
|
||||
break;
|
||||
default:
|
||||
this.doVal(this.sex);
|
||||
break;
|
||||
}
|
||||
methods: {
|
||||
// 将对象变成数组
|
||||
toArr(obj) {
|
||||
let arr = [];
|
||||
for (let key in obj) {
|
||||
let o = {
|
||||
key: key,
|
||||
value: obj[key],
|
||||
};
|
||||
arr.push(o);
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
|
||||
// 切换数据
|
||||
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>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.wc-outter {
|
||||
width: 618px;
|
||||
height: 460px;
|
||||
border: 2px solid #0f2a4d;
|
||||
margin-left: 16px;
|
||||
overflow: hidden;
|
||||
.wc-inner {
|
||||
width: 100%;
|
||||
height: calc(100% - 48px);
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
.d1 {
|
||||
width: 280px;
|
||||
height: 100%;
|
||||
}
|
||||
.d2 {
|
||||
width: 300px;
|
||||
margin-left: 16px;
|
||||
width: 618px;
|
||||
height: 460px;
|
||||
border: 2px solid #0f2a4d;
|
||||
margin-left: 16px;
|
||||
overflow: hidden;
|
||||
.wc-inner {
|
||||
width: 100%;
|
||||
height: calc(100% - 48px);
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
.d1 {
|
||||
width: 280px;
|
||||
height: 100%;
|
||||
}
|
||||
.d2 {
|
||||
width: 300px;
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
@ -1,119 +1,99 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @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
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: /data-show/src/views/WeiboDetails/weiboContentType/index.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="wct-outter" v-loading="load">
|
||||
<v-label-div title="论坛调性分布"> </v-label-div>
|
||||
<div class="wct-inner">
|
||||
<div class="d1">
|
||||
<v-echarts :opt="opt"></v-echarts>
|
||||
</div>
|
||||
<div class="d2">
|
||||
<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>
|
||||
<div class="wct-outter" v-loading="load">
|
||||
<v-label-div title="论坛调性分布"> </v-label-div>
|
||||
<div class="wct-inner">
|
||||
<div class="d1">
|
||||
<v-echarts :opt="opt"></v-echarts>
|
||||
</div>
|
||||
<div class="d2">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getWtypeWeiBo0528 } from "@/api/WeiboDetails";
|
||||
import { getAffections } from "@/api/ModelForumDetails";
|
||||
import createOpt from "./opt";
|
||||
export default {
|
||||
name: "mfdContentType",
|
||||
data() {
|
||||
return {
|
||||
load: false,
|
||||
form: {
|
||||
sBrand: "",
|
||||
token: "",
|
||||
},
|
||||
labelArr: [],
|
||||
total: 0,
|
||||
opt: createOpt(),
|
||||
colors: [
|
||||
"#54BF93",
|
||||
"#3373CC",
|
||||
"#CC9D12",
|
||||
"#f15c80",
|
||||
"#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;
|
||||
});
|
||||
name: "mfdContentType",
|
||||
data() {
|
||||
return {
|
||||
load: false,
|
||||
form: {
|
||||
sBrand: "",
|
||||
token: "",
|
||||
sSeriesName: "",
|
||||
},
|
||||
labelArr: [],
|
||||
total: 0,
|
||||
opt: createOpt(),
|
||||
colors: [
|
||||
"#3373CC",
|
||||
"#54BF93",
|
||||
"#CC9D12",
|
||||
],
|
||||
};
|
||||
},
|
||||
doVal(arr = []) {
|
||||
let total = 0;
|
||||
arr.forEach((ele) => {
|
||||
total += ele.value * 1;
|
||||
});
|
||||
this.total = total;
|
||||
this.labelArr = arr;
|
||||
this.opt = createOpt(this.labelArr, this.colors);
|
||||
created() {
|
||||
this.form.token = this.getToken;
|
||||
this.form.sBrand = this.getBrand.brandname || this.brand;
|
||||
this.form.sSeriesName = this.getModel.name;
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
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>
|
||||
<style lang="less" scoped>
|
||||
.wct-outter {
|
||||
width: 618px;
|
||||
height: 460px;
|
||||
border: 2px solid #0f2a4d;
|
||||
margin-left: 16px;
|
||||
overflow: hidden;
|
||||
.wct-inner {
|
||||
width: 100%;
|
||||
height: calc(100% - 48px);
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
.d1 {
|
||||
width: 280px;
|
||||
height: 100%;
|
||||
}
|
||||
.d2 {
|
||||
width: 300px;
|
||||
margin-left: 16px;
|
||||
width: 618px;
|
||||
height: 460px;
|
||||
border: 2px solid #0f2a4d;
|
||||
margin-left: 16px;
|
||||
overflow: hidden;
|
||||
.wct-inner {
|
||||
width: 100%;
|
||||
height: calc(100% - 48px);
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
.d1 {
|
||||
width: 280px;
|
||||
height: 100%;
|
||||
}
|
||||
.d2 {
|
||||
width: 300px;
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in new issue