diff --git a/ .env.dev b/ .env.dev new file mode 100644 index 0000000..fad75e3 --- /dev/null +++ b/ .env.dev @@ -0,0 +1 @@ +NODE_ENV = "development" \ No newline at end of file diff --git a/.env.pro b/.env.pro new file mode 100644 index 0000000..8582072 --- /dev/null +++ b/.env.pro @@ -0,0 +1 @@ +NODE_ENV = "production" \ No newline at end of file diff --git a/public/flv/index.html b/public/flv/index.html index 20f5538..4ad5879 100644 --- a/public/flv/index.html +++ b/public/flv/index.html @@ -57,12 +57,13 @@ diff --git a/src/components/chart/barChart.vue b/src/components/chart/barChart.vue index d5f6005..3bc9e36 100644 --- a/src/components/chart/barChart.vue +++ b/src/components/chart/barChart.vue @@ -21,6 +21,7 @@ diff --git a/src/views/bounced/analysisPreview.vue b/src/views/bounced/analysisPreview.vue index e8585ea..75a6463 100644 --- a/src/views/bounced/analysisPreview.vue +++ b/src/views/bounced/analysisPreview.vue @@ -1,313 +1,309 @@ \ No newline at end of file diff --git a/src/views/bounced/dataBoard.vue b/src/views/bounced/dataBoard.vue index 85a7d7c..dd4d2e9 100644 --- a/src/views/bounced/dataBoard.vue +++ b/src/views/bounced/dataBoard.vue @@ -468,12 +468,12 @@ export default { // 处理过的触发数据 triggerListData: { handler(newVal) { - // //console.log("newVal",newVal,'流量数据') + // console.log("实时触发triggerListData-",newVal) this.triggerList = newVal; // //console.log("oldVal",oldVal) // 触发数据 var _this = this; - if (newVal.length != 0 && _this.sectionData) { + if (newVal.length != 0 && _this.sectionData.length>0) { _this.classify.forEach((ele, index) => { if (ele.trigger == undefined && ele.timeMode == '实时触发') { ele.trigger = []; @@ -498,6 +498,10 @@ export default { if (item.type_data != null) { _this.typeTimeMode = item; } + //component_type + // if(item.component_name=='车头时距_4'){ + // console.log("dataBoard实时触发triggerListData-item",item) + // } ele.trigger.unshift(item); _this.$nextTick(() => { if (_this.$refs.typeChartRef != undefined) { diff --git a/src/views/bounced/form.vue b/src/views/bounced/form.vue index 34f71f0..b7f2097 100644 --- a/src/views/bounced/form.vue +++ b/src/views/bounced/form.vue @@ -1,34 +1,32 @@ diff --git a/src/views/general/AboutMachine.vue b/src/views/general/AboutMachine.vue index 1d696c5..213a2a2 100644 --- a/src/views/general/AboutMachine.vue +++ b/src/views/general/AboutMachine.vue @@ -676,6 +676,9 @@ export default { // 备份服务器事件 backupHandle() { var ipUrl = window.location.origin + if (process.env.NODE_ENV === 'development') { + ipUrl = '172.16.1.168'; + } // var ipUrl = '172.16.1.168' this.$confirm('此操作将备份操作, 是否继续?', '提示', { confirmButtonText: '确定', diff --git a/src/views/index.vue b/src/views/index.vue index 78be50a..ec2378f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -107,23 +107,23 @@
行人/非机动车
- 交通警察 + 交警 环卫工人 - 普通行人 + 一般行人 三轮车 自行车 - 电车 + 电瓶车
机动车
- 汽车 + 小汽车 卡车 - 客车 + 大巴车 公交车 - 专用汽车 - 施工车辆 + 特种车辆 + 建筑车辆
@@ -248,23 +248,23 @@
行人/非机动车
- 交通警察 + 交警 环卫工人 - 普通行人 + 一般行人 三轮车 自行车 - 电车 + 电瓶车
机动车
- 汽车 + 小汽车 卡车 - 客车 + 大巴车 公交车 - 专用汽车 - 施工车辆 + 特种车辆 + 建筑车辆
@@ -1333,6 +1333,9 @@ export default { //获取视频分析结果 analysisData() { var ip = window.location.host.split(':')[0]; + if (process.env.NODE_ENV === 'development') { + ip = '172.16.1.168'; + } // var ip = '172.16.1.168'; //http://172.16.1.168 //console.log('ip', ip); getAnalysisData(this.$route.query.id, ip).then((res) => { @@ -1373,6 +1376,9 @@ export default { //分析结束传参 postTraffic() { var ip = window.location.host.split(':')[0]; + if (process.env.NODE_ENV === 'development') { + ip = '172.16.1.168'; + } // var ip = '172.16.1.168'; //http://172.16.1.168:5000 //console.log('ip', ip); getAnalysisData(this.$route.query.id, ip).then((res) => { @@ -1492,8 +1498,8 @@ export default { // //console.log("item.name",item.name) // }) // for (const item of msgN) { - // if (item.name == 'gate3触发') { - // console.log('实时触发trigger-', item); + // if (item.component_name == '车头时距_4') { + // console.log('源头实时触发trigger-', item); // } // } this.triggerListData = msgN; @@ -1635,6 +1641,9 @@ export default { var ip = window.location.host; // this.ipData = 'http://' + ip.split(':')[0] + ':5000'; this.ipData = 'http://' + ip.split(':')[0]; + if (process.env.NODE_ENV === 'development') { + this.ipData = 'http://172.16.1.168'; + } document.getElementById('mapModule').contentWindow.getIpData(this.ipData); // document.getElementById('mapModule').contentWindow.getIpData('http://172.16.1.168'); if (this.$route.query.type == '离线视频') { diff --git a/src/views/sensorFusion/index copy.vue b/src/views/sensorFusion/index copy.vue new file mode 100644 index 0000000..00694aa --- /dev/null +++ b/src/views/sensorFusion/index copy.vue @@ -0,0 +1,4364 @@ + + + + + diff --git a/src/views/sensorFusion/index.vue b/src/views/sensorFusion/index.vue index c130198..e038b3c 100644 --- a/src/views/sensorFusion/index.vue +++ b/src/views/sensorFusion/index.vue @@ -604,7 +604,7 @@ -
+
@@ -636,7 +636,7 @@
@@ -655,7 +655,7 @@
@@ -683,10 +683,10 @@
- +
- +
@@ -795,7 +795,7 @@
@@ -811,7 +811,7 @@
@@ -827,7 +827,7 @@
@@ -852,7 +852,7 @@
@@ -868,7 +868,7 @@
@@ -884,7 +884,7 @@
@@ -909,7 +909,7 @@
@@ -924,7 +924,7 @@
@@ -939,7 +939,7 @@
@@ -963,7 +963,7 @@
@@ -982,7 +982,7 @@
@@ -1001,7 +1001,7 @@
@@ -1877,7 +1877,6 @@ export default { this.addSelectOptionField(obj[key]); } else if (key == 'name') { obj['selectOption'] = 1; - obj['triggerNewData'] = []; } } } @@ -2784,13 +2783,19 @@ export default { type_data: newValue, originalSpeed: table.originalSpeed }; - this.addTimeDataCharts(data[i].children[j].children[n].children[m].triggerNewData, typeData); - } else { - if (data[i].children[j].children[n].children[m].triggerNewData.length > 10) { - data[i].children[j].children[n].children[m].triggerNewData = - data[i].children[j].children[n].children[m].triggerNewData.slice(-10); + if (!data[i].children[j].children[n].children[m].triggerDataList) { + data[i].children[j].children[n].children[m].triggerDataList = []; } - this.addTimeDataCharts(data[i].children[j].children[n].children[m].triggerNewData, newValue); + this.addTimeDataCharts(data[i].children[j].children[n].children[m].triggerDataList, typeData); + } else { + if (!data[i].children[j].children[n].children[m].triggerDataList) { + data[i].children[j].children[n].children[m].triggerDataList = []; + } + if (data[i].children[j].children[n].children[m].triggerDataList.length > 10) { + data[i].children[j].children[n].children[m].triggerDataList = + data[i].children[j].children[n].children[m].triggerDataList.slice(-10); + } + this.addTimeDataCharts(data[i].children[j].children[n].children[m].triggerDataList, newValue); } } } @@ -2827,12 +2832,14 @@ export default { min: table.min, originalSpeed: table.originalSpeed }; - // if (data[i].children[j].children[n].children[m].cycleTimeData.length > 10) { - // data[i].children[j].children[n].children[m].cycleTimeData = - // data[i].children[j].children[n].children[m].cycleTimeData.slice(-10); - // } + if (!data[i].children[j].children[n].children[m].cycleTimeData) { + data[i].children[j].children[n].children[m].cycleTimeData = []; + } this.addTimeDataCharts(data[i].children[j].children[n].children[m].cycleTimeData, typeData); } else { + if (!data[i].children[j].children[n].children[m].cycleTimeData) { + data[i].children[j].children[n].children[m].cycleTimeData = []; + } if (data[i].children[j].children[n].children[m].cycleTimeData.length > 10) { data[i].children[j].children[n].children[m].cycleTimeData = data[i].children[j].children[n].children[m].cycleTimeData.slice(-10); @@ -2898,12 +2905,14 @@ export default { in_spd: table.in_spd, out_spd: table.out_spd }; - // if (data[i].children[j].children[n].children[m].cycleStatisticsData.length > 10) { - // data[i].children[j].children[n].children[m].cycleStatisticsData = - // data[i].children[j].children[n].children[m].cycleStatisticsData.slice(-10); - // } + if (!data[i].children[j].children[n].children[m].cycleStatisticsData) { + data[i].children[j].children[n].children[m].cycleStatisticsData = []; + } this.addTimeDataCharts(data[i].children[j].children[n].children[m].cycleStatisticsData, typeData); } else { + if (!data[i].children[j].children[n].children[m].cycleStatisticsData) { + data[i].children[j].children[n].children[m].cycleStatisticsData = []; + } if (data[i].children[j].children[n].children[m].cycleStatisticsData.length > 10) { data[i].children[j].children[n].children[m].cycleStatisticsData = data[i].children[j].children[n].children[m].cycleStatisticsData.slice(-10); @@ -2919,7 +2928,7 @@ export default { }, //mqtt接收数据添加最新的最多添加10条(固定时刻) addTimeDataCharts(array, newItem) { - if (array.length === 10) { + if (array && array.length === 10) { array.pop(); // 删除最旧的元素 } array.unshift(newItem); // 添加最新的元素 @@ -2967,26 +2976,34 @@ export default { // if (locations == '卡片区' || locations == '两个区都存在') { // if(locations == '图表区' || locations == '两个区都存在'){ - // console.log('实时触发trigger-车头时距', msgN[j].time); + // console.log('实时触发trigger-车头时距', msgN[j]); //图表区数组 - this.addOrUpdateArrayItem(this.triggerDataList, { - time: msgN[j].time, + // this.addOrUpdateArrayItem(this.triggerDataList, { + // time: msgN[j].time, + // headway: msgN[j].headway, + // avg: msgN[j].avg, + // max: msgN[j].max, + // med: msgN[j].med, + // min: msgN[j].min + // }); + // component_id: "d4633befe6d4415d8b2c16c61992fb27" + // graphical_id: "706baf89caa44920b6e84b0c46d10a29" + // video_id: "9bb7a16ddf924a08b3f5d37d71f86dbd" + // this.$nextTick(() => { + // this.upDataListByVideoIdAndCommentId( + // this.intersectionList, + // this.topicVideoIdList[i].videoId, + // msgN[j].component_id, + // this.triggerDataList + // ); + // }); + //图表区表格数据 + let carTou = { headway: msgN[j].headway, avg: msgN[j].avg, max: msgN[j].max, med: msgN[j].med, - min: msgN[j].min - }); - this.$nextTick(() => { - this.upDataListByVideoIdAndCommentId( - this.intersectionList, - this.topicVideoIdList[i].videoId, - msgN[j].component_id, - this.triggerDataList - ); - }); - //表格数据 - let carTou = { + min: msgN[j].min, name: msgN[j].name, time: msgN[j].time, type: msgN[j].type, @@ -3033,19 +3050,19 @@ export default { } else if (msgN[j].component_type == '流量') { // console.log('实时触发trigger-流量', msgN[j]); //图表区 - this.addOrUpdateArrayItem(this.triggerFlowData, { - time: msgN[j].time, - in_flow: msgN[j].in_flow, - out_flow: msgN[j].out_flow - }); - this.$nextTick(() => { - this.upDataListByVideoIdAndCommentId( - this.intersectionList, - this.topicVideoIdList[i].videoId, - msgN[j].component_id, - this.triggerFlowData - ); - }); + // this.addOrUpdateArrayItem(this.triggerFlowData, { + // time: msgN[j].time, + // in_flow: msgN[j].in_flow, + // out_flow: msgN[j].out_flow + // }); + // this.$nextTick(() => { + // this.upDataListByVideoIdAndCommentId( + // this.intersectionList, + // this.topicVideoIdList[i].videoId, + // msgN[j].component_id, + // this.triggerFlowData + // ); + // }); //卡片区 let flowMap = { inFlow: msgN[j].in_flow, @@ -3062,6 +3079,8 @@ export default { }); //表格数据 let carTou = { + in_flow: msgN[j].in_flow, + out_flow: msgN[j].out_flow, name: msgN[j].name, time: msgN[j].time, type: msgN[j].type, @@ -3105,25 +3124,29 @@ export default { ); }); //图表区 - this.addOrUpdateArrayItem(this.triggerSpeedData, { - time: msgN[j].time, - speed: newSpeed, - originalSpeed: msgN[j].speed, + // 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, + // min: msgN[j].min + // }); + // this.$nextTick(() => { + // this.upDataListByVideoIdAndCommentId( + // this.intersectionList, + // this.topicVideoIdList[i].videoId, + // msgN[j].component_id, + // this.triggerSpeedData + // ); + // }); + //表格数据 + let carTou = { avg: msgN[j].avg, max: msgN[j].max, med: msgN[j].med, - min: msgN[j].min - }); - this.$nextTick(() => { - this.upDataListByVideoIdAndCommentId( - this.intersectionList, - this.topicVideoIdList[i].videoId, - msgN[j].component_id, - this.triggerSpeedData - ); - }); - //表格数据 - let carTou = { + min: msgN[j].min, name: msgN[j].name, time: msgN[j].time, type: msgN[j].type, @@ -3169,24 +3192,24 @@ export default { }); //图表区 // this.triggerTypeData = msgN[j].type_data; - this.triggerTypeData = [ - { - type_data: msgN[j].type_data, - time: msgN[j].time - } - ]; + // this.triggerTypeData = [ + // { + // type_data: msgN[j].type_data, + // time: msgN[j].time + // } + // ]; // this.addOrUpdateArrayItem(this.triggerTypeData, { // type_data: msgN[j].type_data, // time: msgN[j].time, // }); - this.$nextTick(() => { - this.upDataListByVideoIdAndCommentId( - this.intersectionList, - this.topicVideoIdList[i].videoId, - msgN[j].component_id, - this.triggerTypeData - ); - }); + // this.$nextTick(() => { + // this.upDataListByVideoIdAndCommentId( + // this.intersectionList, + // this.topicVideoIdList[i].videoId, + // msgN[j].component_id, + // this.triggerTypeData + // ); + // }); //表格数据 类型有点特殊需要重新比对 let carTou = { name: msgN[j].name, @@ -3235,24 +3258,28 @@ export default { ); }); //图表区 - this.addOrUpdateArrayItem(this.triggerNStayData, { - time: msgN[j].time, - n_stay: msgN[j].n_stay, + // this.addOrUpdateArrayItem(this.triggerNStayData, { + // time: msgN[j].time, + // n_stay: msgN[j].n_stay, + // avg: msgN[j].avg, + // max: msgN[j].max, + // med: msgN[j].med, + // min: msgN[j].min + // }); + // this.$nextTick(() => { + // this.upDataListByVideoIdAndCommentId( + // this.intersectionList, + // this.topicVideoIdList[i].videoId, + // msgN[j].component_id, + // this.triggerNStayData + // ); + // }); + //表格数据 + let carTou = { avg: msgN[j].avg, max: msgN[j].max, med: msgN[j].med, - min: msgN[j].min - }); - this.$nextTick(() => { - this.upDataListByVideoIdAndCommentId( - this.intersectionList, - this.topicVideoIdList[i].videoId, - msgN[j].component_id, - this.triggerNStayData - ); - }); - //表格数据 - let carTou = { + min: msgN[j].min, name: msgN[j].name, time: msgN[j].time, type: msgN[j].type, @@ -3295,18 +3322,18 @@ export default { ); }); //图表区 - this.addOrUpdateArrayItem(this.triggerNQueueData, { - time: msgN[j].time, - n_queue: msgN[j].n_queue - }); - this.$nextTick(() => { - this.upDataListByVideoIdAndCommentId( - this.intersectionList, - this.topicVideoIdList[i].videoId, - msgN[j].component_id, - this.triggerNQueueData - ); - }); + // this.addOrUpdateArrayItem(this.triggerNQueueData, { + // time: msgN[j].time, + // n_queue: msgN[j].n_queue + // }); + // this.$nextTick(() => { + // this.upDataListByVideoIdAndCommentId( + // this.intersectionList, + // this.topicVideoIdList[i].videoId, + // msgN[j].component_id, + // this.triggerNQueueData + // ); + // }); //表格数据 let carTou = { name: msgN[j].name, @@ -3339,15 +3366,26 @@ export default { // }); } else if (msgN[j].component_type == 'OD') { //图表区 - TODO 估计有未知问题 - this.addOrUpdateArrayItem(this.triggerODData, { + // this.addOrUpdateArrayItem(this.triggerODData, { + // ob_data: msgN[j].ob_data + // }); + // this.$nextTick(() => { + // this.upDataListByVideoIdAndCommentId( + // this.intersectionList, + // this.topicVideoIdList[i].videoId, + // msgN[j].component_id, + // this.triggerODData + // ); + // }); + let carTou = { ob_data: msgN[j].ob_data - }); + }; this.$nextTick(() => { - this.upDataListByVideoIdAndCommentId( + this.triggerDataCharts( this.intersectionList, this.topicVideoIdList[i].videoId, msgN[j].component_id, - this.triggerODData + carTou ); }); } @@ -4197,50 +4235,65 @@ export default { box-sizing: border-box; padding: 0 3%; } - .echartsList { + .echartList { width: 100%; height: calc(100% - 17%); - .echarts0 { - position: absolute; - width: 440px; - height: 282px; - z-index: 999; - } - .echarts1 { - position: absolute; - width: 440px; - height: 282px; - } - .echarts2 { - position: absolute; - width: 440px; - height: 282px; - } - .echarts3 { - position: absolute; - width: 440px; - height: 282px; - } - .echarts4 { - position: absolute; - width: 440px; - height: 282px; - } - .echarts5 { - position: absolute; - width: 440px; - height: 282px; - } - .echarts6 { - position: absolute; - width: 440px; - height: 282px; - } - .echarts7 { + & > div { position: absolute; width: 440px; height: 282px; } + // .echarts0 { + // position: absolute; + // width: 440px; + // height: 282px; + // z-index: 999; + // } + // .echarts1 { + // position: absolute; + // width: 440px; + // height: 282px; + // } + // .echarts2 { + // position: absolute; + // width: 440px; + // height: 282px; + // } + // .echarts3 { + // position: absolute; + // width: 440px; + // height: 282px; + // } + // .echarts4 { + // position: absolute; + // width: 440px; + // height: 282px; + // } + // .echarts5 { + // position: absolute; + // width: 440px; + // height: 282px; + // } + // .echarts6 { + // position: absolute; + // width: 440px; + // height: 282px; + // } + // .echarts7 { + // position: absolute; + // width: 440px; + // height: 282px; + // } + // .echarts8 { + // position: absolute; + // width: 440px; + // height: 282px; + // } + // .echarts9 { + // position: absolute; + // width: 440px; + // height: 282px; + // } } // .echarts { // width: 100%;