From c31049598736b7d5687d476f8ac0949ab9462587 Mon Sep 17 00:00:00 2001 From: zx <604444282@qq.com> Date: Fri, 12 Nov 2021 17:35:41 +0800 Subject: [PATCH] =?UTF-8?q?zx-=E5=93=81=E7=89=8C=E5=AF=B9=E6=AF=94/?= =?UTF-8?q?=E5=BE=AE=E5=8D=9A=E8=AF=A6=E6=83=85-=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BrandComparison/weiboUserPortrait/opt1.js | 5 +- .../BrandComparison/weiboUserPortrait/opt2.js | 4 +- .../WeiboDetails/weiboSpreadFission/index.vue | 2 + .../weiboTonalDistribution/index.vue | 62 +++++-------------- 4 files changed, 22 insertions(+), 51 deletions(-) diff --git a/src/views/BrandComparison/weiboUserPortrait/opt1.js b/src/views/BrandComparison/weiboUserPortrait/opt1.js index 34f9a55..2a36d68 100644 --- a/src/views/BrandComparison/weiboUserPortrait/opt1.js +++ b/src/views/BrandComparison/weiboUserPortrait/opt1.js @@ -43,12 +43,13 @@ export default function createOpt1(ds = [], color = []) { label: { show: false, position: 'center', - lineheight: 28, + lineHeight: 28, + color: "#ffff" }, emphasis: { label: { show: true, - fontSize: '22', + fontSize: '20', color: "#ffff", fontWeight: 'bold', formatter: function (p) { diff --git a/src/views/BrandComparison/weiboUserPortrait/opt2.js b/src/views/BrandComparison/weiboUserPortrait/opt2.js index 28a1362..35f3d65 100644 --- a/src/views/BrandComparison/weiboUserPortrait/opt2.js +++ b/src/views/BrandComparison/weiboUserPortrait/opt2.js @@ -43,13 +43,13 @@ export default function createOpt2(ds = [], color = []) { label: { show: false, position: 'center', - fontSize: '40', + lineHeight: 28, color: "#ffff", }, emphasis: { label: { show: true, - fontSize: '22', + fontSize: '20', color: "#ffff", fontWeight: 'bold', formatter: function (p) { diff --git a/src/views/WeiboDetails/weiboSpreadFission/index.vue b/src/views/WeiboDetails/weiboSpreadFission/index.vue index 73829e3..27e01a9 100644 --- a/src/views/WeiboDetails/weiboSpreadFission/index.vue +++ b/src/views/WeiboDetails/weiboSpreadFission/index.vue @@ -50,6 +50,7 @@ export default { methods: { getData() { let obj = Object.assign({}, this.getCtime2, this.form); + this.load = true; getDiffuseZhuTi(obj).then((res) => { let data = res.data; let getCoreDiffuseWeiBo = data.getCoreDiffuseWeiBo || []; @@ -76,6 +77,7 @@ export default { }); let o = { nodes, edges }; this.opt = createOpt(o); + this.load = false; }); }, } diff --git a/src/views/WeiboDetails/weiboTonalDistribution/index.vue b/src/views/WeiboDetails/weiboTonalDistribution/index.vue index 59affda..60ed63e 100644 --- a/src/views/WeiboDetails/weiboTonalDistribution/index.vue +++ b/src/views/WeiboDetails/weiboTonalDistribution/index.vue @@ -10,11 +10,11 @@
-
- - {{value.show}} - +
+ + {{item.show}} +
@@ -31,15 +31,7 @@ export default { 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:"已认证"} - }, + sourceData: [], }; }, created() { @@ -53,40 +45,16 @@ export default { this.load = true; getBoauthenAffectionsWeiBo0528(obj).then(res => { let data = res.data; + let labelData = []; 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; - } - }) + let o = { + show: ele.key, + positive: ele.value[0].value/(ele.value[0].value + ele.value[2].value), + negative: ele.value[2].value/(ele.value[0].value + ele.value[2].value) + }; + labelData.push(o); + }); + this.sourceData = labelData; this.load = false; }); },