From da6267ac16e74851b49d213aac5123cc23a08215 Mon Sep 17 00:00:00 2001 From: zx <604444282@qq.com> Date: Thu, 11 Nov 2021 14:21:24 +0800 Subject: [PATCH] =?UTF-8?q?zx-=E5=B0=BE=E7=BF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/BrandComparison/BrandWeiyi.js | 40 ++++++ .../brandEventComparison/opt.js | 4 +- .../brandRearWingComparison/index.vue | 41 +++++- .../brandRearWingComparison/opt.js | 130 +++++++----------- .../channelDistribution/opt.js | 23 +--- .../informationVolumeByChannel/index.vue | 43 +++++- .../informationVolumeByChannel/opt.js | 90 ++++-------- .../BrandComparison/tailTOPMedia/index.vue | 80 +++++++---- 8 files changed, 258 insertions(+), 193 deletions(-) create mode 100644 src/api/BrandComparison/BrandWeiyi.js diff --git a/src/api/BrandComparison/BrandWeiyi.js b/src/api/BrandComparison/BrandWeiyi.js new file mode 100644 index 0000000..383f377 --- /dev/null +++ b/src/api/BrandComparison/BrandWeiyi.js @@ -0,0 +1,40 @@ +import httpService from "@/request" + +// 品牌对比-尾翼信息趋势 +export function getCountTime0528C(params) { + let obj = Object.assign({action: 'getCountTime0528C', sType: 'BrandWeiyi', iContrastType: 1}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + +// 品牌对比-分渠道信息量 +export function getSourcetypeC(params) { + let obj = Object.assign({action: 'getSourcetypeC', sType: 'BrandWeiyi', iContrastType: 1}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + +// 品牌对比-尾翼top媒体 +export function getSourceTopCount0528C(params) { + let obj = Object.assign({action: 'getSourceTopCount0528C', sType: 'BrandWeiyi', iContrastType: 1}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} \ No newline at end of file diff --git a/src/views/BrandComparison/brandEventComparison/opt.js b/src/views/BrandComparison/brandEventComparison/opt.js index c743ed9..c64bbca 100644 --- a/src/views/BrandComparison/brandEventComparison/opt.js +++ b/src/views/BrandComparison/brandEventComparison/opt.js @@ -29,7 +29,7 @@ function createData(dataList = []) { emphasis: { focus: 'series' }, - data: [ele.Data.新闻,ele.Data.论坛,ele.Data.微信,ele.Data.APP,ele.Data.微博,ele.Data.其他] + data: [ele.Data.新闻,ele.Data.APP,ele.Data.微信,ele.Data.微博,ele.Data.短视频,ele.Data.论坛,ele.Data.其他] }; arr.push(o) }) @@ -76,7 +76,7 @@ export default function createOpt(dataList = [], brandList = []) { color: "#fff", }, }, - data: ['新闻', '论坛', '微信', 'APP', '微博', "其他"] + data: ['新闻', 'APP', '微信', '微博', '短视频','论坛', "其他"] } ], yAxis: [ diff --git a/src/views/BrandComparison/brandRearWingComparison/index.vue b/src/views/BrandComparison/brandRearWingComparison/index.vue index 6555c5a..3800e5d 100644 --- a/src/views/BrandComparison/brandRearWingComparison/index.vue +++ b/src/views/BrandComparison/brandRearWingComparison/index.vue @@ -16,14 +16,51 @@ diff --git a/src/views/BrandComparison/brandRearWingComparison/opt.js b/src/views/BrandComparison/brandRearWingComparison/opt.js index 346d8e9..c5ea26f 100644 --- a/src/views/BrandComparison/brandRearWingComparison/opt.js +++ b/src/views/BrandComparison/brandRearWingComparison/opt.js @@ -6,7 +6,39 @@ * @Description: In User Settings Edit * @FilePath: /data-show/src/views/BrandInsight/titsopo/opt.js */ -export default function createOpt() { +import { bigNumberTransform } from "@/utils/gol/dataTool" + +function createData(ds = []) { + let testData = {} + ds.forEach(item => { + item.forEach(val => { + if (testData[val.key] === undefined) { + testData[val.key] = { + name: val.key, + type: 'line', + symbol: 'none', + areaStyle: { + opacity: 0.4 + }, + emphasis: { + focus: 'series' + }, + data: [val.value] + } + } else { + testData[val.key].data.push(val.value) + } + }) + }) + let arr = []; + for(let key in testData) { + arr.push(testData[key]) + } + return arr +} + +export default function createOpt(dx = [], ds = []) { + let data = createData(ds); return { grid: { left: 16, @@ -45,7 +77,13 @@ export default function createOpt() { color: "#fff", }, }, - data: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00'] + axisLabel: { + formatter: (value) => { + let str = value.substring(10, 16) + return str; + } + }, + data: dx }, yAxis: { type: 'value', @@ -55,6 +93,12 @@ export default function createOpt() { color: "#fff", }, }, + axisLabel: { + formatter: (value) => { + let str = bigNumberTransform(value); + return str; + } + }, splitLine: { lineStyle: { type: "dashed", // y轴分割线类型 @@ -62,86 +106,6 @@ export default function createOpt() { }, }, }, - series: [ - { - name: '奥迪', - type: 'line', - stack: 'Total', - symbol: 'none', - areaStyle: { - opacity: 0.4 - }, - emphasis: { - focus: 'series' - }, - data: [2000, 1600, 1000, 2200, 2300, 2100, 1900] - }, - { - name: '宝马', - type: 'line', - stack: 'Total', - symbol: 'none', - areaStyle: { - opacity: 0.4 - }, - emphasis: { - focus: 'series' - }, - data: [1000, 1100, 1300, 2000, 1800, 2100, 1600] - }, - { - name: '奔驰', - type: 'line', - stack: 'Total', - symbol: 'none', - areaStyle: { - opacity: 0.4 - }, - emphasis: { - focus: 'series' - }, - data: [1200, 1200, 1400, 2100, 1400, 1900, 2000] - }, - { - name: '吉利', - type: 'line', - stack: 'Total', - symbol: 'none', - areaStyle: { - opacity: 0.4 - }, - emphasis: { - focus: 'series' - }, - data: [1200, 1200, 1350, 1550, 1750, 1900, 2000] - }, - { - name: '大众', - type: 'line', - stack: 'Total', - symbol: 'none', - areaStyle: { - opacity: 0.4 - }, - emphasis: { - focus: 'series' - }, - data: [1260, 1280, 1390, 1570, 1790, 1950, 2020] - }, - { - name: '别克', - type: 'line', - stack: 'Total', - symbol: 'none', - areaStyle: { - opacity: 0.4 - }, - emphasis: { - focus: 'series' - }, - data: [1260, 1280, 1390, 1570, 1790, 1950, 2020] - }, - - ] + series: data } } diff --git a/src/views/BrandComparison/channelDistribution/opt.js b/src/views/BrandComparison/channelDistribution/opt.js index 4326be4..901f07a 100644 --- a/src/views/BrandComparison/channelDistribution/opt.js +++ b/src/views/BrandComparison/channelDistribution/opt.js @@ -9,34 +9,23 @@ import { bigNumberTransform } from "@/utils/gol/dataTool" let colors = ['#3373CC', '#63AECC', '#54BF93', '#CC9D12', '#CC7733', "#CC5B41", '#452b74', '#71686f'] function createData(dataList = []) { - /*series: [ - { - name: '奥迪', - type: 'bar', - barGap: 0, - barWidth: 16, - emphasis: { - focus: 'series' - }, - data: [320, 332, 301, 334, 390, 400] - },*/ let arr = []; dataList.forEach(e => { let o = { name: e.Name, type: 'bar', barGap: 0, - barWidth: 16, + barWidth: 13.7, emphasis: { focus: 'series' }, - data: [e.Data.新闻,e.Data.论坛,e.Data.微信,e.Data.短视频,e.Data.微博,e.Data.其他] + data: [e.Data.新闻, e.Data.微信, e.Data.短视频, e.Data.APP, e.Data.论坛,e.Data.微博, e.Data.其他] }; arr.push(o) }) return arr; } -export default function createOpt(dataList = [],brandList = []) { +export default function createOpt(dataList = [], brandList = []) { let info = createData(dataList); return { grid: { @@ -77,7 +66,7 @@ export default function createOpt(dataList = [],brandList = []) { color: "#fff", }, }, - data: ['新闻', '论坛', '微信', 'APP', '微博', "其他"] + data: ['新闻', '微信', '短视频', 'APP','论坛', '微博', "其他"] } ], yAxis: [ @@ -91,8 +80,8 @@ export default function createOpt(dataList = [],brandList = []) { }, axisLabel: { formatter: (value) => { - let str = bigNumberTransform(value); - return str; + let str = bigNumberTransform(value); + return str; } }, splitLine: { diff --git a/src/views/BrandComparison/informationVolumeByChannel/index.vue b/src/views/BrandComparison/informationVolumeByChannel/index.vue index 4e3de9d..0e3ff2d 100644 --- a/src/views/BrandComparison/informationVolumeByChannel/index.vue +++ b/src/views/BrandComparison/informationVolumeByChannel/index.vue @@ -16,14 +16,53 @@ diff --git a/src/views/BrandComparison/informationVolumeByChannel/opt.js b/src/views/BrandComparison/informationVolumeByChannel/opt.js index 5cb74e0..287c075 100644 --- a/src/views/BrandComparison/informationVolumeByChannel/opt.js +++ b/src/views/BrandComparison/informationVolumeByChannel/opt.js @@ -6,7 +6,27 @@ * @Description: In User Settings Edit * @FilePath: /data-show/src/views/BrandComparison/channelDistribution/opt.js */ -export default function createOpt() { +import { bigNumberTransform } from "@/utils/gol/dataTool" +function createData(dataList = []) { + let arr = []; + dataList.forEach(e => { + let o = { + name: e.Name, + type: 'bar', + barGap: 0, + barWidth: 13.7, + emphasis: { + focus: 'series' + }, + data: [e.Data.新闻, e.Data.微信, e.Data.短视频, e.Data.论坛, e.Data.微博, e.Data.其他] + }; + arr.push(o) + }) + return arr; +} + +export default function createOpt(dataList = [], brandList = []) { + let info = createData(dataList); return { grid: { top: "56px", @@ -16,7 +36,7 @@ export default function createOpt() { containLabel: true, }, legend: { - data: ['奥迪', '宝马', '奔驰', '吉利', '大众', '别克'], + data: brandList, textStyle: { //图例文字的样式 color: '#fff' }, @@ -45,7 +65,7 @@ export default function createOpt() { color: "#fff", }, }, - data: ['新闻', '论坛', '微信', 'APP', '微博', "其他"] + data: ['新闻', '微信', '短视频', 'APP','论坛' ,'微博', "其他"] } ], yAxis: [ @@ -57,6 +77,12 @@ export default function createOpt() { color: "#FFF", }, }, + axisLabel: { + formatter: (value) => { + let str = bigNumberTransform(value); + return str; + } + }, splitLine: { lineStyle: { type: "dashed", // y轴分割线类型 @@ -65,62 +91,6 @@ export default function createOpt() { }, } ], - series: [ - { - name: '奥迪', - type: 'bar', - barGap: 0, - barWidth: 16, - emphasis: { - focus: 'series' - }, - data: [320, 332, 301, 334, 390, 400] - }, - { - name: '宝马', - type: 'bar', - barWidth: 16, - emphasis: { - focus: 'series' - }, - data: [220, 182, 191, 234, 290, 300] - }, - { - name: '奔驰', - type: 'bar', - barWidth: 16, - emphasis: { - focus: 'series' - }, - data: [150, 232, 201, 154, 190, 200] - }, - { - name: '吉利', - type: 'bar', - barWidth: 16, - emphasis: { - focus: 'series' - }, - data: [98, 77, 101, 99, 40, 44] - }, - { - name: '大众', - type: 'bar', - barWidth: 16, - emphasis: { - focus: 'series' - }, - data: [198, 177, 101, 199, 140, 145] - }, - { - name: '别克', - type: 'bar', - barWidth: 16, - emphasis: { - focus: 'series' - }, - data: [298, 277, 201, 299, 240, 250] - } - ] + series: info } } \ No newline at end of file diff --git a/src/views/BrandComparison/tailTOPMedia/index.vue b/src/views/BrandComparison/tailTOPMedia/index.vue index 4e0ea5b..20a88a9 100644 --- a/src/views/BrandComparison/tailTOPMedia/index.vue +++ b/src/views/BrandComparison/tailTOPMedia/index.vue @@ -11,7 +11,7 @@
-
+
{{item.name}}
@@ -22,41 +22,67 @@