prod
lily.zhang 3 years ago
parent 59cc2a5d36
commit d9ed2349bf

@ -0,0 +1,22 @@
/*
* @Author: your name
* @Date: 2021-11-11 15:12:31
* @LastEditTime: 2021-11-11 16:42: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
*/
import httpService from "@/request"
// 事件-事件分类
export function getEventsSeriesNameC(params) {
let obj = Object.assign({action: 'getEventsSeriesNameC',sType: 'HotEvent0528'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'post',
data: obj,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
})
}

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-10-21 11:36:36
* @LastEditTime: 2021-10-29 21:30:46
* @LastEditTime: 2021-11-11 15:03:09
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/utils/gol/bubbleWord.js
@ -113,7 +113,6 @@ export default function createWordCloud(obj) {
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
formatter: function (param) {
let data = param.data;
console.log(data)
return `<span>${data.name}</span><br><span>${data.value}</span>`
}
},

@ -1,13 +1,13 @@
<!--
* @Author: your name
* @Date: 2021-10-15 15:34:26
* @LastEditTime: 2021-11-11 10:45:28
* @LastEditTime: 2021-11-11 16:43:10
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/keyMediaCommunicationComparison/index.vue
-->
<template>
<div class="kmcc-outter">
<div class="kmcc-outter" v-loading="load">
<v-label-div title="重点媒体传播对比"> </v-label-div>
<div class="kmcc-inner">
<v-echarts :opt="opt"></v-echarts>
@ -22,6 +22,7 @@ export default {
name: "kmcc-outter",
data() {
return {
load: false,
form: {
token: "",
sBrand: "",
@ -46,7 +47,6 @@ export default {
getData() {
let obj = Object.assign({}, this.getCtime2, this.form);
getSourceCount0528C(obj).then((res) => {
let data = res.data;
this.opt = createOpt(data);
})

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-10-15 15:51:52
* @LastEditTime: 2021-11-11 16:24:21
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
@ -51,9 +51,9 @@ export default function createOpt(dataList = []) {
let info = createData(dataList);
return {
grid: {
left: 16,
right: 16,
bottom: 16,
left: 10,
right: '5%',
bottom: 10,
top: 56,
containLabel: true
},

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-11-05 13:49:05
* @LastEditTime: 2021-11-11 14:41:37
* @LastEditTime: 2021-11-11 14:55:29
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/BrandComparison.vue
@ -106,7 +106,7 @@ export default {
keyMediaCommunicationComparison, //
brandCommunicationTOPMedia, // TOP
overallWordCloudComparison, //
brandEventComparison, //
brandEventComparison, //
comparisonOfWeiboInformation, //
comparisonOfTheNumberOfWeiboInteractions, //
weiboBigVComparison, // V

@ -1,191 +1,155 @@
<!--
* @Author: your name
* @Date: 2021-10-15 17:33:28
* @LastEditTime: 2021-10-15 18:25:51
* @LastEditTime: 2021-11-11 15:59:58
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/brandEventComparison/index.vue
-->
<template>
<div class="bec-outter">
<v-label-div title="品牌事件对比"> </v-label-div>
<div class="bec-inner">
<v-echarts :opt="opt1"></v-echarts>
</div>
<v-label-div
title="事件上榜车型"
:showLine="false"
:eStyle="{ 'border-style': 'none' }"
>
</v-label-div>
<div class="bec-one">
<div class="bec-one-item" v-for="(item, index) in list" :key="index">
<span class="s1" :style="{ color: colors[index] }">{{
item.name
}}</span>
<div class="d1">
<v-echarts :opt="item.drawOpt"></v-echarts>
<div class="bec-outter">
<v-label-div title="车型事件对比"> </v-label-div>
<div class="bec-inner">
<v-label-div title="渠道声量对比" :showLine="false" :eStyle="{ 'border-style': 'none' }">
</v-label-div>
<div class="bec-inner-1">
<v-echarts :opt="opt1"></v-echarts>
</div>
</div>
<v-label-div title="事件分类" :showLine="false" :eStyle="{ 'border-style': 'none' }">
</v-label-div>
<div class="bec-one">
<v-echarts :opt="opt2"></v-echarts>
</div>
</div>
</div>
</div>
</template>
<script>
import { getSourcetypeC } from "@/api/BrandComparison/HotEvent.js";
import { getContrastCount0528C } from "@/api/BrandComparison/HotEvent.js";
import { createSideSingleColumn } from "@/utils/gol/sideSingleColumn";
import { getEventsSourceType0528 } from "@/api/ModelComparison";
import createOpt from "./opt";
export default {
name: "brandEventComparison",
data() {
return {
opt1: createOpt(),
form: {
token: "",
sBrand: "",
},
colors: [
"#3373CC",
"#63AECC",
"#54BF93",
"#CC9D12",
"#CC7733",
"#CC5B41",
],
list: [
{
name: "奥迪",
drawOpt: createSideSingleColumn(
["A4", "A3", "Q5", "A7", "A6"],
[400, 500, 600, 800, 1000],
"#3373CC"
),
},
{
name: "宝马",
drawOpt: createSideSingleColumn(
["520", "220", "S4", "525", "320"],
[400, 500, 600, 800, 1000],
"#63AECC"
),
},
{
name: "奔驰",
drawOpt: createSideSingleColumn(
["GML", "350", "S600", "SEL", "300"],
[400, 500, 600, 800, 1000],
"#54BF93"
),
},
{
name: "吉利",
drawOpt: createSideSingleColumn(
["330", "吉利星", "星耀", "星月", "帝豪"],
[400, 500, 600, 800, 1000],
"#CC9D12"
),
},
{
name: "大众",
drawOpt: createSideSingleColumn(
["途观", "速腾", "迈腾", "桑塔纳", "帕萨特"],
[400, 500, 600, 800, 1000],
"#CC7733"
),
name: "brandEventComparison",
data() {
return {
opt1: {},
opt2: {},
form: {
token: "",
sBrand: "",
sSeriesName: "",
iContrastType: 2,
},
colors: [
"#3373CC",
"#63AECC",
"#54BF93",
"#CC9D12",
"#CC7733",
"#CC5B41",
],
};
},
created() {
this.initData();
},
methods: {
initData() {
this.form.token = this.getToken;
let arr = this.getMComparison;
let brands = [];
let models = [];
arr.forEach((ele) => {
brands.push(ele.brand);
models.push(ele.model);
});
this.form.sBrand = brands.toString();
this.form.sSeriesName = models.toString();
this.getData();
this.getTypeData();
},
{
name: "别克",
drawOpt: createSideSingleColumn(
["凯悦", "奥克拉", "君悦", "君越", "君威"],
[400, 500, 600, 800, 1000],
"#CC5B41"
),
getData() {
return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCtime2, this.form);
getSourcetypeC(obj)
.then((res) => {
let data = res.data || [];
let dx = [];
data.forEach((ele) => {
let ab = ele.Data || {};
for(let key in ab) {
if(!dx.includes(key)) {
dx.push(key)
}
}
});
this.opt1 = createOpt(data, dx);
resolve(data);
})
.catch(() => {
reject(false);
});
});
},
],
};
},
created() {
this.initData();
},
methods: {
initData() {
this.form.token = this.getToken;
let arr = this.getBComparison;
let brands = [];
arr.forEach((ele) => {
brands.push(ele.name);
});
this.form.sBrand = brands.toString();
this.getData();
this.getTypeData();
},
getData() {
return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCtime2, this.form);
getSourcetypeC(obj)
.then((res) => {
let data = res.data || [];
let brandList = [];
data.forEach((e) => {
brandList.push(e.Name);
getTypeData() {
return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCtime2, this.form);
getEventsSourceType0528(obj)
.then((res) => {
let data = res.data || [];
let brandList = [];
data.forEach((e) => {
e.Name = e.key;
brandList.push(e.key);
});
this.opt2 = createOpt(data, brandList);
resolve(data);
})
.catch(() => {
reject(false);
});
});
this.opt1 = createOpt(data, brandList);
resolve(data);
})
.catch(() => {
reject(false);
});
});
},
getTypeData() {
return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCtime2, this.form);
getContrastCount0528C(obj)
.then((res) => {
let data = res.data || [];
resolve(data);
})
.catch(() => {
reject(false);
});
});
},
},
},
};
</script>
<style lang="less" scoped>
.bec-outter {
width: 100%;
height: auto;
border: 2px solid #0f2a4d;
margin-top: 16px;
.bec-inner {
width: 100%;
height: 412px;
}
.bec-one {
width: 100%;
height: 412px;
display: flex;
justify-content: flex-start;
.bec-one-item {
width: 314px;
height: 100%;
.s1 {
padding-left: 16px;
display: block;
height: 40px;
line-height: 40px;
color: #fff;
font-size: 18px;
}
.d1 {
height: auto;
border: 2px solid #0f2a4d;
margin-top: 16px;
.bec-inner {
width: 100%;
height: 412px;
.bec-inner-1 {
width: 100%;
height: calc(100% - 48px);
}
}
.bec-one {
width: 100%;
height: calc(100% - 40px);
}
height: 412px;
display: flex;
justify-content: flex-start;
.bec-one-item {
width: 314px;
height: 100%;
.s1 {
padding-left: 16px;
display: block;
height: 40px;
line-height: 40px;
color: #fff;
font-size: 18px;
}
.d1 {
width: 100%;
height: calc(100% - 40px);
}
}
}
}
}
</style>

@ -1,58 +1,121 @@
/*
* @Author: your name
* @Date: 2021-10-15 15:15:27
* @LastEditTime: 2021-10-15 17:43:04
* @LastEditTime: 2021-11-11 16:05:44
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/channelDistribution/opt.js
*/
/*series: [
import { bigNumberTransform } from "@/utils/gol/dataTool"
import * as echarts from "echarts";
let colors = [new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
name: '奥迪',
type: 'bar',
barGap: 0,
barWidth: 20,
emphasis: {
focus: 'series'
},
data: [320, 332, 301, 334, 390, 400]
},*/
function createData(dataList = []) {
offset: 0,
color: '#3373CC'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#63AECC'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#54BF93'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC9D12'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC7733'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC5B41'
},
{
offset: 1,
color: '#071a32'
}
], false)]
function createData(dataList = [], dx=[]) {
/*series: [
{
name: '奥迪',
type: 'bar',
barGap: 0,
barWidth: 16,
emphasis: {
focus: 'series'
},
data: [320, 332, 301, 334, 390, 400]
},*/
let arr = [];
dataList.forEach(ele => {
dataList.forEach(e => {
let a = [];
let Data = e.Data || {};
dx.forEach(e => {
a.push(Data[e])
})
let o = {
name: ele.Name,
name: e.Name,
type: 'bar',
barGap: 0,
barWidth: 20,
barWidth: 16,
barGap: '9%',
emphasis: {
focus: 'series'
},
data: [ele.Data.新闻,ele.Data.论坛,ele.Data.微信,ele.Data.APP,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 = []) {
let info = createData(dataList, dx);
return {
grid: {
top: "56px",
left: "16px",
right: "28px",
bottom: "16px",
top: 56,
left: 10,
right: "5%",
bottom: 10,
containLabel: true,
},
color: colors,
legend: {
data: brandList,
textStyle: { //图例文字的样式
color: '#fff'
color: '#fff',
fontSize: 10
},
y: 12,
x: 16
x: 16,
itemWidth: 12,
itemHeight: 12
},
tooltip: {
trigger: "axis",
@ -76,7 +139,7 @@ export default function createOpt(dataList = [], brandList = []) {
color: "#fff",
},
},
data: ['新闻', '论坛', '微信', 'APP', '微博', "其他"]
data: dx
}
],
yAxis: [
@ -88,6 +151,12 @@ export default function createOpt(dataList = [], brandList = []) {
color: "#FFF",
},
},
axisLabel: {
formatter: (value) => {
let str = bigNumberTransform(value);
return str;
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型

@ -0,0 +1,174 @@
/*
* @Author: your name
* @Date: 2021-11-11 15:26:24
* @LastEditTime: 2021-11-11 15:27:33
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /data-show/src/views/ModelComparison/brandEventComparison/opt1.js
*/
/*
* @Author: your name
* @Date: 2021-10-15 15:15:27
* @LastEditTime: 2021-11-11 15:25:56
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/channelDistribution/opt.js
*/
import { bigNumberTransform } from "@/utils/gol/dataTool"
import * as echarts from "echarts";
let colors = [new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#3373CC'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#63AECC'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#54BF93'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC9D12'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC7733'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC5B41'
},
{
offset: 1,
color: '#071a32'
}
], false)]
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.key,
type: 'bar',
barWidth: 16,
barGap: '9%',
emphasis: {
focus: 'series'
},
data: e.value
};
arr.push(o)
})
return arr;
}
export default function createOpt(dataList = [],brandList = []) {
let info = createData(dataList);
return {
grid: {
top: 56,
left: 10,
right: "5%",
bottom: 10,
containLabel: true,
},
color: colors,
legend: {
data: brandList,
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 12,
x: 16,
itemWidth: 12,
itemHeight: 12
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
},
xAxis: [
{
type: 'category',
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: ['新闻', '论坛', '微信', 'APP', '微博', "其他"]
}
],
yAxis: [
{
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: "#FFF",
},
},
axisLabel: {
formatter: (value) => {
let str = bigNumberTransform(value);
return str;
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
}
],
series: info
}
}

@ -1,86 +1,91 @@
<!--
* @Author: your name
* @Date: 2021-10-15 15:08:13
* @LastEditTime: 2021-11-11 14:25:23
* @LastEditTime: 2021-11-11 16:29:45
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/channelDistribution/index.vue
-->
<template>
<div class="cd-outter" v-loading="load">
<v-label-div title="渠道分布"> </v-label-div>
<div class="cd-inner">
<v-echarts :opt="opt"></v-echarts>
<div class="cd-outter" v-loading="load">
<v-label-div title="渠道分布"> </v-label-div>
<div class="cd-inner">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
</div>
</template>
<script>
import { getSourcetypeC } from "@/api/BrandComparison/index.js";
import createOpt from "./opt";
export default {
name: "channelDistribution",
data() {
return {
load: false,
form: {
token: "",
sBrand: "",
sSeriesName: "",
iContrastType: 2
},
opt: {},
};
},
created() {
this.initData();
},
methods: {
initData() {
this.form.token = this.getToken;
let arr = this.getMComparison;
let brands = [];
let models = [];
arr.forEach((ele) => {
brands.push(ele.brand);
models.push(ele.model);
});
this.form.sBrand = brands.toString();
this.form.sSeriesName =models.toString();
this.getData();
name: "channelDistribution",
data() {
return {
load: false,
form: {
token: "",
sBrand: "",
sSeriesName: "",
iContrastType: 2,
},
opt: {},
};
},
getData() {
return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCtime2, this.form);
this.load = true;
getSourcetypeC(obj)
.then((res) => {
let data = res.data || [];
let brandList = [];
data.forEach(e => {
brandList.push(e.Name)
})
this.opt = createOpt(data,brandList);
this.load = false;
resolve(data);
})
.catch(() => {
reject(false);
});
});
created() {
this.initData();
},
methods: {
initData() {
this.form.token = this.getToken;
let arr = this.getMComparison;
let brands = [];
let models = [];
arr.forEach((ele) => {
brands.push(ele.brand);
models.push(ele.model);
});
this.form.sBrand = brands.toString();
this.form.sSeriesName = models.toString();
this.getData();
},
getData() {
return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCtime2, this.form);
this.load = true;
getSourcetypeC(obj)
.then((res) => {
let data = res.data || [];
let dx = [];
data.forEach((ele) => {
let ab = ele.Data || {};
for (let key in ab) {
if (!dx.includes(key)) {
dx.push(key);
}
}
});
this.opt = createOpt(data, dx);
this.load = false;
resolve(data);
})
.catch(() => {
reject(false);
});
});
},
},
},
};
</script>
<style lang="less" scoped>
.cd-outter {
width: 936px;
height: 460px;
border: 2px solid #0f2a4d;
.cd-inner {
width: 100%;
height: calc(100% - 48px);
}
width: 936px;
height: 460px;
border: 2px solid #0f2a4d;
.cd-inner {
width: 100%;
height: calc(100% - 48px);
}
}
</style>

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-10-15 15:15:27
* @LastEditTime: 2021-11-11 14:48:43
* @LastEditTime: 2021-11-11 16:09:17
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/channelDistribution/opt.js
@ -63,7 +63,7 @@ let colors = [new echarts.graphic.LinearGradient(0, 0, 0, 1, [
color: '#071a32'
}
], false)]
function createData(dataList = []) {
function createData(dataList = [], dx=[]) {
/*series: [
{
name: '奥迪',
@ -77,6 +77,11 @@ function createData(dataList = []) {
},*/
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',
@ -85,14 +90,14 @@ 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 = []) {
let info = createData(dataList, dx);
return {
grid: {
top: 56,
@ -103,7 +108,6 @@ export default function createOpt(dataList = [],brandList = []) {
},
color: colors,
legend: {
data: brandList,
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
@ -135,7 +139,7 @@ export default function createOpt(dataList = [],brandList = []) {
color: "#fff",
},
},
data: ['新闻', '论坛', '微信', 'APP', '微博', "其他"]
data: dx
}
],
yAxis: [

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-10-15 15:34:26
* @LastEditTime: 2021-11-11 14:27:39
* @LastEditTime: 2021-11-11 16:27:27
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/keyMediaCommunicationComparison/index.vue
@ -53,16 +53,17 @@ export default {
let obj = Object.assign({}, this.getCtime2, this.form);
this.load = true;
getSourceCount0528C(obj).then((res) => {
let data = res.data;
let data = res.data || [];
let dx = [];
let ds = [];
data.forEach((ele) => {
let key = ele.key;
let value = ele.value;
dx.push(key);
ds.push(value);
let ab = ele.value || [];
ab.forEach(e => {
if (!dx.includes(e.key)) {
dx.push(e.key);
}
})
});
this.opt = createOpt(dx, ds);
this.opt = createOpt(dx, data);
this.load = false;
});
},

@ -1,128 +1,173 @@
/*
* @Author: your name
* @Date: 2021-10-09 11:01:19
* @LastEditTime: 2021-11-11 14:49:46
* @LastEditTime: 2021-11-11 16:41:48
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
*/
import * as echarts from "echarts";
import { bigNumberTransform } from "@/utils/gol/dataTool"
let colors = ['rgba(203,118,58,1)', 'rgba(202,156,17,1)', 'rgba(90,203,156,1)', 'rgba(99,173,204,1)', 'rgba(55,113,190,1)', "rgba(138,191,66,1)", 'rgba(181,191,67,1)', 'rgba(203,91,65,1)']
let colors2 = ['rgba(203,118,58,0.6)', 'rgba(202,156,17,0.6)', 'rgba(90,203,156,0.6)', 'rgba(99,173,204,0.6)', 'rgba(55,113,190,0.6)', "rgba(138,191,66,0.6)", 'rgba(181,191,67,0.6)', 'rgba(203,91,65,0.6)']
function createData(ds = []) {
let colors = [new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#3373CC'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#63AECC'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#54BF93'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC9D12'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC7733'
},
{
offset: 1,
color: '#071a32'
}
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#CC5B41'
},
{
offset: 1,
color: '#071a32'
}
], false)]
function createData(dataList = [], dx=[]) {
/*series: [
{
name: '奥迪',
type: 'bar',
barGap: 0,
barWidth: 16,
emphasis: {
focus: 'series'
},
data: [320, 332, 301, 334, 390, 400]
},*/
let arr = [];
for (let i = 0; i < ds.length; i++) {
let arr1 = ds[i];
for (let j = 0; j < arr1.length; j++) {
let n = arr.findIndex(ele => {
return ele.name === arr1[j].key;
dataList.forEach(ele => {
let a = [];
let Data = ele.value || [];
dx.forEach(e => {
Data.forEach(ex => {
if(ex.key === e) {
a.push(ex.value)
}
})
})
if(n === -1) {
let obj =
{
name: arr1[j].key,
let o = {
name: ele.key,
type: 'bar',
barWidth: 16,
barGap: -100,
stack: 'total',
barWidth: 24,
barGap: "-100%",
emphasis: {
focus: 'series'
focus: 'series'
},
itemStyle: {
normal: {
//柱体的颜色
//右1000表示从正右开始向左渐变
color: function () {
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[j]
},
{
offset: 1,
color: colors2[j]
}
], false);
}
}
},
data: [arr1[j].value]
}
arr.push(obj)
} else {
arr[n].data.push(arr1[j].value)
}
}
}
data: a
};
arr.push(o)
})
return arr;
}
export default function createOpt(dx=[], ds=[]) {
const data = createData(ds);
return {
grid: {
left: 10,
right: '5%',
bottom: 10,
top: 56,
containLabel: true
export default function createOpt(dx = [], ds = []) {
const data = createData(ds,dx);
console.log(data)
return {
grid: {
left: 10,
right: '5%',
bottom: 10,
top: 56,
containLabel: true
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
color: colors,
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 16,
itemWidth: 12,
itemHeight: 12
},
xAxis: {
type: 'category',
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
tooltip: {
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;"
},
data: dx
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
legend: {
textStyle: { //图例文字的样式
color: '#fff',
fontSize: 10
},
y: 10,
x: 16,
itemWidth: 12,
itemHeight: 12
},
xAxis: {
type: 'category',
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: dx
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
axisLabel: {
formatter: (value) => {
let str = bigNumberTransform(value);
return str;
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
},
},
axisLabel: {
formatter: (value) => {
let str = bigNumberTransform(value);
return str;
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
color: "#012b4b",
},
series: data
}
},
},
series: data
}
}

@ -1,13 +1,13 @@
<!--
* @Author: your name
* @Date: 2021-10-15 16:56:32
* @LastEditTime: 2021-10-15 17:31:34
* @LastEditTime: 2021-11-11 16:44:15
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandComparison/overallWordCloudComparison/index.vue
-->
<template>
<div class="owcc-outter">
<div class="owcc-outter" v-loading="load">
<v-label-div title="整体词云对比"> </v-label-div>
<div class="owcc-inner">
<div class="owcc-item" v-for="(item, index) in dataSource" :key="index">
@ -38,9 +38,12 @@ export default {
data() {
return {
opt: {},
load: false,
form: {
token: "",
sBrand: "",
sSeriesName: "",
iContrastType: 2
},
colors: [
"#3373CC",
@ -59,16 +62,20 @@ export default {
methods: {
initData() {
this.form.token = this.getToken;
let arr = this.getBComparison;
let arr = this.getMComparison;
let brands = [];
let models = [];
arr.forEach((ele) => {
brands.push(ele.name);
brands.push(ele.brand);
models.push(ele.model);
});
this.form.sBrand = brands.toString();
this.form.sSeriesName = models.toString();
this.getData();
},
getData() {
return new Promise((resolve, reject) => {
this.load = true;
let obj = Object.assign({}, this.getCtime2, this.form);
getPositiveAndNegative0528C(obj)
.then((res) => {
@ -85,7 +92,7 @@ export default {
arr.push(obj);
})
this.dataSource = arr;
this.load = false;
resolve(data);
})
.catch(() => {

Loading…
Cancel
Save