Commit 1fb724cd authored by xxx's avatar xxx

1

parent 2fca3f05
...@@ -2480,6 +2480,14 @@ var HttpReq = function(){ ...@@ -2480,6 +2480,14 @@ var HttpReq = function(){
params:param, params:param,
}) })
}, },
//处理摄像头报警历史记录
apiCameraUrlUpdate: function(data){
return request({
url: '/api/CameraUrl',
method: 'PUT',
data:data,
})
},
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<label class="el-form-item-label" style="font-weight: 500;">报警类型</label> <label class="el-form-item-label" style="font-weight: 500;">报警类型</label>
<el-select v-model="query.name" placeholder="请选择报警类型" style="width:180px;"> <el-select v-model="query.name" placeholder="请选择报警类型" style="width:180px;">
<el-option label="接打电话" value="620,621"></el-option> <el-option label="接打电话" value="接打电话"></el-option>
<el-option label="分神驾驶" value="624,625"></el-option> <el-option label="分神驾驶" value="分神驾驶"></el-option>
<el-option label="前向碰撞" value="600,601"></el-option> <el-option label="前向碰撞" value="前向碰撞"></el-option>
<el-option label="疲劳驾驶" value="172,190"></el-option> <el-option label="疲劳驾驶" value="疲劳驾驶"></el-option>
<el-option label="接近报警" value="430,431,432,433"></el-option> <el-option label="接近报警" value="接近报警"></el-option>
</el-select> </el-select>
<label class="el-form-item-label" style="font-weight: 500;">时间范围</label> <label class="el-form-item-label" style="font-weight: 500;">时间范围</label>
...@@ -38,17 +38,25 @@ ...@@ -38,17 +38,25 @@
<el-table-column prop="vehiIdno" label="车牌号" align="center"></el-table-column> <el-table-column prop="vehiIdno" label="车牌号" align="center"></el-table-column>
<el-table-column prop="road" label="所属车队" align="center"></el-table-column> <el-table-column prop="road" label="所属车队" align="center"></el-table-column>
<el-table-column prop="name" label="报警类型" align="center"></el-table-column> <el-table-column prop="name" label="报警类型" align="center"></el-table-column>
<el-table-column prop="cardescribe" label="报警时间" align="center"></el-table-column> <el-table-column prop="fileTime" label="报警时间" align="center"></el-table-column>
<el-table-column label="查看" align="center"> <el-table-column label="查看图片" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image style="width: 70px; height: 50px" :src="scope.row.downloadUrl" :preview-src-list="[scope.row.downloadUrl]"></el-image> <el-image v-if="scope.row.type == 0" style="width: 70px; height: 50px" :src="scope.row.downloadUrl" :preview-src-list="[scope.row.downloadUrl]"></el-image>
<div v-else>暂无图片</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="gongsi" label="解除报警时间" align="center"></el-table-column> <el-table-column label="查看视频" align="center">
<el-table-column prop="weixiu" label="处理人" align="center"></el-table-column> <template slot-scope="scope">
<el-button v-if="scope.row.type == 1" size="mini" type="primary" @click="showVideo(scope.row)">查看视频</el-button>
<div v-else>暂无视频</div>
</template>
</el-table-column>
<el-table-column prop="updateTime" label="解除报警时间" align="center"></el-table-column>
<el-table-column prop="updateBy" label="处理人" align="center"></el-table-column>
<el-table-column label="操作" align="center" fixed="right"> <el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="primary" @click="relieveAlarm(scope.row)">解除报警</el-button> <el-button v-if="scope.row.status == 0" size="mini" type="primary" @click="relieveAlarm(scope.row)">解除报警</el-button>
<div v-else>已解除报警</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -60,6 +68,11 @@ ...@@ -60,6 +68,11 @@
</div> </div>
</div> </div>
<div class="videoMengCeng" v-if="videoSrcShow">
<div class="closeVideoDiv" @click="closeVideo"><i class="el-icon-close"></i></div>
<video :src="videoSrc" autoplay controls height="700px" width="1200px" class="videoShowDiv"></video>
</div>
</div> </div>
</template> </template>
...@@ -77,6 +90,8 @@ export default { ...@@ -77,6 +90,8 @@ export default {
query:{}, query:{},
tableData: [], tableData: [],
carInformationData:[], carInformationData:[],
videoSrc:'',
videoSrcShow:false,
} }
}, },
mounted() { mounted() {
...@@ -90,11 +105,22 @@ export default { ...@@ -90,11 +105,22 @@ export default {
param.page = this.page - 1; param.page = this.page - 1;
param.size = this.size; param.size = this.size;
if(this.query.startTime){ if(this.query.startTime){
param.startTime = Date.parse(this.query.startTime); param.startTime = this.currentTime(this.query.startTime);
} }
if(this.query.endTime){ if(this.query.endTime){
param.endTime = Date.parse(this.query.endTime); param.endTime = this.currentTime(this.query.endTime);
} }
var paramAll = {...this.query};
paramAll.page = 0;
paramAll.size = 99999;
if(this.query.startTime){
paramAll.startTime = this.currentTime(this.query.startTime);
}
if(this.query.endTime){
paramAll.endTime = this.currentTime(this.query.endTime);
}
this.$nextTick(()=>{ this.$nextTick(()=>{
//获取车辆信息(主要用来匹配车队) //获取车辆信息(主要用来匹配车队)
HttpReq.truckDispatching.carInformationQuery({size:9999}).then((res1) => { HttpReq.truckDispatching.carInformationQuery({size:9999}).then((res1) => {
...@@ -106,15 +132,17 @@ export default { ...@@ -106,15 +132,17 @@ export default {
let lastData1 = []; let lastData1 = [];
res2.data.forEach((item2,index)=>{ res2.data.forEach((item2,index)=>{
res1.data.content.forEach((item1,index1)=>{ res1.data.content.forEach((item1,index1)=>{
// if(item2.vehiIdno == item1.){ if(item2.vehiIdno == item1.number){
item2.road = item1.road;
// } lastData1.push(item2);
}
}) })
}) })
this.tableData = lastData1;
} }
}) })
//获取报警历史数据总数 //获取报警历史数据总数
HttpReq.truckDispatching.apiCameraUrllistQuery({size:99999,page:0}).then((res3) => { HttpReq.truckDispatching.apiCameraUrllistQuery(paramAll).then((res3) => {
if(res3.code == 200){ if(res3.code == 200){
this.total = res3.data.length; this.total = res3.data.length;
} }
...@@ -140,6 +168,8 @@ export default { ...@@ -140,6 +168,8 @@ export default {
}, },
//重置搜索 //重置搜索
clearLimit(){ clearLimit(){
this.page = 1;
this.size = 10;
this.query = {}; this.query = {};
this.loadData(); this.loadData();
}, },
...@@ -152,9 +182,76 @@ export default { ...@@ -152,9 +182,76 @@ export default {
this.size = e this.size = e
this.loadData() this.loadData()
}, },
//时间格式处理
currentTime(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;
}
//获取当前系统时间 格式(yyyy-mm-dd hh:mm:ss)
let currentFormatDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
return currentFormatDate;
},
//解除报警 //解除报警
relieveAlarm(item){ relieveAlarm(item){
console.log(item); this.$confirm('请确认是否处理此条报警信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let lastData = {...item};
lastData.status = 1;
HttpReq.truckDispatching.apiCameraUrlUpdate(lastData).then((res) => {
if(res.code == 200){
this.$notify({
title: '车队修改成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
})
this.loadData();
}).catch(() => {});
},
//查看视频
showVideo(item){
this.videoSrcShow = true;
this.videoSrc = item.downloadUrl;
},
//关闭视频
closeVideo(){
this.videoSrcShow = false;
this.videoSrc = '';
} }
}, },
} }
...@@ -196,4 +293,25 @@ export default { ...@@ -196,4 +293,25 @@ export default {
>div{position:absolute;top:0;left:0;height:100%;width:100%;} >div{position:absolute;top:0;left:0;height:100%;width:100%;}
} }
} }
.videoMengCeng{
width: 100%;
height: 100%;
padding: 4vh 0px 0px 10vw;
box-sizing: border-box;
background-color: rgba(0,0,0,0.8);
z-index: 50;
position: absolute;
top: 0px;
left: 0px;
}
.closeVideoDiv{
position: absolute;
right: 2vw;
top: 2vh;
color: white;
z-index: 51;
font-size: 50px;
font-weight: 600;
cursor: pointer;
}
</style> </style>
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