Commit 9f0099e6 authored by zhanglw's avatar zhanglw

安全报警,安全帽实况

parent b644004a
...@@ -3024,6 +3024,27 @@ var HttpReq = function(){ ...@@ -3024,6 +3024,27 @@ var HttpReq = function(){
params:param, params:param,
}) })
}, },
propleGetRealvideo: function(param){
return request({
url: '/tab/perhis/realvideo',
method: 'get',
params:param,
})
},
propleGetPerabnormal: function(param){
return request({
url: '/tab/perabnormal',
method: 'get',
params:param,
})
},
proplePutPerabnormal: function(data){
return request({
url: '/tab/perabnormal',
method: 'PUT',
data:data,
})
},
}, },
......
This diff is collapsed.
...@@ -59,7 +59,10 @@ ...@@ -59,7 +59,10 @@
</div> </div>
</div> </div>
<!-- 视频 --> <!-- 视频 -->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelForm" :visible="videoDia" :title="title" width="800px"> <el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelFormViedoRtc" :visible="videoRtc" title="实况" width="800px">
<video id="remoteVideo" controls style="width:100%;height:440px;"></video>
</el-dialog>
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelFormViedo" :visible="videoDia" title="回放" width="800px">
<div style="width:100%;height:440px;"> <div style="width:100%;height:440px;">
<video id="videoRealtime" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls data-setup="{}"> <video id="videoRealtime" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls data-setup="{}">
您的浏览器不支持:HTML5 video. 您的浏览器不支持:HTML5 video.
...@@ -75,17 +78,17 @@ ...@@ -75,17 +78,17 @@
placeholder="选择日期"> placeholder="选择日期">
</el-date-picker> </el-date-picker>
<el-button size="mini" type="success" icon="el-icon-search" @click="loadvideoList">查询</el-button> <el-button size="mini" type="success" icon="el-icon-search" @click="loadvideoList">查询</el-button>
<el-button size="mini" type="primary" icon="el-icon-video-camera" @click="videoPlay">实时播放</el-button> <el-button size="mini" type="primary" icon="el-icon-video-camera" @click="realVideo">实时播放</el-button>
</div> </div>
<el-table :data="videoList" border style="width:auto"> <el-table :data="videoList" border style="width:auto;height:45vh;overflow-y:auto">
<el-table-column prop="safetyhatmac" label="录像时间" align="center"> <el-table-column prop="safetyhatmac" label="录像时间" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{formatDate(scope.row.time)}} {{formatDate(scope.row.time)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100px"> <el-table-column label="操作" align="center" width="160px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" icon="el-icon-video-camera-solid" @click="videoPlay(scope.row)">播放</el-button> <el-button size="mini" icon="el-icon-video-camera-solid" @click="videoPlay(scope.row.url)">播放</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -109,6 +112,7 @@ ...@@ -109,6 +112,7 @@
<script> <script>
import {Tools, HttpReq, Dates} from '@/assets/js/common.js'; import {Tools, HttpReq, Dates} from '@/assets/js/common.js';
import {JSWebrtc} from '@/assets/js/jswebrtc.js';
import 'video.js/dist/video-js.css' import 'video.js/dist/video-js.css'
import videojs from 'video.js' import videojs from 'video.js'
import 'videojs-contrib-hls' import 'videojs-contrib-hls'
...@@ -120,11 +124,13 @@ export default { ...@@ -120,11 +124,13 @@ export default {
return { return {
configUrl: basePathUrl + 'config/config.json', configUrl: basePathUrl + 'config/config.json',
videoPlayer: null, videoPlayer: null,
videoRtcPlayer: null,
title: '新增', title: '新增',
photoView: false, photoView: false,
videoView: false, videoView: false,
loading: false, loading: false,
videoDia: false, videoDia: false,
videoRtc: false,
page: 1, page: 1,
size: 10, size: 10,
total: 0, total: 0,
...@@ -141,6 +147,7 @@ export default { ...@@ -141,6 +147,7 @@ export default {
photoList: [], photoList: [],
videoDate: '', videoDate: '',
videoList: [], videoList: [],
peoItem: null,
} }
}, },
mounted() { mounted() {
...@@ -187,11 +194,10 @@ export default { ...@@ -187,11 +194,10 @@ export default {
}, },
loadDataP() { loadDataP() {
var param = { var param = {
userid: this.userid, userid: this.peoItem.userid,
page: this.pageP, page: this.pageP,
}; };
this.$nextTick(() => { this.$nextTick(() => {
//获取安检信息
HttpReq.truckDispatching.propleGetHisphoto(param).then((res) => { HttpReq.truckDispatching.propleGetHisphoto(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(res.body.data){ if(res.body.data){
...@@ -209,13 +215,12 @@ export default { ...@@ -209,13 +215,12 @@ export default {
}, },
loadvideoList() { loadvideoList() {
let param = { let param = {
userid: this.userid, userid: this.peoItem.userid,
year: `${this.videoDate.getFullYear()}`, year: `${this.videoDate.getFullYear()}`,
month: `${('0' + (this.videoDate.getMonth() + 1)).substr(-2)}`, month: `${('0' + (this.videoDate.getMonth() + 1)).substr(-2)}`,
day: `${('0' + (this.videoDate.getDate())).substr(-2)}` day: `${('0' + (this.videoDate.getDate())).substr(-2)}`
}; };
this.$nextTick(() => { this.$nextTick(() => {
//获取安检信息
HttpReq.truckDispatching.propleGetHisvideo(param).then((res) => { HttpReq.truckDispatching.propleGetHisvideo(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(res.body.data){ if(res.body.data){
...@@ -232,12 +237,44 @@ export default { ...@@ -232,12 +237,44 @@ export default {
openPhotoView(item) { openPhotoView(item) {
this.title = '相册'; this.title = '相册';
this.photoView = true; this.photoView = true;
this.userid = item.userid; this.peoItem = item;
this.pageP = 1; this.pageP = 1;
this.photoList = []; this.photoList = [];
this.loadDataP(); this.loadDataP();
}, },
videoPlay(item){ realVideo(){
if(this.videoRtcPlayer){
this.videoRtcPlayer.destroy();
this.videoRtcPlayer = null;
}
this.videoRtc = true;
this.$nextTick(() => {
HttpReq.truckDispatching.propleGetRealvideo({
mac: this.peoItem.safetyhatmac,
}).then((res) => {
if (res.code == 200) {
if(res.body && res.body.api_url && res.body.play_url){
this.videoRtcPlayer = new JSWebrtc.Player(res.body.api_url, res.body.play_url, {
video: document.getElementById("remoteVideo"),
autoplay: true,
onPlay: () => {
console.log('开始播放');
},
onFail: () => {
console.log('播放失败');
this.videoRtcPlayer.destroy();
}
});
}else{
this.$message({
message: '链接失败!'+res.body.msg
});
}
}
})
})
},
videoPlay(url, tp){
this.videoDia = true; this.videoDia = true;
this.$nextTick(() => { this.$nextTick(() => {
if(!this.videoPlayer){ if(!this.videoPlayer){
...@@ -245,7 +282,7 @@ export default { ...@@ -245,7 +282,7 @@ export default {
fluid: true, fluid: true,
bigPlayButton: false, bigPlayButton: false,
textTrackDisplay: false, textTrackDisplay: false,
sources: [{ src:item.url, type: "video/mp4" }], sources: [{ src:url, type: tp||"video/mp4" }],
posterImage: true, posterImage: true,
errorDisplay: false, errorDisplay: false,
controlBar: true controlBar: true
...@@ -254,7 +291,7 @@ export default { ...@@ -254,7 +291,7 @@ export default {
this.videoPlayer.play(); this.videoPlayer.play();
}) })
}else{ }else{
let data = { src:item.url, type: "video/mp4" } let data = { src:url, type: tp||"video/mp4" }
this.videoPlayer.pause(); this.videoPlayer.pause();
this.videoPlayer.src(data); this.videoPlayer.src(data);
this.videoPlayer.load(data); this.videoPlayer.load(data);
...@@ -269,7 +306,7 @@ export default { ...@@ -269,7 +306,7 @@ export default {
openvideoView(item) { openvideoView(item) {
this.title = '视频回放'; this.title = '视频回放';
this.videoView = true; this.videoView = true;
this.userid = item.userid; this.peoItem = item;
this.videoList = []; this.videoList = [];
this.videoDate = new Date(); this.videoDate = new Date();
this.loadvideoList(); this.loadvideoList();
...@@ -303,6 +340,16 @@ export default { ...@@ -303,6 +340,16 @@ export default {
this.download(res, `人员设备历史记录${d.getFullYear()}${('0'+(d.getMonth()+1)).substr(-2)}${('0'+(d.getDate())).substr(-2)}`, 'xlsx') this.download(res, `人员设备历史记录${d.getFullYear()}${('0'+(d.getMonth()+1)).substr(-2)}${('0'+(d.getDate())).substr(-2)}`, 'xlsx')
}) })
}, },
cancelFormViedoRtc(){
this.videoRtc = false;
if(this.videoRtcPlayer){
this.videoRtcPlayer.destroy();
this.videoRtcPlayer = null;
}
},
cancelFormViedo(){
this.videoDia = false;
},
cancelForm() { cancelForm() {
this.photoView = false; this.photoView = false;
this.videoView = false; this.videoView = false;
...@@ -340,6 +387,9 @@ export default { ...@@ -340,6 +387,9 @@ export default {
</script> </script>
<style rel="stylesheet/scss" lang="scss" scope> <style rel="stylesheet/scss" lang="scss" scope>
div::-webkit-scrollbar{
display:none
}
.el-table .warning-row { .el-table .warning-row {
background: oldlace; background: oldlace;
} }
...@@ -412,10 +462,4 @@ export default { ...@@ -412,10 +462,4 @@ export default {
width: 308px; width: 308px;
height: 173px; height: 173px;
} }
.monitorCover_Video{
left: 50%;
transform: translateX(-50%);
width: 80vw;
height: 90vh;
}
</style> </style>
...@@ -226,7 +226,9 @@ export default { ...@@ -226,7 +226,9 @@ export default {
this.form.status.cu = 0; this.form.status.cu = 0;
this.form.visible = true; this.form.visible = true;
this.form.reqType = 'add'; this.form.reqType = 'add';
this.form.item = {}; this.form.item = {
limitclass: '限入',
};
this.picFileName = ''; this.picFileName = '';
this.checkDataList = []; this.checkDataList = [];
}, },
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<!-- 表单渲染 --> <!-- 表单渲染 -->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelForm" :visible.sync="editVisible" title="解除报警" width="500px"> <el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelForm" :visible.sync="editVisible" title="解除报警" width="500px">
<el-form :model="formData" :rules="rules" ref="formViewRef" :inline="true" label-width="180px"> <el-form :model="formData" :rules="rules" ref="formViewRef" :inline="true" label-width="180px">
<el-form-item label="解除时长:" class="form-cell" prop="jcHours" style="width:100%"> <el-form-item label="解除时长(h):" class="form-cell" prop="jcHours" style="width:100%">
<div class="cell-box"> <div class="cell-box">
<el-input v-model="formData.jcHours" class="cell-input" type="number"></el-input> <el-input v-model="formData.jcHours" class="cell-input" type="number"></el-input>
</div> </div>
......
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