bug修改

This commit is contained in:
qiudan 2023-10-31 15:34:09 +08:00
parent 33ea88f35e
commit 4f12905530
14 changed files with 857 additions and 692 deletions

View File

@ -38,7 +38,7 @@
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
// var fullscreenButton = document.querySelector("#unity-fullscreen-button");
var warningBanner = document.querySelector("#unity-warning");
var black = document.querySelector("#black");
// Shows a temporary message banner/ribbon for a few seconds, or

View File

@ -25,6 +25,18 @@
export default {
name: 'lineChart', //线
props: {
itemData: {
type: Object,
default() {
return {};
}
},
originalDataArr: {
type: Array,
default() {
return [];
}
},
list: {
type: Array,
default() {
@ -78,6 +90,7 @@ export default {
};
},
created() {
// console.log(this.componentName + '-' + JSON.stringify(this.itemData));
// console.log( this.componentName + '-' + this.chartName + '-' + '线','40');
},
@ -237,18 +250,32 @@ export default {
});
series[0].data = mapNR1;
} else if (title === '速度') {
let unit = 'km/h';
if (this.originalDataArr.length > 0) {
if (this.originalDataArr[0].speed >= 0) {
unit = 'km/h';
} else {
unit = 'pix/s';
}
}
this.tooltip = {
formatter: '{a} {b}:{c}km/h',
formatter: `{a} {b}:{c}${unit}`,
show: true,
confine: true
};
this.name = 'km/h';
// console.log("newVal",newVal)
this.name = unit;
// console.log(this.status + '--' + JSON.stringify(newVal));
series[0].data = newVal.map((val) => {
if (val.speed == -1) {
return '-';
}
return val.speed;
});
} else if (title === '流量') {
this.name = '辆/10秒';
this.name = '辆';
if (this.status != '实时触发') {
this.name = `辆/${this.itemData.cycleInterval}${this.itemData.unit}`;
}
series[0].data = newVal.map((ele) => {
return ele.in_flow + ele.out_flow;
});
@ -268,6 +295,9 @@ export default {
});
} else if (title === '排队数') {
this.name = '辆';
if (this.status != '实时触发') {
this.name = `辆/${this.itemData.cycleInterval}${this.itemData.unit}`;
}
series[0].data = newVal.map((val) => {
// return val.n_queue;
if (timeMode == '固定间隔') {
@ -278,6 +308,9 @@ export default {
});
} else if (title === '检测数') {
this.name = '辆';
if (this.status != '实时触发') {
this.name = `辆/${this.itemData.cycleInterval}${this.itemData.unit}`;
}
series[0].data = newVal.map((val) => {
if (timeMode == '固定间隔') {
return val.ave_stay;

View File

@ -1,456 +1,480 @@
<template>
<div :id="echartsRef" ref="echartsLine"></div>
<div :id="echartsRef" ref="echartsLine"></div>
</template>
<script>
export default {
name: "echartsLine", //线
props: {
intersectionName: {
type: Array,
default() {
return [];
},
name: 'echartsLine', //线
props: {
itemData: {
type: Object,
default() {
return {};
}
},
intersectionName: {
type: Array,
default() {
return [];
}
},
chatShowType: {
type: String
},
echartsRef: {
type: String
},
//
timeMode: {
type: String
},
componentType: {
type: String
}, //
dataList: {
type: Array,
default() {
return [];
}
}, //
flowType: {
type: String
} //
},
chatShowType: {
type: String,
data() {
return {
chart: null,
chartData: {
yData: [],
xData: []
}, //
seriesList: [], //
typeData: [],
title: ''
};
},
echartsRef: {
type: String,
},
//
timeMode: {
type: String,
},
componentType: {
type: String,
}, //
dataList: {
type: Array,
default() {
return [];
},
}, //
flowType: {
type: String,
}, //
},
data() {
return {
chart: null,
chartData: {
yData: [],
xData: [],
}, //
seriesList: [], //
typeData: [],
title:'',
};
},
created() {
},
created() {},
methods: {
//
extractKeyValues(arr, key) {
return arr.map((item) => item[key]);
},
//
dataProcessing(val) {
if (val.length > 10) {
val = val.slice(-10);
}
if (val != null) {
if (this.timeMode == "实时触发") {
if (this.componentType == "车头时距") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "headway");
} else if (this.componentType == "流量") {
if (this.flowType == "入流") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "in_flow");
} else if (this.flowType == "出流") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "out_flow");
methods: {
//
extractKeyValues(arr, key) {
return arr.map((item) => item[key]);
},
//
dataProcessing(val) {
if (val.length > 10) {
val = val.slice(-10);
}
} else if (this.componentType == "速度") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "speed");
} else if (this.componentType == "类型") {
this.chartData.xData = this.extractKeyValues(val, "time");
let seriesArr = this.extractKeyValues(val, "type_data");
const transformedData = [];
for (let i = 0; i < seriesArr[0].length; i++) {
const item = seriesArr[0][i]; //quantity
const valueList = seriesArr.map((arr) => arr[i].value);
transformedData.push({
name: item.name,
value: valueList,
});
if (val != null) {
if (this.timeMode == '实时触发') {
if (this.componentType == '车头时距') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'headway');
} else if (this.componentType == '流量') {
if (this.flowType == '入流') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'in_flow');
} else if (this.flowType == '出流') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'out_flow');
}
} else if (this.componentType == '速度') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'speed');
} else if (this.componentType == '类型') {
this.chartData.xData = this.extractKeyValues(val, 'time');
let seriesArr = this.extractKeyValues(val, 'type_data');
const transformedData = [];
for (let i = 0; i < seriesArr[0].length; i++) {
const item = seriesArr[0][i]; //quantity
const valueList = seriesArr.map((arr) => arr[i].value);
transformedData.push({
name: item.name,
value: valueList
});
}
const totalCountList = transformedData[0].value.map((_, i) => {
return transformedData.reduce((sum, curr) => sum + curr.value[i], 0);
});
transformedData.push({
name: '总数',
value: totalCountList
});
this.seriesList = transformedData;
} else if (this.componentType == '检测数') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'n_stay');
} else if (this.componentType == '排队数') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'n_queue');
}
} else if (this.timeMode == '固定时刻') {
if (this.componentType == '车头时距') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'headway');
} else if (this.componentType == '流量') {
if (this.flowType == '入流') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'in_flow');
} else if (this.flowType == '出流') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'out_flow');
}
} else if (this.componentType == '速度') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'speed');
} else if (this.componentType == '类型') {
this.chartData.xData = this.extractKeyValues(val, 'time');
let seriesArr = this.extractKeyValues(val, 'type_data');
const transformedData = [];
for (let i = 0; i < seriesArr[0].length; i++) {
const item = seriesArr[0][i];
const valueList = seriesArr.map((arr) => arr[i].quantity);
transformedData.push({
name: item.name,
value: valueList
});
}
const totalCountList = transformedData[0].value.map((_, i) => {
return transformedData.reduce((sum, curr) => sum + curr.value[i], 0);
});
transformedData.push({
name: '总数',
value: totalCountList
});
this.seriesList = transformedData;
} else if (this.componentType == '检测数') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'n_stay');
} else if (this.componentType == '排队数') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'n_queue');
}
} else if (this.timeMode == '固定间隔') {
if (this.componentType == '车头时距') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'ave_headway');
} else if (this.componentType == '流量') {
if (this.flowType == '入流') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'in_flow');
} else if (this.flowType == '出流') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'out_flow');
}
} else if (this.componentType == '速度') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'speed');
} else if (this.componentType == '类型') {
this.chartData.xData = this.extractKeyValues(val, 'time');
let seriesArr = this.extractKeyValues(val, 'type_data');
const transformedData = [];
for (let i = 0; i < seriesArr[0].length; i++) {
const item = seriesArr[0][i];
const valueList = seriesArr.map((arr) => arr[i].quantity);
transformedData.push({
name: item.name,
value: valueList
});
}
const totalCountList = transformedData[0].value.map((_, i) => {
return transformedData.reduce((sum, curr) => sum + curr.value[i], 0);
});
transformedData.push({
name: '总数',
value: totalCountList
});
this.seriesList = transformedData;
} else if (this.componentType == '延误') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'ave_delay');
} else if (this.componentType == '检测数') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'ave_stay');
} else if (this.componentType == '排队数') {
this.chartData.xData = this.extractKeyValues(val, 'time');
this.chartData.yData = this.extractKeyValues(val, 'ave_queue');
}
}
} else {
return false;
}
const totalCountList = transformedData[0].value.map((_, i) => {
return transformedData.reduce((sum, curr) => sum + curr.value[i], 0);
});
transformedData.push({
name: "总数",
value: totalCountList,
});
this.seriesList = transformedData;
} else if (this.componentType == "检测数") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "n_stay");
} else if (this.componentType == "排队数") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "n_queue");
}
} else if (this.timeMode == "固定时刻") {
if (this.componentType == "车头时距") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "headway");
} else if (this.componentType == "流量") {
if (this.flowType == "入流") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "in_flow");
} else if (this.flowType == "出流") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "out_flow");
},
//
initEcharts() {
if (this.componentType == '流量') {
this.title = '辆';
if (this.timeMode != '实时触发') {
this.title = `辆/${this.itemData.cycleInterval}${this.itemData.unit}`;
}
} else if (this.componentType == '速度') {
if (this.dataList.length > 0) {
// console.log(this.dataList[0].originalSpeed,'')
if (this.dataList[0].originalSpeed >= 0) {
this.title = 'km/h';
} else {
this.title = 'pix/s';
}
}
} else if (this.componentType == '排队数') {
this.title = '辆';
if (this.timeMode != '实时触发') {
this.title = `辆/${this.itemData.cycleInterval}${this.itemData.unit}`;
}
} else if (this.componentType == '检测数') {
this.title = '辆';
if (this.timeMode != '实时触发') {
this.title = `辆/${this.itemData.cycleInterval}${this.itemData.unit}`;
}
} else if (this.componentType == '延误') {
this.title = '秒';
} else if (this.componentType == '拥堵') {
this.title = '秒';
} else if (this.componentType == '车头时距') {
this.title = '秒';
} else {
this.title = '';
}
} else if (this.componentType == "速度") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "speed");
} else if (this.componentType == "类型") {
this.chartData.xData = this.extractKeyValues(val, "time");
let seriesArr = this.extractKeyValues(val, "type_data");
const transformedData = [];
for (let i = 0; i < seriesArr[0].length; i++) {
const item = seriesArr[0][i];
const valueList = seriesArr.map((arr) => arr[i].quantity);
transformedData.push({
name: item.name,
value: valueList,
});
// let slicedData = [];
// if (data != undefined && data.length > 5) {
// slicedData =data.slice(-5); // 10
// } else {
// slicedData = data; // 10
// }
if (this.componentType == '类型') {
this.typeData.push({ type_data: this.dataList[0].type_data, time: this.dataList[0].time });
this.dataProcessing(this.typeData);
} else {
this.dataProcessing(this.dataList);
}
const totalCountList = transformedData[0].value.map((_, i) => {
return transformedData.reduce((sum, curr) => sum + curr.value[i], 0);
});
transformedData.push({
name: "总数",
value: totalCountList,
});
this.seriesList = transformedData;
} else if (this.componentType == "检测数") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "n_stay");
} else if (this.componentType == "排队数") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "n_queue");
}
} else if (this.timeMode == "固定间隔") {
if (this.componentType == "车头时距") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "ave_headway");
} else if (this.componentType == "流量") {
if (this.flowType == "入流") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "in_flow");
} else if (this.flowType == "出流") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "out_flow");
// let myChart = this.$echarts.getInstanceByDom(document.getElementById(this.echartsRef));
// if (myChart == null) {
// myChart = this.$echarts.init(document.getElementById(this.echartsRef));
// }
let myChart = this.chart;
// let myChart = this.$echarts.init(document.getElementById('echartsLine'));
var seriesList = [];
var color = ['#0CD2E6', '#3751E6', '#FFC722', 'rgb(255,115,38)'];
if (this.componentType == '类型') {
for (let i = 0; i < this.seriesList.length; i++) {
seriesList.push({
name: this.seriesList[i].name,
type: 'line',
data: this.seriesList[i].value,
symbolSize: 8, //
lineStyle: {
color: color[i],
width: 3,
shadowColor: 'rgba(255,115,38,0.17)', //线
shadowBlur: 5,
shadowOffsetY: 9
},
itemStyle: {
//线
color: color[i],
borderColor: color[i],
borderWidth: 2
},
smooth: 0.4,
emphasis: {
scale: 1.5
}
});
}
} else {
seriesList = [
{
// name: '_1-zone2-线-',
type: 'line',
data: this.chartData.yData.reverse(),
symbolSize: 8, //
lineStyle: {
color: 'rgb(255,115,38)',
width: 3,
shadowColor: 'rgba(255,115,38,0.17)', //线
shadowBlur: 5,
shadowOffsetY: 9
},
itemStyle: {
//线
color: 'rgb(255,115,38)',
borderColor: 'rgb(255,115,38)',
borderWidth: 2
},
smooth: 0.4,
emphasis: {
scale: 1.5
}
}
];
}
} else if (this.componentType == "速度") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "speed");
} else if (this.componentType == "类型") {
this.chartData.xData = this.extractKeyValues(val, "time");
let seriesArr = this.extractKeyValues(val, "type_data");
const transformedData = [];
for (let i = 0; i < seriesArr[0].length; i++) {
const item = seriesArr[0][i];
const valueList = seriesArr.map((arr) => arr[i].quantity);
transformedData.push({
name: item.name,
value: valueList,
});
}
const totalCountList = transformedData[0].value.map((_, i) => {
return transformedData.reduce((sum, curr) => sum + curr.value[i], 0);
let option = {
grid: {
top: '25%',
left: '5%',
right: '5%',
bottom: '8%',
containLabel: true
},
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(1, 13, 19, 0.5)',
borderWidth: 1,
axisPointer: {
type: 'shadow'
// label: {
// show: true,
// },
},
textStyle: {
color: 'rgba(212, 232, 254, 1)'
// fontSize: fontChart(0.24),
},
extraCssText: 'z-index:2'
},
legend: {
left: 'center',
top: 0,
left: '10%',
// itemWidth: 15,
// itemHeight: 10,
// itemGap: 15,
// borderRadius: 4,
textStyle: {
color: '#000',
fontSize: 14,
fontWeight: 400
}
// data: [
// {
// name: '_1-zone2-线-',
// icon: 'circle'
// }
// ]
},
xAxis: {
type: 'category',
data: this.chartData.xData.reverse(),
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: true,
textStyle: {
color: '#393939' //X
}
}
},
yAxis: [
{
type: 'value',
name: this.title,
nameTextStyle: {
color: '#000',
fontFamily: 'Alibaba PuHuiTi',
fontSize: 14,
fontWeight: 600
// padding: [0, 0, 0, 40], //
},
nameGap: 30, //
axisLine: {
show: true,
lineStyle: {
color: '#eeeeee'
}
},
axisTick: {
show: false
},
axisLabel: {
color: '#393939',
fontSize: 14
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(131,101,101,0.2)',
type: 'dashed'
}
}
}
],
series: seriesList
};
myChart.setOption(option);
window.addEventListener('resize', () => {
myChart.resize();
});
transformedData.push({
name: "总数",
value: totalCountList,
});
this.seriesList = transformedData;
} else if (this.componentType == "延误") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "ave_delay");
} else if (this.componentType == "检测数") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "ave_stay");
} else if (this.componentType == "排队数") {
this.chartData.xData = this.extractKeyValues(val, "time");
this.chartData.yData = this.extractKeyValues(val, "ave_queue");
}
}
} else {
return false;
}
},
//
initEcharts() {
if (this.componentType == '流量') {
this.title = '辆/10秒'
}else if (this.componentType == '车头时距') {
this.title = '秒'
}else{
this.title = ''
}
// let slicedData = [];
// if (data != undefined && data.length > 5) {
// slicedData =data.slice(-5); // 10
// } else {
// slicedData = data; // 10
// }
if (this.componentType == "类型") {
this.typeData.push({ type_data: this.dataList[0].type_data,time:this.dataList[0].time });
this.dataProcessing(this.typeData);
} else {
this.dataProcessing(this.dataList);
}
// let myChart = this.$echarts.getInstanceByDom(document.getElementById(this.echartsRef));
// if (myChart == null) {
// myChart = this.$echarts.init(document.getElementById(this.echartsRef));
// }
let myChart = this.chart;
// let myChart = this.$echarts.init(document.getElementById('echartsLine'));
var seriesList = [];
var color = ["#0CD2E6", "#3751E6", "#FFC722", "rgb(255,115,38)"];
if (this.componentType == "类型") {
for (let i = 0; i < this.seriesList.length; i++) {
seriesList.push({
name: this.seriesList[i].name,
type: "line",
data: this.seriesList[i].value,
symbolSize: 8, //
lineStyle: {
color: color[i],
width: 3,
shadowColor: "rgba(255,115,38,0.17)", //线
shadowBlur: 5,
shadowOffsetY: 9,
},
itemStyle: {
//线
color: color[i],
borderColor: color[i],
borderWidth: 2,
},
smooth: 0.4,
emphasis: {
scale: 1.5,
},
});
}
} else {
seriesList = [
{
// name: '_1-zone2-线-',
type: "line",
data: this.chartData.yData.reverse(),
symbolSize: 8, //
lineStyle: {
color: "rgb(255,115,38)",
width: 3,
shadowColor: "rgba(255,115,38,0.17)", //线
shadowBlur: 5,
shadowOffsetY: 9,
},
itemStyle: {
//线
color: "rgb(255,115,38)",
borderColor: "rgb(255,115,38)",
borderWidth: 2,
},
smooth: 0.4,
emphasis: {
scale: 1.5,
},
},
];
}
let option = {
grid: {
top: "25%",
left: "5%",
right: "5%",
bottom: "8%",
containLabel: true,
},
tooltip: {
trigger: "axis",
backgroundColor: "rgba(1, 13, 19, 0.5)",
borderWidth: 1,
axisPointer: {
type: "shadow",
// label: {
// show: true,
// },
},
textStyle: {
color: "rgba(212, 232, 254, 1)",
// fontSize: fontChart(0.24),
},
extraCssText: "z-index:2",
},
legend: {
left: "center",
top: 0,
left: "10%",
// itemWidth: 15,
// itemHeight: 10,
// itemGap: 15,
// borderRadius: 4,
textStyle: {
color: "#000",
fontSize: 14,
fontWeight: 400,
},
// data: [
// {
// name: '_1-zone2-线-',
// icon: 'circle'
// }
// ]
},
xAxis: {
type: "category",
data: this.chartData.xData.reverse(),
axisLine: {
show: false,
},
axisTick: {
show: false,
},
axisLabel: {
show: true,
textStyle: {
color: "#393939", //X
},
},
},
yAxis: [
{
type: "value",
name: this.title,
nameTextStyle: {
color: "#000",
fontFamily: "Alibaba PuHuiTi",
fontSize: 14,
fontWeight: 600,
// padding: [0, 0, 0, 40], //
},
nameGap: 30, //
axisLine: {
show: true,
lineStyle: {
color: "#eeeeee",
},
},
axisTick: {
show: false,
},
axisLabel: {
color: "#393939",
fontSize: 14,
},
splitLine: {
show: true,
lineStyle: {
color: "rgba(131,101,101,0.2)",
type: "dashed",
},
},
},
],
series: seriesList,
};
myChart.setOption(option);
window.addEventListener("resize", () => {
myChart.resize();
});
},
},
mounted() {
let that = this;
const $dom = document.getElementById(this.echartsRef);
$dom.style.width = "440px";
$dom.style.height = "260px";
setTimeout(() => {
that.$nextTick(() => {
this.chart = this.$echarts.getInstanceByDom(
document.getElementById(this.echartsRef)
);
if (this.chart == null) {
this.chart = this.$echarts.init(document.getElementById(this.echartsRef));
}
that.initEcharts();
});
}, 300);
},
watch: {
intersectionName: {
handler: function (oldValues, newValues) {
this.$nextTick(() => {
this.initEcharts();
});
},
},
chatShowType: {
handler: function (oldValues, newValues) {},
},
componentType: {
handler: function (oldValues, newValues) {},
},
dataList: {
handler: function (oldValues, newValues) {
this.$nextTick(() => {
this.chart = this.$echarts.getInstanceByDom(
document.getElementById(this.echartsRef)
);
if (this.chart == null) {
this.chart = this.$echarts.init(document.getElementById(this.echartsRef));
}
this.initEcharts();
});
},
},
echartsRef: {
handler: function (oldValues, newValues) {
console.log("old", oldValues);
console.log("newV", newValues);
mounted() {
let that = this;
const $dom = document.getElementById(this.echartsRef);
$dom.style.width = '440px';
$dom.style.height = '260px';
setTimeout(() => {
that.$nextTick(() => {
this.chart = this.$echarts.getInstanceByDom(
document.getElementById(this.echartsRef)
);
if (this.chart == null) {
this.chart = this.$echarts.init(document.getElementById(this.echartsRef));
}
that.initEcharts();
});
that.$nextTick(() => {
this.chart = this.$echarts.getInstanceByDom(document.getElementById(this.echartsRef));
if (this.chart == null) {
this.chart = this.$echarts.init(document.getElementById(this.echartsRef));
}
that.initEcharts();
});
}, 300);
},
},
},
watch: {
intersectionName: {
handler: function (oldValues, newValues) {
this.$nextTick(() => {
this.initEcharts();
});
}
},
chatShowType: {
handler: function (oldValues, newValues) {}
},
componentType: {
handler: function (oldValues, newValues) {}
},
dataList: {
handler: function (oldValues, newValues) {
this.$nextTick(() => {
this.chart = this.$echarts.getInstanceByDom(document.getElementById(this.echartsRef));
if (this.chart == null) {
this.chart = this.$echarts.init(document.getElementById(this.echartsRef));
}
this.initEcharts();
});
}
},
echartsRef: {
handler: function (oldValues, newValues) {
console.log('old', oldValues);
console.log('newV', newValues);
let that = this;
setTimeout(() => {
that.$nextTick(() => {
this.chart = this.$echarts.getInstanceByDom(document.getElementById(this.echartsRef));
if (this.chart == null) {
this.chart = this.$echarts.init(document.getElementById(this.echartsRef));
}
that.initEcharts();
});
}, 300);
}
}
}
};
</script>
<style lang="less" scoped>
#echartsLine {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
</style>

View File

@ -56,9 +56,6 @@ export default {
initEcharts() {
let seriesData = null;
let myChart = this.chart;
console.log('initEcharts',this.dataList)
if (this.timeMode == "实时触发") {
seriesData = null;
this.renameField(this.dataList[0].type_data, "quantity", "value");

View File

@ -214,19 +214,21 @@
</div>
</div>
<div v-if="pageType == '断面'" style="margin-bottom: 20px; border: 1px solid #e4e7ed">
<tableShow :msg="newDataArr" :triggerType="triggerType" />
<tableShow :msg="newDataArrAbs" :triggerType="triggerType" />
</div>
<div v-if="pageType == '区域'">
<regionTable :msg="newDataArr" :triggerType="triggerType" />
<regionTable :msg="newDataArrAbs" :triggerType="triggerType" />
</div>
</div>
<div class="border" v-if="echartArr.includes('曲线图')">
<detailDialog />
<lineChart
:componentName="componentName"
:itemData="itemData"
:originalDataArr="newDataArr"
:chartName="chartName"
:pageType="pageType"
:list="newDataArr"
:list="newDataArrAbs"
:status="triggerType"
:title="title"
:typeValue="typeValue"
@ -239,7 +241,7 @@
:componentName="componentName"
:chartName="chartName"
:pageType="pageType"
:list="newDataArr"
:list="newDataArrAbs"
:status="triggerType"
:title="title"
:typeValue="typeValue"
@ -253,7 +255,7 @@
:componentName="componentName"
:chartName="chartName"
:pageType="pageType"
:list="newDataArr"
:list="newDataArrAbs"
:status="triggerType"
:title="title"
:typeValue="typeValue"
@ -265,7 +267,7 @@
:componentName="componentName"
:chartName="chartName"
:pageType="pageType"
:list="newDataArr"
:list="newDataArrAbs"
:status="triggerType"
:title="title"
:typeValue="typeValue"
@ -277,7 +279,7 @@
<thermalChart
:componentName="componentName"
:pageType="pageType"
:list="newDataArr"
:list="newDataArrAbs"
:status="triggerType"
:title="title"
:typeValue="typeValue"
@ -298,7 +300,18 @@ import regionTable from '../chart/regionTable.vue';
import thermalChart from '../chart/thermalChart.vue';
export default {
name: 'typeChart', //
props: ['typeValue', 'pageType', 'triggerType', 'dataArr', 'echartArr', 'componentName', 'title', 'chartName', 'startEndData'],
props: [
'typeValue',
'itemData',
'pageType',
'triggerType',
'dataArr',
'echartArr',
'componentName',
'title',
'chartName',
'startEndData'
],
components: {
lineChart,
barChart,
@ -330,13 +343,13 @@ export default {
methods: {
//
getDataArr(val) {
console.log('getDataArr', val);
// console.log('getDataArr', val);
this.newDataArr = val;
this.getNewQueue(this.newDataArr);
},
//
getcycleAccumulateDataArr(val) {
console.log('getcycleAccumulateDataArr', val);
// console.log('getcycleAccumulateDataArr', val);
this.cycleAccumulateDataArr = val;
this.getNewQueue2(this.cycleAccumulateDataArr);
},
@ -390,7 +403,70 @@ export default {
},
computed: {
//
// -1-
newDataArrAbs() {
// console.log('newDataArrAbs1', this.newDataArr);
let arr = [];
if (this.newDataArr.length > 0) {
let newlist = JSON.parse(JSON.stringify(this.newDataArr));
for (const item of newlist) {
if (!isNaN(item.speed) && (item.speed !== -1 || item.speed === 0)) {
item.speed = Math.abs(item.speed);
} else {
item.speed = '-';
}
if (!isNaN(item.flow) && (item.headway !== -1 || item.headway === 0)) {
item.flow = item.flow;
} else {
item.flow = '-';
}
if (!isNaN(item.headway) && (item.headway !== -1 || item.headway === 0)) {
item.headway = item.headway;
} else {
item.headway = '-';
}
if (!isNaN(item.n_stay) && (item.n_stay !== -1 || item.n_stay === 0)) {
item.n_stay = item.n_stay;
} else {
item.n_stay = '-';
}
if (!isNaN(item.n_queue) && (item.n_queue !== -1 || item.n_queue === 0)) {
item.n_queue = item.n_queue;
} else {
item.n_queue = '-';
}
if (!isNaN(item.ave_queue) && (item.ave_queue !== -1 || item.ave_queue === 0)) {
item.n_queue = item.ave_queue;
} else {
item.ave_queue = '-';
}
if (!isNaN(item.ave_delay) && (item.ave_delay !== -1 || item.ave_delay === 0)) {
item.ave_delay = item.ave_delay;
} else {
item.ave_delay = '-';
}
if (!isNaN(item.in_spd) && (item.in_spd !== -1 || item.in_spd === 0)) {
item.in_spd = item.in_spd;
} else {
item.in_spd = '-';
}
if (!isNaN(item.out_spd) && (item.out_spd !== -1 || item.out_spd === 0)) {
item.out_spd = item.out_spd;
} else {
item.out_spd = '-';
}
arr.push(Object.assign({}, item));
}
}
// console.log('triggerType',this.triggerType)
// console.log('newDataArrAbs2', arr);
return arr;
}
},
mounted() {},
watch: {

View File

@ -239,14 +239,14 @@ export default {
//
destroyed: function () {
// console.log("")
// //console.log("")
// client.end();
},
created() {
this.getVideoList();
},
mounted() {
console.log(localStorage.getItem('roleName'), 'session存储');
//console.log(localStorage.getItem('roleName'), 'session');
if (localStorage.getItem('roleName') == '系统管理员') {
this.disable = false;
} else {
@ -260,7 +260,7 @@ export default {
if (newVal) {
newVal.forEach((item) => {
if (item.status == '加载中') {
console.log('加载中', item);
//console.log('', item);
setTimeout(() => {
this.getVideoList();
}, 10000);
@ -291,14 +291,14 @@ export default {
}
})
.catch((err) => {
console.log(err);
//console.log(err);
});
},
changeChepai() {},
//
SetVideoMode(val) {
getSetVideoMode({ Mode: val }).then((res) => {
console.log('res', res);
//console.log('res', res);
});
},
changeRadio() {
@ -307,21 +307,21 @@ export default {
//
getVideoType() {
getVideoMode().then((res) => {
console.log('res', res.data.data);
//console.log('res', res.data.data);
this.videoTypeForm.videoType = res.data.data;
});
},
/** 创建mqtt */
createMqtt() {
console.log('this.videoTypeForm.videoType', this.videoTypeForm.videoType);
//console.log('this.videoTypeForm.videoType', this.videoTypeForm.videoType);
//
if (this.videoTypeForm.videoType == '实时视频') {
this.topicSends = ['hert', 'img0', 'img1', 'img2', 'img3', 'img4', 'img5', 'img6', 'img7', 'Contorl_server'];
console.log('this.videoTypeForm.videoType', this.videoTypeForm.videoType);
//console.log('this.videoTypeForm.videoType', this.videoTypeForm.videoType);
window.PubScribe(this.topicSends, -1, this.realInfo, false, 'videoId');
window.publish('Custom', JSON.stringify({ type: 'getImage', videoid: 'all' }));
} else if (this.videoTypeForm.videoType == '离线视频') {
console.log('this.videoTypeForm.videoType', this.videoTypeForm.videoType);
//console.log('this.videoTypeForm.videoType', this.videoTypeForm.videoType);
this.topicSends = ['VideoStatusData'];
window.PubScribe(this.topicSends, '001', this.realInfo, false, 'videoId');
}
@ -335,7 +335,7 @@ export default {
},
/** 实时数据分类 */
realInfo(topic, message) {
// console.log("topic",topic)
// //console.log("topic",topic)
switch (topic) {
//
case 'img0':
@ -355,7 +355,7 @@ export default {
// var newArr = []
//msgJSON
if (msg.rate == 'low') {
// console.log('msg', msg);
// //console.log('msg', msg);
if (this.videoList.length != 0) {
for (let i = 0; i < this.videoList.length; i++) {
if (msg.id == this.videoList[i].id) {
@ -399,7 +399,7 @@ export default {
// }
// this.imgUrl3 = 'data:image/png;base64,' + msg.pic;
// console.log("imageUrl", imageUrl)
// //console.log("imageUrl", imageUrl)
} catch (error) {}
break;
case 'hert':
@ -408,7 +408,7 @@ export default {
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
const msg = JSON.parse(temp); //JSON
// console.log("hert", msg) //msgJSON
// //console.log("hert", msg) //msgJSON
if (msg == '') {
}
} catch (error) {}
@ -419,7 +419,7 @@ export default {
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
const msg = JSON.parse(temp); //JSON
console.log('VideoStatusData', msg); //msgJSON
//console.log('VideoStatusData', msg); //msgJSON
this.changeStatus(msg);
} catch (error) {}
break;
@ -437,7 +437,7 @@ export default {
this.videoList[i].numSatus = parseFloat(numSatusN.toFixed(2));
} else if (msg.type == 'video_analyzed' && msg.video_id == this.videoList[i].id) {
//
console.log('已分析');
//console.log('');
this.videoList[i].videoAnalysisStatus = '已分析';
var ip = window.location.host;
var ipData = 'http://' + ip.split(':')[0];
@ -445,11 +445,11 @@ export default {
this.videoList[i].img = ipData + msg.pic_path;
} else if (msg.type == 'video_analyse_unusual' && msg.video_id == this.videoList[i].id) {
//
console.log('分析异常');
//console.log('');
this.videoList[i].videoAnalysisStatus = '分析异常';
} else if (msg.type == 'video_loading' && msg.video_id == this.videoList[i].id) {
//
console.log('加载中');
//console.log('');
this.videoList[i].videoAnalysisStatus = '加载中';
}
}
@ -503,10 +503,10 @@ export default {
informationInfo(data, item) {
if (data == '新增') {
var random = this.generateMixed(3);
console.log('random', random);
// console.log("this.file",this.file)
//console.log('random', random);
// //console.log("this.file",this.file)
// this.file = undefined
console.log('this.$refs.inputer', this.$refs.inputer);
//console.log('this.$refs.inputer', this.$refs.inputer);
(this.form = {
radio: '',
videoName: '视频' + random,
@ -519,7 +519,7 @@ export default {
}
},
open(item) {
console.log('item', item);
//console.log('item', item);
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -527,7 +527,7 @@ export default {
})
.then(() => {
getDeleteShipjk({ VideoId: item }).then((res) => {
console.log('res', res);
//console.log('res', res);
this.$message({
type: 'success',
message: '删除成功!'
@ -543,7 +543,7 @@ export default {
});
},
openRight(item) {
console.log('item', item);
//console.log('item', item);
startVideoAnalysis(item.id).then((res) => {
//
if (res.data.msg == '请求成功') {
@ -569,7 +569,7 @@ export default {
//
commit(form) {
console.log('form', form);
//console.log('form', form);
let formData = new FormData();
formData.append('VideoName', form.videoName);
formData.append('VideoType', this.videoTypeForm.videoType);
@ -585,7 +585,7 @@ export default {
url: serverUrl.dataUrl,
data: formData
}).then((res) => {
console.log('提交按钮', res);
//console.log('', res);
if (res.data.msg == '添加成功') {
this.$message({
message: res.data.msg,
@ -623,7 +623,7 @@ export default {
applicationBtn() {
// this.createMqtt()
getApplication().then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
const loading = this.$loading({
lock: true,
@ -653,7 +653,7 @@ export default {
//
stopAlgorithmBtn() {
getStopAlgorithm().then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
this.getVideoList();
this.$message({
@ -671,7 +671,7 @@ export default {
},
load(event) {
let size = null;
console.log(this.file, 'this.file.size');
//console.log(this.file, 'this.file.size');
if (this.file == undefined) {
this.$message.warning('请上传文件!!!');
} else {
@ -702,7 +702,7 @@ export default {
background: 'rgba(0, 0, 0, 0.7)'
});
console.log('loadingN', loadingN.text);
//console.log('loadingN', loadingN.text);
let count = arrFile.length;
let filename = this.file.name + '~' + this.guid();
for (var i = 0; i < count; i++) {
@ -755,7 +755,7 @@ export default {
}
})
.catch((e) => {
console.log(e);
//console.log(e);
});
}
this.clearShownWarnings();
@ -763,13 +763,13 @@ export default {
}
},
goToPage(videoAnalysisStatus, id, num, name, type, status, msg, videoPath) {
console.log('id', id);
console.log('num', num);
console.log('name', name);
console.log('type', type);
console.log('status', status);
console.log('msg', msg);
console.log('videoAnalysisStatus', videoAnalysisStatus);
//console.log('id', id);
//console.log('num', num);
//console.log('name', name);
//console.log('type', type);
//console.log('status', status);
//console.log('msg', msg);
//console.log('videoAnalysisStatus', videoAnalysisStatus);
if (type == '离线视频') {
if (videoAnalysisStatus != '已分析') {
} else if (videoAnalysisStatus == '已分析') {
@ -804,7 +804,7 @@ export default {
//
getVideoList() {
getGetShipjk().then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.msg == '成功') {
// if(val==''){
setTimeout(() => {
@ -820,7 +820,7 @@ export default {
} else {
this.SetVideoMode(this.videoTypeForm.videoType);
}
// console.log("this.videoTypeForm.videoType",this.videoTypeForm.videoType)
// //console.log("this.videoTypeForm.videoType",this.videoTypeForm.videoType)
var arr = [];
var ip = window.location.host;
var ipData = 'http://' + ip.split(':')[0];
@ -866,7 +866,7 @@ export default {
}
});
this.videoList = arr;
console.log('arrarrarrarr', this.videoList);
//console.log('arrarrarrarr', this.videoList);
if (this.videoList.length == '0') {
this.videoTypeShow = true;
} else {
@ -874,7 +874,7 @@ export default {
}
//
let highPicList = sessionStorage.getItem('highPicList') ? JSON.parse(sessionStorage.getItem('highPicList')) : [];
console.log(highPicList, 'highPicList');
//console.log(highPicList, 'highPicList');
if (this.videoList.length != 0 && highPicList.length > 0) {
for (let i = 0; i < this.videoList.length; i++) {
for (let j = 0; j < highPicList.length; j++) {
@ -889,10 +889,10 @@ export default {
},
handleRemove(file, fileList) {
console.log(file, fileList);
//console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
//console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(

View File

@ -1458,7 +1458,7 @@ export default {
// IP
// host: host,
// port: port,
// host:"172.16.1.168:10086",
// host:"ç",
keepalive: 60, // 60s0
username: "admin", //
password: "123456", //

View File

@ -67,7 +67,7 @@ export default {
// const host = 'ws://49.234.27.18:10087/'; // urlws://broker.emqx.io:8083/mqtt
var ip = window.location.host.split(":")[0];
console.log("ip",ip)
const host = `ws://${ip}:10087`;
const host = `ws://${ip}:10087`;
// const host = 'ws://172.16.1.168:10087/';
const options = {

View File

@ -25,6 +25,7 @@
<typeChart
ref="typeChartRef"
v-if="o.timeMode === '实时触发'"
:itemData="o"
:pageType="o.graphicType"
:triggerType="o.timeMode"
:componentName="o.componentName"
@ -38,6 +39,7 @@
<typeChart
ref="typeChartRef1"
v-if="o.timeMode === '固定时刻'"
:itemData="o"
:pageType="o.graphicType"
:triggerType="o.timeMode"
:componentName="o.componentName"
@ -54,6 +56,7 @@
ref="typeChartRef2"
style="width: 100%"
v-if="o.timeMode === '固定间隔'"
:itemData="o"
:pageType="o.graphicType"
:triggerType="o.timeMode"
:componentName="o.componentName"
@ -172,7 +175,7 @@ export default {
// },
created() {
// this.getNew()
// console.log("cycleHistoryData",this.cycleHistoryData)
// //console.log("cycleHistoryData",this.cycleHistoryData)
},
methods: {
//
@ -188,7 +191,7 @@ export default {
// this.idVal = ;
getComponentSection({ VideoId: this.$route.query.id, Number: 10 }).then((res) => {
if (res.data.code == 200) {
console.log(res.data.data, '组件的数据');
//console.log(res.data.data, '');
this.componentList = res.data.data;
this.siftData();
}
@ -200,7 +203,7 @@ export default {
this.sectionData = [];
this.classify = [];
this.componentList.forEach((val) => {
// console.log("val",val)
// //console.log("val",val)
this.sectionArr.push(val.combinationName);
this.sectionArr = Array.from(new Set(this.sectionArr));
});
@ -225,7 +228,7 @@ export default {
},
//
sectionHandle(i) {
let sections = document.querySelectorAll('.section');
// let sections = document.querySelectorAll('.section');
let sectionBox = document.querySelectorAll('.sectionBox');
let downPulls1 = document.querySelectorAll('.downPull1');
//
@ -293,12 +296,12 @@ export default {
},
componentList: {
handler(newVal) {
console.log('componentList', newVal);
//console.log('componentList', newVal);
if (newVal != undefined && newVal.length != 0) {
newVal.forEach((ele) => {
if (ele.timeMode == '固定间隔' && this.$route.query.type == '实时视频') {
console.log('实时视频', '固定间隔');
//console.log('', '');
this.$nextTick(() => {
// var thatNN = this;
ele.cycleStatisticsData.forEach((item) => {
@ -308,13 +311,13 @@ export default {
});
if (this.$refs.typeChartRef2 != undefined) {
// //
console.log('轮循固定时刻生成的各类组件')
//console.log('')
this.getRef(this.$refs.typeChartRef2, ele.timeMode);
}
});
}
if (ele.timeMode == '固定时刻' && this.$route.query.type == '实时视频') {
console.log('实时视频', '固定时刻');
//console.log('', '');
this.$nextTick(() => {
ele.cycleTimeData.forEach((item) => {
if (item.type_data != null) {
@ -396,8 +399,8 @@ export default {
cycleHistoryData: {
handler(newVal) {
// debugger
console.log('历史', newVal);
// console.log("",oldVal)
//console.log('', newVal);
// //console.log("",oldVal)
if (newVal != undefined) {
// newVal.forEach(ele => {
if (newVal.CycleStatisticsData) {
@ -460,9 +463,9 @@ export default {
//
triggerListData: {
handler(newVal) {
// console.log("newVal",newVal,'')
// //console.log("newVal",newVal,'')
this.triggerList = newVal;
// console.log("oldVal",oldVal)
// //console.log("oldVal",oldVal)
//
var _this = this;
if (newVal.length != 0 && _this.sectionData) {
@ -472,8 +475,8 @@ export default {
}
newVal.forEach((item) => {
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '实时触发') {
// console.log(ele.analogAreaComponentId, 'analogAreaComponentId');
// console.log(item.component_id, 'component_id');
// //console.log(ele.analogAreaComponentId, 'analogAreaComponentId');
// //console.log(item.component_id, 'component_id');
if (ele.trigger.length == 10) {
ele.trigger.pop();
}
@ -494,7 +497,7 @@ export default {
_this.$nextTick(() => {
if (_this.$refs.typeChartRef != undefined) {
for (let i = 0; i < _this.$refs.typeChartRef.length; i++) {
// console.log(_this.$refs.typeChartRef[i], '');
// //console.log(_this.$refs.typeChartRef[i], '');
let itemTypeChart = _this.$refs.typeChartRef[i];
if (itemTypeChart.dataArr != undefined && itemTypeChart.dataArr.length != 0) {
if (itemTypeChart.echartArr.includes('时间曲线图')) {
@ -549,7 +552,7 @@ export default {
cycleTimeData: {
handler(newVal) {
//
// console.log(newVal, '');
// //console.log(newVal, '');
if (newVal != undefined && newVal.length != 0 && this.sectionData) {
var thatN = this;
@ -576,7 +579,7 @@ export default {
// thatN.$nextTick(() => {
if (thatN.$refs.typeChartRef1 != undefined) {
// console.log("thatN.$refs.typeChartRef1",thatN.$refs.typeChartRef1)
// //console.log("thatN.$refs.typeChartRef1",thatN.$refs.typeChartRef1)
//
for (let i = 0; i < thatN.$refs.typeChartRef1.length; i++) {
let itemTypeChartRef1 = thatN.$refs.typeChartRef1[i];
@ -654,7 +657,7 @@ export default {
// // ele.cycleTimeData.unshift(item);
// // _thatN.$nextTick(() => {
// if (_thatN.$refs.typeChartRef1 != undefined) {
// // console.log("thatN.$refs.typeChartRef1",_thatN.$refs.typeChartRef1)
// // //console.log("thatN.$refs.typeChartRef1",_thatN.$refs.typeChartRef1)
// //
// for (let i = 0; i < _thatN.$refs.typeChartRef1.length; i++) {
// let itemTypeChartRef1 = thatN.$refs.typeChartRef1[i]
@ -697,7 +700,7 @@ export default {
//
cycleStatisticsData: {
handler(newVal) {
console.log('固定间隔', newVal);
//console.log('', newVal);
if (newVal != undefined && newVal.length != 0 && this.sectionData) {
var that = this;
that.classify.forEach((ele, index) => {
@ -741,13 +744,13 @@ export default {
if (itemTypeChartRef2.echartArr.includes('表格')) {
that.$refs.typeChartRef2[i].getDataArr(that.$refs.typeChartRef2[i].dataArr);
}
// console.log(item,'');
// //console.log(item,'');
if (
itemTypeChartRef2.echartArr.includes('直方图') &&
itemTypeChartRef2.$refs.barChartRef.drawBar
) {
//
// console.log(item, '');
// //console.log(item, '');
itemTypeChartRef2.$refs.barChartRef.drawBar(itemTypeChartRef2.dataArr[0]);
}
if (
@ -786,7 +789,7 @@ export default {
// if (_that.$refs.typeChartRef2 != undefined) {
// for (let i = 0; i < _that.$refs.typeChartRef2.length; i++) {
// let itemTypeChartRef2 = _that.$refs.typeChartRef2[i];
// // console.log(_this.$refs.typeChartRef[i], '');
// // //console.log(_this.$refs.typeChartRef[i], '');
// if (itemTypeChartRef2.length != 0 && itemTypeChartRef2.dataArr != undefined && itemTypeChartRef2.dataArr.length != 0) {
// // this.$refs.typeChartRef2[i].$refs.lineChartRef.drawLine(this.$refs.typeChartRef2[i].dataArr, _this.$refs.typeChartRe2f[i].componentName.split('_')[0])
// if (itemTypeChartRef2.echartArr.includes('线')) {
@ -795,10 +798,10 @@ export default {
// if (itemTypeChartRef2.echartArr.includes('')) {
// _that.$refs.typeChartRef2[i].getDataArr(_that.$refs.typeChartRef2[i].dataArr)
// }
// // console.log(item,'');
// // //console.log(item,'');
// if (itemTypeChartRef2.echartArr.includes('') && itemTypeChartRef2.$refs.barChartRef.drawBar) {
// //
// // console.log(item, '');
// // //console.log(item, '');
// itemTypeChartRef2.$refs.barChartRef.drawBar(itemTypeChartRef2.dataArr[0])
// }
// if (itemTypeChartRef2.echartArr.includes('') && itemTypeChartRef2.$refs.pieChartRef.drawPie) {
@ -827,7 +830,7 @@ export default {
//
cycleAccumulateData: {
handler(newVal) {
console.log('周期统计实时累计数据主题', newVal);
//console.log('', newVal);
if (newVal != undefined && newVal.length != 0 && this.sectionData) {
var that = this;
that.classify.forEach((ele, index) => {
@ -858,7 +861,7 @@ export default {
itemTypeChartRef2.dataArr != undefined &&
itemTypeChartRef2.dataArr.length != 0
) {
console.log('itemTypeChartRef2.echartArr',itemTypeChartRef2.echartArr)
//console.log('itemTypeChartRef2.echartArr',itemTypeChartRef2.echartArr)
if (itemTypeChartRef2.echartArr.includes('数值')) {
//
that.$refs.typeChartRef2[i].getcycleAccumulateDataArr([item]);

View File

@ -919,7 +919,7 @@ export default {
//
destroyed: function () {
//console.log("")
////console.log("")
// client.publish('msg_stream',JSON.stringify({"msg_flag":-1}))
//client.end();
},
@ -993,7 +993,7 @@ export default {
},
//
sceneChange(val) {
console.log(val, '车道场景选择');
//console.log(val, '');
if (val != 1) {
this.perception.place = '0';
}
@ -1092,7 +1092,7 @@ export default {
'TargetAnalysisStatusData',
'TrafficAnalysisStatusData',
//
'simulator_target-' + this.$route.query.id
// 'simulator_target-' + this.$route.query.id
];
window.PubScribe(this.topicSends, '001', this.realInfo);
setTimeout(() => {
@ -1120,7 +1120,7 @@ export default {
'img7',
'Contorl_server',
//
'simulator_target-' + this.$route.query.id
// 'simulator_target-' + this.$route.query.id
];
window.PubScribe(this.topicSends, this.number, this.realInfo, false, this.$route.query.id);
}
@ -1131,7 +1131,7 @@ export default {
//
getAnalysisStatus() {
getVideoStatus(this.$route.query.id).then((res) => {
console.log('res.data', res.data);
//console.log('res.data', res.data);
//
if (res.data.data.videoAnalysisStatus == '未分析') {
this.disabledTrafficAnalysis = true;
@ -1169,9 +1169,9 @@ export default {
});
},
getInterface(data1, data2, data3) {
console.log('data1', data1); //id
console.log('data2', data2); //id
console.log('data3', data2); //
//console.log('data1', data1); //id
//console.log('data2', data2); //id
//console.log('data3', data2); //
this.data1 = data1;
this.data2 = data2;
this.data3 = data3;
@ -1183,14 +1183,14 @@ export default {
getJierfData()
.then((res) => {
this.interfaceOptions = res.data.data;
console.log('this.interfaceOptions', this.interfaceOptions);
//console.log('this.interfaceOptions', this.interfaceOptions);
})
.catch((err) => {
_this.$message.error(err.msg);
});
},
handleInterfaceOptions(val) {
console.log('val', val);
//console.log('val', val);
var startSectionIdArr = [];
var startSectionNameArr = [];
val.forEach((item) => {
@ -1239,8 +1239,8 @@ export default {
window.publish('GetCycleHistory', 'Get-' + this.$route.query.id);
},
getZhuanFaMQTT(topic, msg) {
// console.log("topic",topic)
// console.log("msg",msg)
// //console.log("topic",topic)
// //console.log("msg",msg)
window.publish(topic, msg);
},
//
@ -1271,7 +1271,7 @@ export default {
trafficAnalysisBtn() {
startTrafficAnalysis(this.$route.query.id).then((res) => {
//
console.log('res.data', res.data.data);
//console.log('res.data', res.data.data);
if (res.data.code == 200) {
this.$message({
message: res.data.msg,
@ -1325,15 +1325,15 @@ export default {
analysisData() {
var ip = window.location.host.split(':')[0];
// var ip = '172.16.1.168'; //http://172.16.1.168
console.log('ip', ip);
//console.log('ip', ip);
getAnalysisData(this.$route.query.id, ip).then((res) => {
console.log('res.data.data视频分析结果', res.data.data);
//console.log('res.data.data', res.data.data);
// if(res.data.data.TrafficAnalysisStatus==''){
// this.videoAnalysisStatus = ''
// }else {
console.log('this.videoAnalysisStatusNew', res.data.data.trafficAnalysisStatus);
//console.log('this.videoAnalysisStatusNew', res.data.data.trafficAnalysisStatus);
this.videoAnalysisStatusNew = res.data.data.trafficAnalysisStatus;
console.log('this.videoAnalysisStatusNew', this.videoAnalysisStatusNew);
//console.log('this.videoAnalysisStatusNew', this.videoAnalysisStatusNew);
var numSatusNew = '';
this.analysis.videoTotalFrames = Number(res.data.data.videoTotalFrames);
if (res.data.data.trafficFrameNumber == '') {
@ -1358,16 +1358,16 @@ export default {
this.imageUrlToBase64(res.data.data.picPath);
});
// this.OnSceneN()
console.log(this.analysis, ' this.analysis');
//console.log(this.analysis, ' this.analysis');
},
//
postTraffic() {
var ip = window.location.host.split(':')[0];
// var ip = '172.16.1.168'; //http://172.16.1.168:5000
console.log('ip', ip);
//console.log('ip', ip);
getAnalysisData(this.$route.query.id, ip).then((res) => {
console.log('res.data.data', res.data.data);
//console.log('res.data.data', res.data.data);
this.analysis.trafficAnalysisPath1 = res.data.data.trafficAnalysisPath1;
this.analysis.trafficAnalysisPath2 = res.data.data.trafficAnalysisPath2;
document
@ -1393,7 +1393,7 @@ export default {
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
const msg = JSON.parse(temp); //JSON
// console.log(msg, 'msg');
// //console.log(msg, 'msg');
// document.getElementById('mapModule').contentWindow.getDestination(JSON.stringify(msg));
if (msg.rate == 'high') {
document.getElementById('mapModule').contentWindow.getDestination(JSON.stringify(msg));
@ -1456,12 +1456,13 @@ export default {
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
// console.log("msgN",msgN)
// //console.log("msgN",msgN)
this.triggerData = msgN;
if (temp.length != 0) {
for (let i = 0; i < msgN.length; i++) {
if (msgN[i].event != 'empty') {
detId.push(msgN[i].det_id);
// detId.push(msgN[i].det_id);
detId.push(msgN[i]);
}
}
document.getElementById('mapModule').contentWindow.getChuFa(JSON.stringify(detId));
@ -1470,67 +1471,66 @@ export default {
break;
case 'trigger-' + this.$route.query.id:
try {
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
// console.log("trigger_msgN",msgN)
// //console.log("trigger_msgN",msgN)
// msgN.forEach(item => {
// console.log("item.name",item.name)
// //console.log("item.name",item.name)
// })
this.triggerListData = msgN;
} catch (error) {}
break;
case 'cycle_time-' + this.$route.query.id:
try {
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
console.log('固定时刻', msgN);
//console.log('', msgN);
this.cycleTimeData = msgN;
} catch (error) {}
break;
case 'cycle_history-' + this.$route.query.id:
try {
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
console.log('历史数据', msgN);
//console.log('', msgN);
this.cycleHistoryData = msgN;
} catch (error) {}
break;
case 'cycle_statistics-' + this.$route.query.id:
try {
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
// console.log("",msgN)
//console.log("cycle_statistics-1",temp)
// //console.log("cycle_statistics-2",msgN)
this.cycleStatisticsData = msgN;
// this.cycleStatisticsData = msgN;
} catch (error) {}
break;
case 'cycle_accumulate-' + this.$route.query.id:
try {
//
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
console.log('周期统计实时累计数据主题', msgN);
//console.log('cycle_accumulate-', msgN);
this.cycleAccumulateData = msgN;
} catch (error) {}
break;
@ -1540,7 +1540,7 @@ export default {
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
const msg = JSON.parse(temp); //JSON
// console.log("VideoStatusData", msg) //msgJSON
// //console.log("VideoStatusData", msg) //msgJSON
this.changeStatus(msg);
} catch (error) {}
break;
@ -1550,7 +1550,7 @@ export default {
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
const msg = JSON.parse(temp); //JSON
console.log(msg, '目标监测');
//console.log(msg, '');
this.targetAnalysisStatusData = msg;
} catch (error) {}
break;
@ -1560,7 +1560,7 @@ export default {
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
const msg = JSON.parse(temp); //JSON
console.log(msg, '交通分析');
//console.log(msg, '');
this.trafficAnalysisStatusData = msg;
} catch (error) {}
break;
@ -1570,6 +1570,7 @@ export default {
const u8arr = new Uint8Array(message);
const temp = utf8decoder1.decode(u8arr); //
const msg = JSON.parse(temp);
//console.log('simulator_target-', msg);
document.getElementById('mapModule').contentWindow.getTargetNumber(JSON.stringify(msg));
} catch (error) {}
break;
@ -1577,10 +1578,10 @@ export default {
this.receiveNews = '';
},
// handleClick(tab, event) {
// console.log(tab, event);
// //console.log(tab, event);
// },
changeCompany(val) {
console.log('val', val);
//console.log('val', val);
if (val == '小时') {
this.max = '24';
this.componentForm.cycleInterval = 1;
@ -1604,11 +1605,11 @@ export default {
this.videoAnalysisStatus = '已分析';
this.numSatus = 100;
//
console.log('已分析');
//console.log('');
this.postTraffic();
} else if (msg.type == 'traffic_analyse_unusual' && msg.video_id == this.$route.query.id) {
//
console.log('分析异常');
//console.log('');
this.videoAnalysisStatus = '分析异常';
}
},
@ -1641,18 +1642,18 @@ export default {
},
// //id
getSingleComponentIdN(id, type, name) {
console.log('id', id);
console.log('type', type);
console.log('name', name);
//console.log('id', id);
//console.log('type', type);
//console.log('name', name);
this.closeEditShow = false;
this.closeComponentShow = true;
this.componentId = id;
this.componentForm.componentType = type;
this.componentTitle = type;
getComponentData({ AnalogAreaComponentId: id }).then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
console.log('res', res.data.data);
//console.log('res', res.data.data);
this.component = true;
if (res.data.data.company != '') {
this.componentForm.company = res.data.data.company;
@ -1662,10 +1663,10 @@ export default {
if (res.data.data.timeMode != '') {
this.componentForm.timeMode = res.data.data.timeMode;
} else {
console.log('this.componentForm.timeMode', this.componentForm.timeMode);
console.log('this.componentForm.componentType', this.componentForm.componentType);
//console.log('this.componentForm.timeMode', this.componentForm.timeMode);
//console.log('this.componentForm.componentType', this.componentForm.componentType);
if (this.componentForm.componentType == '延误' || this.componentForm.componentType == '拥堵') {
console.log('this.componentForm.timeMode', this.componentForm.timeMode);
//console.log('this.componentForm.timeMode', this.componentForm.timeMode);
this.componentForm.timeMode = '固定间隔';
} else {
this.componentForm.timeMode = '实时触发';
@ -1696,12 +1697,12 @@ export default {
// this.componentForm.typeFiltering = res.data.data.typeFiltering
// this.componentForm.type = res.data.data.type
if (res.data.data.startSectionIds != '') {
console.log('startSectionIds', res.data.data.startSectionIds);
//console.log('startSectionIds', res.data.data.startSectionIds);
var startSectionIdArr = [];
var startSectionArr = [];
startSectionIdArr = res.data.data.startSectionIds.split(',');
console.log('this.sectionals', this.sectionals);
console.log('startSectionIdArr', startSectionIdArr);
//console.log('this.sectionals', this.sectionals);
//console.log('startSectionIdArr', startSectionIdArr);
startSectionIdArr.forEach((item) => {
this.sectionals.forEach((items) => {
if (item == items.graphicId) {
@ -1718,12 +1719,12 @@ export default {
this.componentForm.startSection = startSectionArr;
}
if (res.data.data.endSectionIds != '') {
console.log('endSectionIds', res.data.data.endSectionIds);
//console.log('endSectionIds', res.data.data.endSectionIds);
var endSectionIdArr = [];
var endSectionArr = [];
endSectionIdArr = res.data.data.endSectionIds.split(',');
console.log('this.sectionals', this.sectionals);
console.log('endSectionIdArr', endSectionIdArr);
//console.log('this.sectionals', this.sectionals);
//console.log('endSectionIdArr', endSectionIdArr);
endSectionIdArr.forEach((item) => {
this.sectionals.forEach((items) => {
if (item == items.graphicId) {
@ -1753,13 +1754,13 @@ export default {
} else {
// this.componentForm.type = ["", "", ""];
}
console.log('this.componentForm', this.componentForm);
//console.log('this.componentForm', this.componentForm);
}
});
},
//
getSimulationAreaEdit(id, type, componentType, name, number) {
console.log('number', number);
//console.log('number', number);
this.numberNew = number;
if (type == '图形') {
this.form.id = id;
@ -1800,9 +1801,9 @@ export default {
this.componentForm.componentType = componentType;
this.componentTitle = componentType;
getComponentData({ AnalogAreaComponentId: id }).then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
console.log('res', res.data.data);
//console.log('res', res.data.data);
this.component = true;
if (res.data.data.company != '') {
this.componentForm.company = res.data.data.company;
@ -1839,12 +1840,12 @@ export default {
this.componentForm.presentationForm = res.data.data.presentationForm;
// this.componentForm.type = res.data.data.type
if (res.data.data.startSectionIds != '') {
console.log('startSectionIds', res.data.data.startSectionIds);
//console.log('startSectionIds', res.data.data.startSectionIds);
var startSectionIdArr = [];
var startSectionArr = [];
startSectionIdArr = res.data.data.startSectionIds.split(',');
console.log('this.sectionals', this.sectionals);
console.log('startSectionIdArr', startSectionIdArr);
//console.log('this.sectionals', this.sectionals);
//console.log('startSectionIdArr', startSectionIdArr);
startSectionIdArr.forEach((item) => {
this.sectionals.forEach((items) => {
if (item == items.graphicId) {
@ -1855,12 +1856,12 @@ export default {
});
}
if (res.data.data.endSectionIds != '') {
console.log('endSectionIds', res.data.data.endSectionIds);
//console.log('endSectionIds', res.data.data.endSectionIds);
var endSectionIdArr = [];
var endSectionArr = [];
endSectionIdArr = res.data.data.endSectionIds.split(',');
console.log('this.sectionals', this.sectionals);
console.log('endSectionIdArr', endSectionIdArr);
//console.log('this.sectionals', this.sectionals);
//console.log('endSectionIdArr', endSectionIdArr);
endSectionIdArr.forEach((item) => {
this.sectionals.forEach((items) => {
if (item == items.graphicId) {
@ -1891,7 +1892,7 @@ export default {
//
getAllSectionalData(VideoId) {
getSectionalData({ VideoId: VideoId }).then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
this.sectionals = res.data.data;
}
@ -1908,10 +1909,10 @@ export default {
return type;
},
getFigureD(item, index, indexNew) {
console.log('图形类型', item);
console.log('初始图形名称', index);
//console.log('', item);
//console.log('', index);
this.startFigureName = index;
console.log('图形位置', indexNew);
//console.log('', indexNew);
this.dialogFormVisible = true;
this.switchValue = 0;
this.typeCheckList = [
@ -1940,12 +1941,12 @@ export default {
//
getModifyTheNameN(data, number) {
this.orderShow = true;
console.log('data', data);
console.log('number', number);
//console.log('data', data);
//console.log('number', number);
this.numberNew = number;
var arr = [];
arr = data.split(',');
console.log('arr', arr);
//console.log('arr', arr);
this.form.id = arr[0];
// this.form.name = arr[1];
// this.form.type = arr[2];
@ -1982,7 +1983,7 @@ export default {
},
//
onSubmit(form) {
console.log('form', form);
//console.log('form', form);
//
if (
this.switchValue == 1 &&
@ -2062,7 +2063,7 @@ export default {
url: serverUrl.addFigure,
data: formData
}).then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
this.$message({
@ -2180,7 +2181,7 @@ export default {
url: serverUrl.editFigure,
data: formData
}).then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
this.$message({
message: res.data.msg,
@ -2194,9 +2195,9 @@ export default {
// duration: 0
// });
// }, 5000);
console.log('startFigureName', this.startFigureName);
//console.log('startFigureName', this.startFigureName);
document.getElementById('mapModule').contentWindow.postFigureId(JSON.stringify(res.data.data));
console.log('this.numberNew', this.numberNew);
//console.log('this.numberNew', this.numberNew);
if (form.type == '断面') {
document
.getElementById('mapModule')
@ -2225,7 +2226,7 @@ export default {
},
//
onSubmitComponent(componentForm) {
console.log(componentForm, 'ffffffffff');
//console.log(componentForm, 'ffffffffff');
if (componentForm.timeMode != '实时触发' && componentForm.company == '') {
this.$message.warning('请选择必选项');
return false;
@ -2277,7 +2278,7 @@ export default {
formData.append('presentationForm', '矩阵图');
} else if (componentForm.componentType == '类型') {
console.log(componentForm.type, 'componentForm.type');
//console.log(componentForm.type, 'componentForm.type');
//
formData.append('componentName', componentForm.componentName);
//
@ -2309,7 +2310,7 @@ export default {
url: serverUrl.editComponent,
data: formData
}).then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
this.$message({
message: res.data.msg,
@ -2331,7 +2332,7 @@ export default {
},
//
closeComponent(componentForm) {
console.log('componentForm', componentForm);
//console.log('componentForm', componentForm);
this.component = false;
let formData = new FormData();
@ -2384,7 +2385,7 @@ export default {
url: serverUrl.editComponent,
data: formData
}).then((res) => {
console.log('res', res);
//console.log('res', res);
if (res.data.code == 200) {
this.$message({
@ -2409,7 +2410,7 @@ export default {
},
//
closeFigure(form) {
console.log('form', form);
//console.log('form', form);
if (form.id != '') {
this.dialogFormVisible = false;
document.getElementById('mapModule').contentWindow.closeEdit(JSON.stringify(form.type + ',' + form.id));
@ -2428,7 +2429,7 @@ export default {
}
},
closeComponentForm(componentForm) {
console.log('111', componentForm);
//console.log('111', componentForm);
if (this.closeComponentShow == false) {
this.component = false;
document.getElementById('mapModule').contentWindow.editComponent('');
@ -2447,7 +2448,7 @@ export default {
},
//
handleCheckedStartSection(value) {
console.log('改变起点', value);
//console.log('', value);
var startSectionIdArr = [];
var startSectionNameArr = [];
value.forEach((item) => {
@ -2465,7 +2466,7 @@ export default {
},
//
handleCheckedendSection(value) {
console.log('改变终点', value);
//console.log('', value);
var endSectionIdArr = [];
var endSectionNameArr = [];
value.forEach((item) => {
@ -2475,8 +2476,8 @@ export default {
endSectionNameArr.push(items.graphicName);
let newendSectionId = endSectionIdArr.join(',');
let newEndSectionName = endSectionNameArr.join(',');
console.log('newendSectionId', newendSectionId);
console.log('newEndSectionName', newEndSectionName);
//console.log('newendSectionId', newendSectionId);
//console.log('newEndSectionName', newEndSectionName);
this.componentForm.endSectionIds = newendSectionId;
this.componentForm.endSectionNames = newEndSectionName;
}
@ -2485,14 +2486,14 @@ export default {
},
//
handlePresentation(value) {
console.log('展现形式', value);
//console.log('', value);
let presentation = value.join(',');
this.componentForm.presentationForm = presentation;
console.log('this.componentForm.presentationForm', this.componentForm.presentationForm);
//console.log('this.componentForm.presentationForm', this.componentForm.presentationForm);
},
//
handleTypeData(value) {
console.log('类型数据', value);
//console.log('', value);
let type = value.join(',');
this.componentForm.typeData = type;
},
@ -2504,7 +2505,7 @@ export default {
handleSearch() {
this.modelOthers = true;
this.$refs.htModels.finbBox(this.inputVal);
console.log(this.$refs.htModels, 'asdasdasd');
//console.log(this.$refs.htModels, 'asdasdasd');
this.inputVal = '';
},
handleRow(val) {
@ -2518,7 +2519,7 @@ export default {
methods: ''
}).then((res) => {
this.weatherItem = res.data.lives[0];
console.log(this.weatherItem, 'asdsads');
//console.log(this.weatherItem, 'asdsads');
});
}
},

View File

@ -602,6 +602,7 @@
></el-empty>
<chartsLine
:echartsRef="'echartsLine' + e.duocgqrhpzId"
:itemData="e"
style="width: 100%; height: 100%"
:intersectionName="intersectionName"
:chatShowType="chatShowType"
@ -621,6 +622,7 @@
></el-empty>
<chartsLine
:echartsRef="'echartsLine' + e.duocgqrhpzId"
:itemData="e"
style="width: 100%; height: 100%"
:intersectionName="intersectionName"
:chatShowType="chatShowType"
@ -640,6 +642,7 @@
<chartsLine
:echartsRef="'echartsLine' + e.duocgqrhpzId"
style="width: 100%; height: 100%"
:itemData="e"
:intersectionName="intersectionName"
:chatShowType="chatShowType"
:timeMode="'固定间隔'"
@ -1256,8 +1259,8 @@
<img src="@/assets/img/AnalysisMain/add.png" style="height: 60%; width: 4%; cursor: pointer" />
</div> -->
<el-button size="medium" style="width: 100%" type="primary" plain @click="addParentNode"
><i class="el-icon-plus" style="font-size: 18px"></i></el-button
>
><i class="el-icon-plus" style="font-size: 18px"></i
></el-button>
<span slot="footer" class="dialog-footer" style="display: flex; justify-content: center">
<!-- <el-button type="primary" @click="centerDialogVisible = false">取消</el-button> -->
<el-button @click="addSuccess" type="primary">关闭</el-button>
@ -1774,7 +1777,7 @@ export default {
// this.addTriggerDataField(this.intersectionList);
//mqtt
this.getMqtt();
console.log(this.intersectionList, 'this.intersectionList');
//console.log(this.intersectionList, 'this.intersectionList');
//
if (this.intersectionList.length > 0) {
let children = this.intersectionList[0].children || [];
@ -1789,7 +1792,7 @@ export default {
// }
// }
// }
// console.log(this.intersectionName, 'intersectionName');
// //console.log(this.intersectionName, 'intersectionName');
});
},
//option
@ -1834,7 +1837,7 @@ export default {
for (let i = 0; i < this.threeData.length; i++) {
this.addParentSort = this.threeData[i].sort;
}
console.log(this.threeData, 'this.threeData');
//console.log(this.threeData, 'this.threeData');
} else {
this.$message.warning(res.data.msg);
}
@ -1907,7 +1910,7 @@ export default {
},
//
handleCollapseChange(val) {
console.log(val, '折叠面板展开事件', this.intersectionName);
//console.log(val, '', this.intersectionName);
this.intersectionName = val;
},
handleNodeClick(nodeData) {},
@ -1964,7 +1967,7 @@ export default {
allowDrop(draggingNode, dropNode, type) {
//
if (draggingNode.level === dropNode.level) {
console.log('拖拽');
//console.log('');
return type === 'prev' || type === 'next';
} else {
//
@ -1998,7 +2001,7 @@ export default {
}
})
.catch((err) => {
console.log(err);
//console.log(err);
});
},
//
@ -2062,7 +2065,7 @@ export default {
key.data = key.data.filter((d) => d.videoName != '数值');
});
});
console.log(this.addChildThreeData, ' this.addChildThreeData');
//console.log(this.addChildThreeData, ' this.addChildThreeData');
});
this.addThreeNodeData.data = data;
this.addThreeNodeData.node = node;
@ -2192,14 +2195,14 @@ export default {
//
this.addThreeChildData.data = data;
this.addThreeChildData.node = node;
console.log(this.addThreeChildData.data, 'this.addThreeChildData.node', this.addThreeChildData.node);
//console.log(this.addThreeChildData.data, 'this.addThreeChildData.node', this.addThreeChildData.node);
},
//
addChildNode() {
this.checkDataList = [];
//
console.log(this.checkDataList, 'this.checkDataList');
//console.log(this.checkDataList, 'this.checkDataList');
let params = {
ParentId: '',
Name: '',
@ -2270,7 +2273,7 @@ export default {
}
})
.catch((err) => {
console.log(err);
//console.log(err);
});
// }
},
@ -2299,7 +2302,7 @@ export default {
}
})
.catch((err) => {
console.log(err);
//console.log(err);
});
})
.catch(() => {
@ -2339,7 +2342,7 @@ export default {
},
//
addThreeNode() {
console.log(this.addThreeNodeData.data, 'this.addThreeNodeData.data');
//console.log(this.addThreeNodeData.data, 'this.addThreeNodeData.data');
let params = {
ParentId: '',
Name: '',
@ -2386,13 +2389,13 @@ export default {
}
})
.catch((err) => {
console.log(err);
//console.log(err);
});
}
},
// //
focus(event) {
// console.log(event);
// //console.log(event);
event.currentTarget.select();
},
// inp
@ -2401,7 +2404,7 @@ export default {
},
//
alters(node, data) {
console.log(data.label, '失去焦点');
//console.log(data.label, '');
data.showInput = false;
const label = document.getElementById(data.duocgqrhpzId);
const changeinput = document.querySelector('.input' + data.duocgqrhpzId);
@ -2424,11 +2427,11 @@ export default {
}
})
.catch((err) => {
console.log(err);
//console.log(err);
});
},
alter(node, data) {
console.log(data, '编辑', this.threeData);
//console.log(data, '', this.threeData);
data.showInput = true;
const label = document.getElementById(data.duocgqrhpzId);
const changeinput = document.querySelector('.input' + data.duocgqrhpzId);
@ -2444,42 +2447,53 @@ export default {
//
showTooltip(id) {
// const hover = document.querySelector('.hovered' + id);
const title = document.querySelector('.tooltip' + id);
this.$nextTick(() => {
title.style.position = 'absolute';
title.style.display = 'block';
title.style.backgroundColor = '#f7f7f7';
title.style.border = '1px solid #ccc';
});
if (id) {
const title = document.querySelector('.tooltip' + id);
this.$nextTick(() => {
title.style.position = 'absolute';
title.style.display = 'block';
title.style.backgroundColor = '#f7f7f7';
title.style.border = '1px solid #ccc';
});
}
},
//
hideTooltip(id) {
const title = document.querySelector('.tooltip' + id);
this.$nextTick(() => {
// this.hovered = false;
title.style.display = 'none';
});
// const title = document.querySelector('.tooltip' + id);
if (id) {
const title = document.querySelector('.tooltip' + id);
this.$nextTick(() => {
// this.hovered = false;
title.style.display = 'none';
});
}
},
//
showCardtip(id) {
// const hover = document.querySelector('.hovered' + id);
const title = document.querySelector('.cardTitle1' + id);
this.$nextTick(() => {
title.style.position = 'absolute';
title.style.display = 'block';
title.style.backgroundColor = '#f7f7f7';
title.style.border = '1px solid #ccc';
// title.style.top = '120px';
title.style.width = '110px';
});
if (id) {
const title = document.querySelector('.cardTitle1' + id);
this.$nextTick(() => {
title.style.position = 'absolute';
title.style.display = 'block';
title.style.backgroundColor = '#f7f7f7';
title.style.border = '1px solid #ccc';
// title.style.top = '120px';
title.style.width = '110px';
});
}
},
//
hideCardtip(id) {
const title = document.querySelector('.cardTitle1' + id);
this.$nextTick(() => {
// this.hovered = false;
title.style.display = 'none';
});
if (id) {
const title = document.querySelector('.cardTitle1' + id);
this.$nextTick(() => {
// this.hovered = false;
title.style.display = 'none';
});
}
},
//
@ -2490,7 +2504,7 @@ export default {
// this.chatShowIndex = index;
let count = index - 1;
let elements = document.querySelectorAll('[class^="echarts"]');
let echarts = document.querySelector('.echarts' + count);
// let echarts = document.querySelector('.echarts' + count);
elements.forEach((element) => {
this.setZIndex(element, count);
});
@ -2514,7 +2528,7 @@ export default {
// this.getSensorFusionData();
// })
// .catch((err) => {
// console.log(err);
// //console.log(err);
// });
},
//
@ -2752,19 +2766,19 @@ export default {
//mqtt
realInfo(topic, message, videoId) {
let dataList = this.intersectionList;
// console.log(topic, message, 'mqtt', videoId);
// //console.log(topic, message, 'mqtt', videoId);
for (let i = 0; i < this.topicVideoIdList.length; i++) {
switch (topic) {
//
case 'trigger-' + this.topicVideoIdList[i].videoId:
try {
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
// console.log(msgN,'msgN');
// //console.log(msgN,'msgN');
for (let j = 0; j < msgN.length; j++) {
const locations = this.findLocationById(this.intersectionList, msgN[j].component_id);
//speed-1html
@ -2803,7 +2817,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
});
// }
//
@ -2856,7 +2871,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
});
} else if (msgN[j].component_type == '速度') {
//
@ -2876,6 +2892,7 @@ export default {
this.addOrUpdateArrayItem(this.triggerSpeedData, {
time: msgN[j].time,
speed: newSpeed,
originalSpeed: msgN[j].speed,
avg: msgN[j].avg,
max: msgN[j].max,
med: msgN[j].med,
@ -2897,7 +2914,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
});
} else if (msgN[j].component_type == '类型') {
let map = {
@ -2941,7 +2959,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
});
} else if (msgN[j].component_type == '检测数') {
let map = {
@ -2982,7 +3001,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
});
} else if (msgN[j].component_type == '排队数') {
let map = {
@ -3018,7 +3038,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
});
} else if (msgN[j].component_type == 'OD') {
//
@ -3039,14 +3060,14 @@ export default {
break;
case 'cycle_time-' + this.topicVideoIdList[i].videoId:
try {
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
const msgN = JSON.parse(temp);
console.log('固定时刻', msgN);
//console.log('', msgN);
for (let j = 0; j < msgN.length; j++) {
const locations = this.findLocationById(this.intersectionList, msgN[j].component_id);
const locations = this.findLocationById(this.intersectionList, msgN[j].component_id);
//speed-1html
let newSpeed = '-';
if ((msgN[j].speed && msgN[j].speed != -1) || msgN[j].speed === 0) {
@ -3066,7 +3087,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.timeDataCharts(
@ -3088,7 +3110,7 @@ export default {
msgN[j].component_id,
map
);
console.log(this.intersectionList, 'this.intersectionList');
//console.log(this.intersectionList, 'this.intersectionList');
});
} else if (msgN[j].component_type == '速度') {
//
@ -3117,7 +3139,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.timeDataCharts(
@ -3154,7 +3177,8 @@ export default {
n_stay: msgN[j].n_stay,
n_queue: msgN[j].n_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.timeDataCharts(
@ -3188,16 +3212,16 @@ export default {
break;
case 'cycle_statistics-' + this.topicVideoIdList[i].videoId:
try {
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
console.log('固定间隔', msgN, this.topicVideoIdList[i].videoId);
//console.log('', msgN, this.topicVideoIdList[i].videoId);
// this.cycleStatisticsData = msgN;
for (let j = 0; j < msgN.length; j++) {
//speed-1html
//speed-1html
let newSpeed = '-';
if ((msgN[j].speed && msgN[j].speed != -1) || msgN[j].speed === 0) {
newSpeed = Math.abs(msgN[j].speed);
@ -3216,7 +3240,8 @@ export default {
n_stay: msgN[j].ave_stay,
n_queue: msgN[j].ave_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.cycleStatisticsDataCharts(
@ -3266,7 +3291,8 @@ export default {
ave_stay: msgN[j].ave_stay,
ave_queue: msgN[j].ave_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.cycleStatisticsDataCharts(
@ -3303,7 +3329,8 @@ export default {
ave_stay: msgN[j].ave_stay,
ave_queue: msgN[j].ave_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.cycleStatisticsDataCharts(
@ -3340,7 +3367,8 @@ export default {
ave_stay: msgN[j].ave_stay,
ave_queue: msgN[j].ave_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.cycleStatisticsDataCharts(
@ -3376,7 +3404,8 @@ export default {
ave_stay: msgN[j].ave_stay,
ave_queue: msgN[j].ave_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.cycleStatisticsDataCharts(
@ -3408,7 +3437,8 @@ export default {
ave_stay: msgN[j].ave_stay,
ave_queue: msgN[j].ave_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.cycleStatisticsDataCharts(
@ -3440,7 +3470,8 @@ export default {
ave_stay: msgN[j].ave_stay,
ave_queue: msgN[j].ave_queue,
occ: msgN[j].occ,
speed: newSpeed
speed: newSpeed,
originalSpeed: msgN[j].speed
};
this.$nextTick(() => {
this.cycleStatisticsDataCharts(
@ -3472,16 +3503,16 @@ export default {
break;
case 'cycle_accumulate-' + this.topicVideoIdList[i].videoId:
try {
// console.log("trigger_msgN",message)
// //console.log("trigger_msgN",message)
const utf8decoder = new TextDecoder();
const u8arr = new Uint8Array(message);
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
console.log('固定间隔cycle_accumulate', msgN);
// //console.log('cycle_accumulate', msgN);
// this.cycleStatisticsData = msgN;
for (let j = 0; j < msgN.length; j++) {
//speed-1html
//speed-1html
let newSpeed = '-';
if ((msgN[j].speed && msgN[j].speed != -1) || msgN[j].speed === 0) {
newSpeed = Math.abs(msgN[j].speed);
@ -3601,7 +3632,7 @@ export default {
chartsPie, //
chartsBar, //
MeanValue, //
thermalOD, //OD
thermalOD //OD
}
};
</script>