Merge branch 'dev' of git.oa00.com:SWS/carInsightSystem into dev

* 'dev' of git.oa00.com:SWS/carInsightSystem:
  zx-事件对比
  no message
prod
lily.zhang 3 years ago
commit 797198a57d

@ -1,8 +1,8 @@
import httpService from "@/request" import httpService from "@/request"
// 获取事件类型 // 微博调性对比
export function getAffectionsC(params) { export function getAffectionsC(params) {
let obj = Object.assign({action: 'getAffectionsC', sType: 'BrandWeiBo'}, params) let obj = Object.assign({action: 'getAffectionsC', sType: 'BrandWeiBo', iContrastType: 3}, params)
return httpService({ return httpService({
url: `/api/v6.ashx`, url: `/api/v6.ashx`,
method: 'post', method: 'post',

@ -85,8 +85,8 @@ export function getListC(params) {
} }
// 事件-正面词云 // 事件-正面词云
export function getPositive(params) { export function getPositiveC(params) {
let obj = Object.assign({action: 'getPositive', sType: 'EventContrast', iContrastType: 3 }, params) let obj = Object.assign({action: 'getPositiveC', sType: 'EventContrast',iContrastType: 3 }, params)
return httpService({ return httpService({
url: `/api/v6.ashx`, url: `/api/v6.ashx`,
method: 'post', method: 'post',
@ -98,8 +98,8 @@ export function getPositive(params) {
} }
// 事件-负面词云 // 事件-负面词云
export function getNegative(params) { export function getNegativeC(params) {
let obj = Object.assign({action: 'getNegative', sType: 'EventContrast', iContrastType: 3 }, params) let obj = Object.assign({action: 'getNegativeC', sType: 'EventContrast',iContrastType: 3 }, params)
return httpService({ return httpService({
url: `/api/v6.ashx`, url: `/api/v6.ashx`,
method: 'post', method: 'post',

@ -38,12 +38,12 @@ export default function createOpt(arr = []) {
{ {
name: 'Access From0', name: 'Access From0',
type: 'pie', type: 'pie',
radius: ['70%', '92%'], radius: ['63%', '77%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: false, show: false,
position: 'center', position: 'center',
lineHeight: 40 lineHeight: 32
}, },
emphasis: { emphasis: {
label: { label: {
@ -64,7 +64,7 @@ export default function createOpt(arr = []) {
{ {
name: 'Access From1', name: 'Access From1',
type: 'pie', type: 'pie',
radius: ['96%', '100%'], radius: ['80%', '84%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: false, show: false,

@ -7,7 +7,7 @@
* @FilePath: /data-show/src/views/EventComparison/positiveAndNegativeWordCloudContrast/index.vue * @FilePath: /data-show/src/views/EventComparison/positiveAndNegativeWordCloudContrast/index.vue
--> -->
<template> <template>
<div class="panwc-outter"> <div class="panwc-outter" v-loading="load">
<div class="panwc-inner"> <div class="panwc-inner">
<div class="panwc-d1"> <div class="panwc-d1">
<v-label-div <v-label-div
@ -15,11 +15,14 @@
:showLine="false" :showLine="false"
:eStyle="{ 'border-style': 'none' }" :eStyle="{ 'border-style': 'none' }"
> >
<v-tab-group :btns="['正面', '负面']"></v-tab-group> <v-tab-group
:btns="['正面', '负面']"
@change="handlerTab1"
></v-tab-group>
</v-label-div> </v-label-div>
<span class="p-d1-s1">事件一</span> <span class="p-d1-s1">{{ eventData1.name }}</span>
<div class="panwc-inner"> <div class="panwc-inner">
<v-echarts :opt="opt"></v-echarts> <v-echarts :opt="opt1"></v-echarts>
</div> </div>
</div> </div>
<div class="panwc-d1"> <div class="panwc-d1">
@ -28,11 +31,16 @@
:showLine="false" :showLine="false"
:eStyle="{ 'border-style': 'none' }" :eStyle="{ 'border-style': 'none' }"
> >
<v-tab-group :btns="['正面', '负面']"></v-tab-group> <v-tab-group
:btns="['正面', '负面']"
@change="handlerTab2"
></v-tab-group>
</v-label-div> </v-label-div>
<span class="p-d1-s1" style="color: #54bf93">事件二</span> <span class="p-d1-s1" style="color: #54bf93">{{
eventData2.name
}}</span>
<div class="panwc-inner"> <div class="panwc-inner">
<v-echarts :opt="opt"></v-echarts> <v-echarts :opt="opt2"></v-echarts>
</div> </div>
</div> </div>
</div> </div>
@ -40,19 +48,31 @@
</template> </template>
<script> <script>
import { getNegative } from "@/api/EventComparison"; import { getNegativeC } from "@/api/EventComparison/index.js";
import { getPositive } from "@/api/EventComparison"; import { getPositiveC } from "@/api/EventComparison/index.js";
//import createWordCloud from "@/utils/gol/bubbleWord"; import createWordCloud from "@/utils/gol/bubbleWord";
import createOpt from "./opt"; //import createOpt from "./opt";
export default { export default {
name: "positiveAndNegativeWordCloudContrast", name: "positiveAndNegativeWordCloudContrast",
data() { data() {
return { return {
opt: createOpt(), opt1: {},
opt2: {},
form: { form: {
token: "", token: "",
sRele: "", sRele: "",
}, },
eventData1: {
name: "",
positive: {},
negative: {},
},
eventData2: {
name: "",
positive: {},
negative: {},
},
load: false,
}; };
}, },
created() { created() {
@ -69,19 +89,24 @@ export default {
this.getData(); this.getData();
}, },
getData() { getData() {
this.load = true;
Promise.all([this.getPoz(), this.getNeg()]).then(() => { Promise.all([this.getPoz(), this.getNeg()]).then(() => {
// this.handlerTab1(0);
//this.handlerTab(0); this.handlerTab2(0);
//this.load = false; this.load = false;
}); });
}, },
getPoz() { getPoz() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCtime2, this.form); let obj = Object.assign({}, this.getCtime2, this.form);
getPositive(obj) getPositiveC(obj)
.then((res) => { .then((res) => {
let data = res.data || {}; let data = res.data;
resolve(data); this.eventData1.name = data[0].Name;
this.eventData2.name = data[1].Name;
this.eventData1.positive = data[0].Data;
this.eventData2.positive = data[1].Data;
resolve(res);
}) })
.catch(() => { .catch(() => {
reject(false); reject(false);
@ -91,16 +116,32 @@ export default {
getNeg() { getNeg() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCtime2, this.form); let obj = Object.assign({}, this.getCtime2, this.form);
getNegative(obj) getNegativeC(obj)
.then((res) => { .then((res) => {
let data = res.data || {}; let data = res.data;
resolve(data); this.eventData1.negative = data[0].Data;
this.eventData2.negative = data[1].Data;
resolve(res);
}) })
.catch(() => { .catch(() => {
reject(false); reject(false);
}); });
}); });
}, },
handlerTab1(n) {
if (n === 0) {
this.opt1 = createWordCloud(this.eventData1.positive);
} else if (n === 1) {
this.opt1 = createWordCloud(this.eventData1.negative);
}
},
handlerTab2(n) {
if (n === 0) {
this.opt2 = createWordCloud(this.eventData2.positive);
} else if (n === 1) {
this.opt2 = createWordCloud(this.eventData2.negative);
}
},
}, },
}; };
</script> </script>

@ -8,13 +8,13 @@
--> -->
<template> <template>
<div class="wtcEc-outter"> <div class="wtcEc-outter" v-loading="load">
<v-label-div <v-label-div
title="微博调性对比" title="微博调性对比"
:showLine="false" :showLine="false"
:eStyle="{ 'border-style': 'none' }" :eStyle="{ 'border-style': 'none' }"
> >
<v-tab-group :btns="['事件1', '事件2']"></v-tab-group> <v-tab-group :btns="eventList" @change="handlerTab"></v-tab-group>
</v-label-div> </v-label-div>
<div class="wtcEc-inner"> <div class="wtcEc-inner">
<v-echarts :opt="opt"></v-echarts> <v-echarts :opt="opt"></v-echarts>
@ -29,12 +29,36 @@ export default {
name: "wtcEc", name: "wtcEc",
data() { data() {
return { return {
opt: createOpt(), opt: {},
form: { form: {
token: "", token: "",
sRele: "", sRele: "",
}, },
sourceData: [] load: false,
colors: [
"#54BF93",
"#3373CC",
"#CC9D12",
"#f15c80",
"#e4d354",
"#8085e8",
"#8d4653",
"#91e8e1",
"#f7a35c",
"#90ed7d",
"#54BF93",
"#3373CC",
"#CC9D12",
"#f15c80",
"#e4d354",
"#8085e8",
"#8d4653",
"#91e8e1",
"#f7a35c",
"#90ed7d",
],
eventList: [],
showData: []
}; };
}, },
created() { created() {
@ -52,11 +76,42 @@ export default {
}, },
getData() { getData() {
let obj = Object.assign({}, this.getCtime2, this.form); let obj = Object.assign({}, this.getCtime2, this.form);
this.load = true;
getAffectionsC(obj).then((res) => { getAffectionsC(obj).then((res) => {
let data = res.data || []; let data = res.data || [];
this.sourceData = data; let eList = [];
let dList = [];
data.forEach(e => {
let subStr = e.Name;
if(subStr.length > 5){
eList.push(subStr.substr(0, 4))
} else {
eList.push(subStr)
}
dList.push(this.toArr(e.Data))
})
this.eventList = eList;
this.showData = dList;
this.opt = createOpt(this.showData[0],this.colors);
this.load = false;
}); });
}, },
//
toArr(obj) {
let arr = [];
for (let key in obj) {
let o = {
key: key,
value: obj[key],
};
arr.push(o);
}
return arr;
},
//
handlerTab(n) {
this.opt = createOpt(this.showData[n],this.colors);
},
}, },
}; };
</script> </script>

@ -6,8 +6,33 @@
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: /data-show/src/views/BrandInsight/weiboKol/opt.js * @FilePath: /data-show/src/views/BrandInsight/weiboKol/opt.js
*/ */
function createData(ds = [], colors) {
let arr = [];
ds.map((ele, index) => {
let obj = {
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: colors[index]
}])
}
}
arr.push(obj)
})
return arr;
}
import * as echarts from "echarts"; import * as echarts from "echarts";
export default function createOpt() { export default function createOpt(ds = [], color = []) {
const data = createData(ds, color);
return { return {
legend: { legend: {
textStyle: { //图例文字的样式 textStyle: { //图例文字的样式
@ -20,12 +45,12 @@ export default function createOpt() {
{ {
name: 'Access From0', name: 'Access From0',
type: 'pie', type: 'pie',
radius: ['60%', '70%'], radius: ['50%', '61%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: false, show: false,
position: 'center', position: 'center',
lineHeight: 40 lineHeight: 32
}, },
emphasis: { emphasis: {
label: { label: {
@ -34,48 +59,19 @@ export default function createOpt() {
color: "#ffff", color: "#ffff",
fontWeight: 'bold', fontWeight: 'bold',
formatter: function(p) { formatter: function(p) {
return `${p.data.name}\n25%\n${p.data.value}` return `${p.data.name}\n${p.percent}%\n${p.data.value}`
} }
} }
}, },
labelLine: { labelLine: {
show: false show: false
}, },
data: [ data: data
{ value: 2000, name: '正面', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
//给颜色设置渐变色 前面4个参数给第一个设置1第四个设置0 ,就是水平渐变
//给第一个设置0第四个设置1就是垂直渐变
offset: 0,
color: 'black'
}, {
offset: 1,
color: '#3373CC'
}])} },
{ value: 1000, name: '中性', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
//给颜色设置渐变色 前面4个参数给第一个设置1第四个设置0 ,就是水平渐变
//给第一个设置0第四个设置1就是垂直渐变
offset: 0,
color: 'black'
}, {
offset: 1,
color: '#54BF93'
}])} },
{ value: 1000, name: '负面', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
//给颜色设置渐变色 前面4个参数给第一个设置1第四个设置0 ,就是水平渐变
//给第一个设置0第四个设置1就是垂直渐变
offset: 0,
color: 'black'
}, {
offset: 1,
color: '#b38b14'
}])} },
],
}, },
{ {
name: 'Access From1', name: 'Access From1',
type: 'pie', type: 'pie',
radius: ['74%', '78%'], radius: ['64%', '67%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: false, show: false,
@ -85,37 +81,7 @@ export default function createOpt() {
show: false show: false
}, },
center: ['50%', '50%'],//边框位置 center: ['50%', '50%'],//边框位置
data: [ data: data
{ value: 2000, name: '正面', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
//给颜色设置渐变色 前面4个参数给第一个设置1第四个设置0 ,就是水平渐变
//给第一个设置0第四个设置1就是垂直渐变
offset: 0,
color: 'black'
}, {
offset: 1,
color: '#3373CC'
}])} },
{ value: 1000, name: '中性', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
//给颜色设置渐变色 前面4个参数给第一个设置1第四个设置0 ,就是水平渐变
//给第一个设置0第四个设置1就是垂直渐变
offset: 0,
color: 'black'
}, {
offset: 1,
color: '#54BF93'
}])} },
{ value: 1000, name: '负面', itemStyle: {color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
//给颜色设置渐变色 前面4个参数给第一个设置1第四个设置0 ,就是水平渐变
//给第一个设置0第四个设置1就是垂直渐变
offset: 0,
color: 'black'
}, {
offset: 1,
color: '#b38b14'
}])} },
],
} }
] ]
} }

@ -9,7 +9,7 @@
<template> <template>
<div class="iss-outter"> <div class="iss-outter">
<v-label-div title="事件传播态势"> <v-label-div title="事件传播态势">
<a-select v-model="form.sTimeType" :size="$vuiSize" style="width: 7rem; margin-left: 2.2rem; margin-right: 0.5rem" @change="handleChange"> <a-select v-model="form.sTimeType" :size="$vuiSize" style="width: 7rem; margin-left: 2.2rem; margin-right: 0.5rem" @change="handleChange">
<a-select-option :style="{ color: '#fff' }" v-for="item in selDatas" :value="item.key" :key="item.key"> <a-select-option :style="{ color: '#fff' }" v-for="item in selDatas" :value="item.key" :key="item.key">
{{ item.value }} {{ item.value }}
</a-select-option> </a-select-option>
@ -26,24 +26,24 @@ import createOpt from "./opt";
import { getSourcetypeTime } from "@/api/EventdEC"; import { getSourcetypeTime } from "@/api/EventdEC";
export default { export default {
name: "incidentSpreadSituation", name: "incidentSpreadSituation",
props: {
id: {
type: String,
default: "",
},
},
data() { data() {
return { return {
props: {
id: {
type: String,
default: "",
},
},
opt: {}, opt: {},
selDatas: [ selDatas: [
{ {
key: 34, key: 34,
value: '小时' value: "小时",
}, },
{ {
key: 20, key: 20,
value: '天' value: "天",
} },
], ],
form: { form: {
token: "", token: "",
@ -56,7 +56,6 @@ export default {
this.form.token = this.getToken; this.form.token = this.getToken;
this.form.sRele = this.id; this.form.sRele = this.id;
this.getDdta(); this.getDdta();
}, },
methods: { methods: {
getDdta() { getDdta() {
@ -78,7 +77,7 @@ export default {
}, },
// //
handleChange() { handleChange() {
this.getDdta(); this.getDdta();
}, },
}, },
}; };

@ -62,7 +62,6 @@ export default {
return newArray; return newArray;
}, },
getData() { getData() {
this.load = true;
let obj = Object.assign({}, this.form); let obj = Object.assign({}, this.form);
getWebsite(obj).then((res) => { getWebsite(obj).then((res) => {
let data = res.data; let data = res.data;
@ -74,7 +73,6 @@ export default {
let groupedArray = this.group(vals, 5); let groupedArray = this.group(vals, 5);
this.d1 = groupedArray[0]; this.d1 = groupedArray[0];
this.d2 = groupedArray[1]; this.d2 = groupedArray[1];
this.load = false;
}); });
}, },
}, },

@ -79,7 +79,9 @@ export default {
bigNumberTransform: bigNumberTransform, bigNumberTransform: bigNumberTransform,
opt: {}, opt: {},
load: false, load: false,
sum: "", total: 0,
sum: 0,
volume: 0,
form: { form: {
token: "", token: "",
sRele: "", sRele: "",
@ -141,7 +143,6 @@ export default {
}); });
let o = { nodes, edges }; let o = { nodes, edges };
this.opt = createOpt(o); this.opt = createOpt(o);
// this.countObj = Object.assign(this.countObj, data);
}); });
}, },
}, },

@ -44,17 +44,11 @@ export default {
load: false, load: false,
opt: {}, opt: {},
type: 0, type: 0,
props: {
id: {
type: String,
default: "",
},
},
form: { form: {
token: "", token: "",
sRele: "", sRele: "",
}, },
count: 0,
config: {}, config: {},
}; };
}, },

Loading…
Cancel
Save