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.

98 lines
2.8 KiB

4 years ago
<!--
* @Author: your name
* @Date: 2021-10-14 19:15:58
4 years ago
* @LastEditTime: 2021-11-11 10:46:45
4 years ago
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/WeiboDetails/weiboSpreadFission/index.vue
-->
<template>
<div class="wsf-outter">
<v-label-div title="微博传播裂变">
</v-label-div>
<div class="wsf-inner">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</template>
<script>
4 years ago
import { getDiffuseZhuTi } from "@/api/WeiboDetails";
import createOpt from "./opt";
4 years ago
export default {
name: "MWDweiboSpreadFission",
data() {
return {
opt: {},
form: {
4 years ago
token: "",
sBrand: "",
sSeriesName: "",
},
colors: [
"#FFB600",
"#886CFF",
"#0084FF",
"#4CB690",
"#58B458",
"#6C6C6C",
"#F56161",
"#FC754C",
"#5F5EEC",
],
};
4 years ago
},
created() {
this.form.token = this.getToken;
this.form.sBrand = this.getBrand.brandname || this.brand;
4 years ago
this.form.sSeriesName = this.getModel.name;
this.getData();
4 years ago
},
methods: {
4 years ago
getData() {
let obj = Object.assign({}, this.getCtime2, this.form);
getDiffuseZhuTi(obj).then((res) => {
let data = res.data;
let getCoreDiffuseWeiBo = data.getCoreDiffuseWeiBo || [];
let listIdName = data.listIdName || [];
let listPid = data.listPid || [];
let nodes = listIdName;
let edges = listPid;
getCoreDiffuseWeiBo.forEach((ele) => {
let _source = ele._source;
let xgmid = _source.xgmid;
let row = nodes.find((e) => e.id === xgmid);
if (row) {
row.value = _source.volume;
} else {
row.value = 0;
}
});
nodes.forEach((ele) => {
let colorSet = new Set(this.colors);
let curIndex = Math.round(
Math.random() * (colorSet.size - 1)
);
ele.color = this.colors[curIndex];
});
let o = { nodes, edges };
this.opt = createOpt(o);
});
},
},
};
4 years ago
</script>
<style lang="less" scoped>
.wsf-outter {
width: 460px;
height: 460px;
border: 2px solid #0f2a4d;
margin-left: 16px;
.wsf-inner {
width: 100%;
height: calc(100% - 48px);
}
}
</style>