From 2093726dbad3e8557e16ab53fd57d20e9e83efbb Mon Sep 17 00:00:00 2001 From: "lily.zhang" Date: Fri, 12 Nov 2021 14:01:18 +0800 Subject: [PATCH] cxw-010203 --- src/api/ModelComparison/index.js | 62 +++++- src/components/v-echars/index.vue | 3 +- src/views/ModelComparison/BrandComparison.vue | 6 +- .../brandEventComparison/index.vue | 23 ++- .../brandEventComparison/opt.js | 2 +- .../brandEventComparison/opt1.js | 42 ++-- .../comparisonOfForumPostingTrends/index.vue | 56 +++++- .../comparisonOfForumPostingTrends/opt.js | 143 ++++++-------- .../index.vue | 18 +- .../comparisonOfWeiboInformation/index.vue | 16 +- .../eventBrandTonalDistribution/index.vue | 133 +++++++++++++ .../roundata/index.vue | 70 +++++++ .../roundata/opt.js | 87 +++++++++ .../forumTonalComparison/index.vue | 71 +++++-- .../forumTonalComparison/roundata/index.vue | 18 +- .../forumTonalComparison/roundata/opt.js | 106 ++++------ .../informationVolumeByChannel/opt.js | 8 +- .../keyMediaCommunicationComparison/opt.js | 3 +- .../index.vue | 92 +++++---- .../userAreaDistribution/index.vue | 175 ++++++++++------- .../userAreaDistribution/opt1.js | 19 +- .../userAreaDistribution/opt2.js | 48 +---- .../weiboBigVComparison/index.vue | 16 +- .../weiboBigVComparison/opt.js | 85 ++++++-- .../weiboContentDirectionComparison/index.vue | 16 +- .../v-ranking-bcm/index.vue | 4 +- .../weiboTuneComparison/index.vue | 16 +- .../weiboUserPortrait/index.vue | 119 +++++++++++- .../ModelComparison/weiboUserPortrait/opt1.js | 181 ++++++++---------- .../ModelComparison/weiboUserPortrait/opt2.js | 181 ++++++++---------- 30 files changed, 1168 insertions(+), 651 deletions(-) create mode 100644 src/views/ModelComparison/eventBrandTonalDistribution/index.vue create mode 100644 src/views/ModelComparison/eventBrandTonalDistribution/roundata/index.vue create mode 100644 src/views/ModelComparison/eventBrandTonalDistribution/roundata/opt.js diff --git a/src/api/ModelComparison/index.js b/src/api/ModelComparison/index.js index 86f40d1..c0cd064 100644 --- a/src/api/ModelComparison/index.js +++ b/src/api/ModelComparison/index.js @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-11-11 15:12:31 - * @LastEditTime: 2021-11-11 16:42:55 + * @LastEditTime: 2021-11-12 13:46:55 * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: /data-show/src/api/ModelComparison/index.js @@ -19,4 +19,64 @@ export function getEventsSeriesNameC(params) { 'content-type': 'application/x-www-form-urlencoded' } }) +} +// 事件-整体调性对比 +export function getEventAffectionsC(params) { + let obj = Object.assign({action: 'getEventAffectionsC',sType: 'HotEvent0528'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} +// 微博-人群画像 +export function getSexMergeWeiBoC(params) { + let obj = Object.assign({action: 'getSexMergeWeiBoC',sType: 'BrandWeiBo'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} +// 论坛-论坛信息概括对比 +export function getCount0528C(params) { + let obj = Object.assign({action: 'getCount0528C',sType: 'BbsBrand', iBBsType: 1}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} +// 论坛-论坛发帖趋势对比 +export function getCountTime0528C(params) { + let obj = Object.assign({action: 'getCountTime0528C',sType: 'BbsBrand', iBBsType: 1}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} +// 论坛-论坛调性对比 +export function getAffectionsC(params) { + let obj = Object.assign({action: 'getAffectionsC',sType: 'BbsBrand', iBBsType: 2}, 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/components/v-echars/index.vue b/src/components/v-echars/index.vue index 1c3ff76..3231285 100644 --- a/src/components/v-echars/index.vue +++ b/src/components/v-echars/index.vue @@ -1,7 +1,7 @@ diff --git a/src/views/ModelComparison/eventBrandTonalDistribution/roundata/index.vue b/src/views/ModelComparison/eventBrandTonalDistribution/roundata/index.vue new file mode 100644 index 0000000..28ebd19 --- /dev/null +++ b/src/views/ModelComparison/eventBrandTonalDistribution/roundata/index.vue @@ -0,0 +1,70 @@ + + + + diff --git a/src/views/ModelComparison/eventBrandTonalDistribution/roundata/opt.js b/src/views/ModelComparison/eventBrandTonalDistribution/roundata/opt.js new file mode 100644 index 0000000..5a95843 --- /dev/null +++ b/src/views/ModelComparison/eventBrandTonalDistribution/roundata/opt.js @@ -0,0 +1,87 @@ +/* + * @Author: your name + * @Date: 2021-10-12 14:33:51 + * @LastEditTime: 2021-11-11 17:47:44 + * @LastEditors: Please set LastEditors + * @Description: In User Settings Edit + * @FilePath: /data-show/src/views/BrandInsight/weiboKol/opt.js + */ +import * as echarts from "echarts"; +function createData(obj = []) { + + let arr = []; + obj.forEach(ele => { + let color = ""; + if(ele.key === '正面') { + color = "#3373CC" + } else if(ele.key === '负面') { + color = "#b38b14" + } else { + color = "#54BF93" + } + let o = { + value: ele.value, + name: ele.key, + itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{ + //给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变 + //给第一个设置0,第四个设置1,就是垂直渐变 + offset: 0, + color: 'black' + }, { + offset: 1, + color: color + }])} + } + arr.push(o) + }) + return arr + +} +export default function createOpt(obj = {}) { + let data = createData(obj) + return { + series: [ + { + name: 'Access From0', + type: 'pie', + radius: ['70%', '92%'], + avoidLabelOverlap: false, + label: { + show: false, + position: 'center', + lineHeight: 28 + }, + emphasis: { + label: { + show: true, + fontSize: '18', + color: "#ffff", + fontWeight: 'bold', + formatter: function(p) { + return `${p.data.name}\n${p.percent}%\n${p.data.value}` + } + } + }, + labelLine: { + show: false + }, + data: data + }, + { + name: 'Access From1', + type: 'pie', + radius: ['96%', '100%'], + avoidLabelOverlap: false, + label: { + show: false, + position: 'center' + }, + labelLine: { + show: false + }, + center: ['50%', '50%'],//边框位置 + data: data + } + ] + } +} diff --git a/src/views/ModelComparison/forumTonalComparison/index.vue b/src/views/ModelComparison/forumTonalComparison/index.vue index 2a67133..30270d9 100644 --- a/src/views/ModelComparison/forumTonalComparison/index.vue +++ b/src/views/ModelComparison/forumTonalComparison/index.vue @@ -1,39 +1,82 @@ diff --git a/src/views/ModelComparison/userAreaDistribution/opt1.js b/src/views/ModelComparison/userAreaDistribution/opt1.js index 02ca558..da817f8 100644 --- a/src/views/ModelComparison/userAreaDistribution/opt1.js +++ b/src/views/ModelComparison/userAreaDistribution/opt1.js @@ -3,18 +3,18 @@ /* * @Author: your name * @Date: 2021-10-09 12:38:34 - * @LastEditTime: 2021-10-14 11:48:19 + * @LastEditTime: 2021-11-12 11:05:53 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: /data-show/src/views/Index/tailInsight/opt.js */ import * as echarts from "echarts"; -export default function createOptD1() { +export default function createOptD1(dx = [], ds = []) { return { grid: { - left: '4%', - right: '4%', - bottom: '4%', + left: 10, + right: '5%', + bottom: 10, top: "1%", containLabel: true }, @@ -45,7 +45,7 @@ export default function createOptD1() { }, yAxis: { type: 'category', - data: ['山西省', '浙江省', '北京市', '江西省', '江苏省', '福建省', '山东省', '天津市'], + data: dx, axisTick: { show: false, }, @@ -55,13 +55,14 @@ export default function createOptD1() { color: "#fff", }, }, + inverse: true }, series: [ { - name: '2011', + name: '用户区域分布', type: 'bar', - barWidth: 24, - data: [500, 1000, 2220, 3000, 4000, 3000,2200, 2600], + barWidth: 16, + data: ds, color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ offset: 0, color: '#010B19' diff --git a/src/views/ModelComparison/userAreaDistribution/opt2.js b/src/views/ModelComparison/userAreaDistribution/opt2.js index 178233f..ac59953 100644 --- a/src/views/ModelComparison/userAreaDistribution/opt2.js +++ b/src/views/ModelComparison/userAreaDistribution/opt2.js @@ -1,21 +1,12 @@ /* * @Author: your name * @Date: 2021-10-14 11:53:16 - * @LastEditTime: 2021-10-14 15:51:30 + * @LastEditTime: 2021-11-12 11:04:19 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: /data-show/src/views/WeiboDetails/weiboUserActiveArea/opt2.js */ -const ini_data = [];//初始化省份数组 -const provArr = ['河北', '河南', '云南', '辽宁', '黑龙江', '湖南', '安徽', '山东']; -//正则省份,将省与市的字眼去掉,框架不识别 -for (var i = 0; i < provArr.length; i++) { - var str = provArr[i]; - var re = /省|市/g; //全局匹配 - var str2 = { name: str.replace(re, ''), value: 5 };//拼接对象数组 - ini_data.push(str2); -} -export default function createOptD2() { +export default function createOptD2(provArr = []) { return { tooltip: { trigger: "item", @@ -59,7 +50,7 @@ export default function createOptD2() { }, series: [ { - name: "微博区域", + name: "用户区域分布", type: "map", mapType: "china", roam: false, @@ -95,38 +86,7 @@ export default function createOptD2() { // areaColor: '#3edffe' // } // }, - data: [ - { - name: "河北省", - value: 1000, - // selected: true, - }, - { - name: "浙江省", - value: 1100, - // selected: true - }, - { - name: "山东省", - value: 1200, - // selected: true - }, - { - name: "山西省", - value: 1300, - // selected: true - }, - { - name: "上海市", - value: 1400, - // selected: true - }, - { - name: "江苏省", - value: 1500, - // selected: true - } - ] + data: provArr } ] diff --git a/src/views/ModelComparison/weiboBigVComparison/index.vue b/src/views/ModelComparison/weiboBigVComparison/index.vue index f16b1f6..cb42ec1 100644 --- a/src/views/ModelComparison/weiboBigVComparison/index.vue +++ b/src/views/ModelComparison/weiboBigVComparison/index.vue @@ -1,13 +1,13 @@