Commit 2738467c authored by xxx's avatar xxx

修改视频监控方法

parent 0fc62e89
......@@ -40,9 +40,9 @@
<div id="echarts2" class="echarts2" style="margin-top:1vh"></div>
<div class="aiAnalysisViews_1">报警车辆信息</div>
<el-table :data="aiAnalysisTableData" border style="width: 98%" height="24.5vh">
<el-table-column prop="carNo" label="车牌号" align="center"></el-table-column>
<el-table-column prop="type" label="报警类型" align="center"></el-table-column>
<el-table-column prop="createTime" label="报警时间" align="center"></el-table-column>
<el-table-column prop="vid" label="车牌号" align="center"></el-table-column>
<el-table-column prop="atpStr" label="报警类型" align="center"></el-table-column>
<el-table-column prop="stm" label="报警时间" align="center" :formatter="changeTime1"></el-table-column>
<el-table-column label="查看" align="center">
<template slot-scope="scope">
<el-image style="width: 70px; height: 50px" :src="imgSrcStart + 'avatar/' + scope.row.photo" :preview-src-list="[imgSrcStart + 'avatar/' + scope.row.photo]"></el-image>
......@@ -59,6 +59,7 @@
<script>
import { Tools, HttpReq, Dates} from '@/assets/js/common.js';
import * as echarts from 'echarts';
import axios from 'axios'
export default {
data() {
......@@ -85,12 +86,23 @@ export default {
total:30,
handle:10,
},
//所有车的信息
allCarData:'',
};
},
mounted() {
this.getCode();
this.echarts1Fn();
this.echarts2Fn();
HttpReq.truckDispatching.carMonitoringCarsQuery({size: 9999}).then((res) => {
let arr1 = '';
res.content.forEach((item,index)=>{
arr1 = arr1 + item.carnumber + ',';
})
arr1 = arr1.substring(0, arr1.length - 1);
this.allCarData = arr1;
this.aiTabPositionFn();
})
},
methods: {
getCode() {
......@@ -107,7 +119,6 @@ export default {
let fenquName = [];
res.content.forEach((item,index) => {
item.ref = "video" + index;
item.hls = null;
item.label = item.cameraName;
fenquName.push(item);
});
......@@ -128,13 +139,32 @@ export default {
if (data.children) {
return
} else {
//this.iframeSrc = this.defaultIframeSrc + data.carnumber;
this.iframeSrc = this.defaultIframeSrc + '202208221701';
this.iframeSrc = this.defaultIframeSrc + data.cameraName;
this.noPtz = true;
}
},
aiTabPositionFn(){
console.log(this.aiTabPosition);
let that = this;
if(this.aiTabPosition == '今天'){
let start = this.currentTime1(new Date(new Date(new Date().toLocaleDateString()).getTime()));
let end = this.currentTime1(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1));
//可配置参数的方式
axios.get('/jiankong', {
params: {
jsession:'1bf84ae637b843f2af24cf8c1502e9cf',
vehiIdno:that.allCarData,
begintime:start,
endtime:end,
armType:'670,671,620,621,624,625,400',
currentPage:0,
pageRecords:9999,
}
}).then(function (response) {
console.log(response.data.alarms);
that.aiAnalysisTableData = response.data.alarms;
})
}
},
//饼图1
echarts1Fn(){
......@@ -284,6 +314,41 @@ export default {
noPtzCloseFn(){
this.noPtz = false;
},
//转换时间格式(yyyy-mm-dd hh:mm:ss)
currentTime1(time){
var date = new Date(time);
var year = date.getFullYear(); //年 ,从 Date 对象以四位数字返回年份
var month = date.getMonth() + 1; //月 ,从 Date 对象返回月份 (0 ~ 11) ,date.getMonth()比实际月份少 1 个月
var day = date.getDate(); //日 ,从 Date 对象返回一个月中的某一天 (1 ~ 31)
var hours = date.getHours(); //小时 ,返回 Date 对象的小时 (0 ~ 23)
var minutes = date.getMinutes(); //分钟 ,返回 Date 对象的分钟 (0 ~ 59)
var seconds = date.getSeconds(); //秒 ,返回 Date 对象的秒数 (0 ~ 59)
//修改月份格式
if (month >= 1 && month <= 9) {
month = "0" + month;
}
//修改日期格式
if (day >= 0 && day <= 9) {
day = "0" + day;
}
//修改小时格式
if (hours >= 0 && hours <= 9) {
hours = "0" + hours;
}
//修改分钟格式
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
//修改秒格式
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
let currentFormatDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
return currentFormatDate;
},
changeTime1(row){
return this.currentTime1(row.stm);
}
},
//销毁
beforeDestroy() {
......
......@@ -139,8 +139,7 @@ export default {
if (data.children) {
return
} else {
//this.iframeSrc = this.defaultIframeSrc + data.carnumber;
this.iframeSrc = this.defaultIframeSrc + '202208221701';
this.iframeSrc = this.defaultIframeSrc + data.carnumber;
this.noPtz = true;
}
},
......@@ -153,7 +152,7 @@ export default {
axios.get('/jiankong', {
params: {
jsession:'1bf84ae637b843f2af24cf8c1502e9cf',
vehiIdno:'202208221701',
vehiIdno:that.allCarData,
begintime:start,
endtime:end,
armType:'670,671,620,621,624,625,400',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment