From 8ea7a56106c076dac6e957836bf4effa6a93e2b7 Mon Sep 17 00:00:00 2001 From: zx <604444282@qq.com> Date: Thu, 11 Nov 2021 17:28:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?zx-=E5=93=81=E7=89=8C=E5=AF=B9=E6=AF=94-?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../brandEventComparison/index.vue | 9 ++- .../brandEventComparison/opt.js | 15 ++-- .../channelDistribution/index.vue | 15 +++- .../channelDistribution/opt.js | 15 ++-- .../informationVolumeByChannel/index.vue | 80 +++++++++++-------- .../informationVolumeByChannel/opt.js | 15 ++-- 6 files changed, 94 insertions(+), 55 deletions(-) diff --git a/src/views/BrandComparison/brandEventComparison/index.vue b/src/views/BrandComparison/brandEventComparison/index.vue index 4b5423b..ff931d6 100644 --- a/src/views/BrandComparison/brandEventComparison/index.vue +++ b/src/views/BrandComparison/brandEventComparison/index.vue @@ -127,10 +127,17 @@ export default { .then((res) => { let data = res.data || []; let brandList = []; + let dx = []; data.forEach((e) => { + let ab = e.Data || {}; + for (let key in ab) { + if (!dx.includes(key)) { + dx.push(key); + } + } brandList.push(e.Name); }); - this.opt1 = createOpt(data, brandList); + this.opt1 = createOpt(data,dx, brandList); resolve(data); }) .catch(() => { diff --git a/src/views/BrandComparison/brandEventComparison/opt.js b/src/views/BrandComparison/brandEventComparison/opt.js index c64bbca..5a1525a 100644 --- a/src/views/BrandComparison/brandEventComparison/opt.js +++ b/src/views/BrandComparison/brandEventComparison/opt.js @@ -18,9 +18,14 @@ }, data: [320, 332, 301, 334, 390, 400] },*/ -function createData(dataList = []) { +function createData(dataList = [],dx = []) { let arr = []; dataList.forEach(ele => { + let a = []; + let Data = ele.Data || {}; + dx.forEach(e => { + a.push(Data[e]) + }) let o = { name: ele.Name, type: 'bar', @@ -29,15 +34,15 @@ function createData(dataList = []) { emphasis: { focus: 'series' }, - data: [ele.Data.新闻,ele.Data.APP,ele.Data.微信,ele.Data.微博,ele.Data.短视频,ele.Data.论坛,ele.Data.其他] + data: a }; arr.push(o) }) return arr; } -export default function createOpt(dataList = [], brandList = []) { - let info = createData(dataList); +export default function createOpt(dataList = [],dx = [], brandList = []) { + let info = createData(dataList,dx); return { grid: { top: "56px", @@ -76,7 +81,7 @@ export default function createOpt(dataList = [], brandList = []) { color: "#fff", }, }, - data: ['新闻', 'APP', '微信', '微博', '短视频','论坛', "其他"] + data: dx } ], yAxis: [ diff --git a/src/views/BrandComparison/channelDistribution/index.vue b/src/views/BrandComparison/channelDistribution/index.vue index 420281c..f07ac43 100644 --- a/src/views/BrandComparison/channelDistribution/index.vue +++ b/src/views/BrandComparison/channelDistribution/index.vue @@ -50,10 +50,17 @@ export default { .then((res) => { let data = res.data || []; let brandList = []; - data.forEach(e => { - brandList.push(e.Name) - }) - this.opt = createOpt(data,brandList); + let dx = []; + data.forEach((e) => { + let ab = e.Data || {}; + for (let key in ab) { + if (!dx.includes(key)) { + dx.push(key); + } + } + brandList.push(e.Name); + }); + this.opt = createOpt(data,dx, brandList); resolve(data); }) .catch(() => { diff --git a/src/views/BrandComparison/channelDistribution/opt.js b/src/views/BrandComparison/channelDistribution/opt.js index 901f07a..da96d22 100644 --- a/src/views/BrandComparison/channelDistribution/opt.js +++ b/src/views/BrandComparison/channelDistribution/opt.js @@ -8,9 +8,14 @@ */ import { bigNumberTransform } from "@/utils/gol/dataTool" let colors = ['#3373CC', '#63AECC', '#54BF93', '#CC9D12', '#CC7733', "#CC5B41", '#452b74', '#71686f'] -function createData(dataList = []) { +function createData(dataList = [],dx = []) { let arr = []; dataList.forEach(e => { + let a = []; + let Data = e.Data || {}; + dx.forEach(e => { + a.push(Data[e]) + }) let o = { name: e.Name, type: 'bar', @@ -19,14 +24,14 @@ function createData(dataList = []) { emphasis: { focus: 'series' }, - data: [e.Data.新闻, e.Data.微信, e.Data.短视频, e.Data.APP, e.Data.论坛,e.Data.微博, e.Data.其他] + data: a }; arr.push(o) }) return arr; } -export default function createOpt(dataList = [], brandList = []) { - let info = createData(dataList); +export default function createOpt(dataList = [],dx = [], brandList = []) { + let info = createData(dataList,dx); return { grid: { top: "56px", @@ -66,7 +71,7 @@ export default function createOpt(dataList = [], brandList = []) { color: "#fff", }, }, - data: ['新闻', '微信', '短视频', 'APP','论坛', '微博', "其他"] + data: dx } ], yAxis: [ diff --git a/src/views/BrandComparison/informationVolumeByChannel/index.vue b/src/views/BrandComparison/informationVolumeByChannel/index.vue index 0e3ff2d..b31221b 100644 --- a/src/views/BrandComparison/informationVolumeByChannel/index.vue +++ b/src/views/BrandComparison/informationVolumeByChannel/index.vue @@ -7,32 +7,36 @@ * @FilePath: /data-show/src/views/BrandComparison/informationVolumeByChannel/index.vue --> diff --git a/src/views/BrandComparison/informationVolumeByChannel/opt.js b/src/views/BrandComparison/informationVolumeByChannel/opt.js index 287c075..5fe1b9f 100644 --- a/src/views/BrandComparison/informationVolumeByChannel/opt.js +++ b/src/views/BrandComparison/informationVolumeByChannel/opt.js @@ -7,9 +7,14 @@ * @FilePath: /data-show/src/views/BrandComparison/channelDistribution/opt.js */ import { bigNumberTransform } from "@/utils/gol/dataTool" -function createData(dataList = []) { +function createData(dataList = [],dx = []) { let arr = []; dataList.forEach(e => { + let a = []; + let Data = e.Data || {}; + dx.forEach(e => { + a.push(Data[e]) + }) let o = { name: e.Name, type: 'bar', @@ -18,15 +23,15 @@ function createData(dataList = []) { emphasis: { focus: 'series' }, - data: [e.Data.新闻, e.Data.微信, e.Data.短视频, e.Data.论坛, e.Data.微博, e.Data.其他] + data: a }; arr.push(o) }) return arr; } -export default function createOpt(dataList = [], brandList = []) { - let info = createData(dataList); +export default function createOpt(dataList = [],dx = [], brandList = []) { + let info = createData(dataList,dx); return { grid: { top: "56px", @@ -65,7 +70,7 @@ export default function createOpt(dataList = [], brandList = []) { color: "#fff", }, }, - data: ['新闻', '微信', '短视频', 'APP','论坛' ,'微博', "其他"] + data: dx } ], yAxis: [ From 96e39081c015d1c0f5b070df65411e4877cc16d5 Mon Sep 17 00:00:00 2001 From: zx <604444282@qq.com> Date: Fri, 12 Nov 2021 10:18:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?zx-=E5=93=81=E7=89=8C=E5=AF=B9=E6=AF=94-?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../brandEventComparison/index.vue | 5 +- .../brandEventComparison/opt.js | 82 +++++-- .../channelDistribution/index.vue | 7 +- .../channelDistribution/opt.js | 78 ++++++- .../informationTrend/index.vue | 5 +- .../BrandComparison/informationTrend/opt.js | 13 +- .../informationVolumeByChannel/index.vue | 5 +- .../informationVolumeByChannel/opt.js | 58 +++++ .../keyMediaCommunicationComparison/index.vue | 20 +- .../keyMediaCommunicationComparison/opt.js | 220 +++++++++++------- .../overallInformation/index.vue | 110 +++++---- .../overallNumberOfInteractions/index.vue | 110 +++++---- .../weiboBigVComparison/index.vue | 17 +- .../weiboBigVComparison/opt.js | 111 +++++++-- .../keyMediaCommunicationComparison/opt.js | 1 - 15 files changed, 581 insertions(+), 261 deletions(-) diff --git a/src/views/BrandComparison/brandEventComparison/index.vue b/src/views/BrandComparison/brandEventComparison/index.vue index ff931d6..3696914 100644 --- a/src/views/BrandComparison/brandEventComparison/index.vue +++ b/src/views/BrandComparison/brandEventComparison/index.vue @@ -7,7 +7,7 @@ * @FilePath: /data-show/src/views/BrandComparison/brandEventComparison/index.vue -->