修改首页报警样式及视频联动页面样式

main
jinna 2 years ago
parent 457fa291ac
commit 504b291b60
  1. BIN
      src/assets/audio/alarm.mp3
  2. BIN
      src/assets/audio/alarm1.mp3
  3. BIN
      src/assets/audio/ifame.mp3
  4. BIN
      src/assets/image/alarm.png
  5. BIN
      src/assets/image/alarm_muted.png
  6. BIN
      src/assets/image/alarm_muted1.png
  7. 247
      src/page/index/index.vue
  8. 10
      src/router/views/index.js
  9. 50
      src/views/alarmcenter/index.vue
  10. 227
      src/views/alarmcenter/sosAlarm/list.vue
  11. 23
      src/views/components/h5Player/player.vue
  12. 479
      src/views/h5Player/player.vue
  13. 168
      src/views/h5Player/player1.vue
  14. 2
      src/views/wirelessintrusion/deployment/list.vue
  15. 50
      src/views/wirelessintrusion/warn/record.vue

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

@ -1,6 +1,20 @@
<template>
<div class="avue-contail" :class="{'avue--collapse':isCollapse}">
<audio style="display:none;" controls id="play_audio" :muted="isMuted" :playsinline="isPlay">
<div id="contain" class="avue-contail" :class="{'avue--collapse':isCollapse}">
<!-- <iframe id="iframeDom" allow="autoplay" src="~@/assets/audio/alarm.mp3" ></iframe> -->
<!-- <iframe src="~@/assets/audio/iframe.mp3" id="idrameDom" allow="autoplay" frameborder="0"></iframe> -->
<div class="top_alarm" v-show="isShowAlarm">
<div class="alarm_mess">
<div class="alarm_img" @click="closeAlarm">
<img v-show="!isAlarm" style="width:20px;height:20px" src="~@/assets/image/alarm.png" alt="">
<img v-show="isAlarm" style="width:20px;height:20px" src="~@/assets/image/alarm_muted.png" alt="">
</div>
<div class="alarm_info">
<p> {{alarmInfo}}</p>
</div>
<div class="alarm_cancel" @click="cancelAlarm">X</div>
</div>
</div>
<audio style="display:none;" controls id="play_audio" preload="auto" :loop="isLoop">
<source src="~@/assets/audio/alarm.mp3" />
</audio>
<div class="avue-header">
@ -29,6 +43,20 @@
</div>
</div>
<div class="avue-shade" @click="showCollapse"></div>
<el-dialog title="视频联动" :visible.sync="dialogVisible" v-if="dialogVisible" :append-to-body="true"
:close-on-click-modal="false" :close-on-press-escape="false" custom-class="video_diao" >
<div class="video_box">
<!-- <el-row :gutter="20"> -->
<!-- <el-col :span="6" v-for="item in videoData" :key="item.id">
<VideoPlayer :name="item.name" :id="item.id" :code="renderCode(item.tags)"
:url="'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv'"
:playbackUrl="'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv'" />
</el-col> -->
<player :list="videoData" :showLeft="false"></player>
<!-- </el-row> -->
</div>
</el-dialog>
</div>
</template>
@ -43,6 +71,7 @@
import {calcDate} from "@/util/date.js";
import {getStore} from "@/util/store.js";
import {getAlarm} from "@/api/alarm/alarm"
import player from "@/views/components/h5Player/player.vue"
export default {
@ -50,7 +79,8 @@
top,
tags,
search,
sidebar
sidebar,
player
},
name: "index",
provide() {
@ -60,6 +90,8 @@
},
data() {
return {
videoData:[],
dialogVisible:false,
//
isSearch: false,
//token
@ -67,15 +99,31 @@
//token
refreshTime: "",
times:0,
start:0
start:0,
isAlarm:false,
alarmInfo:'',
isShowAlarm:false,
timer:null,
isLoop:false
};
},
beforeCreate(){
},
created() {
//token
this.refreshToken();
// const iframeDom = document.getElementById('iframeDom');
// iframeDom.onload = () =>{
// console.log('')
// }
},
mounted() {
this.init();
let dom = document.querySelector('#contain')
dom.addEventListener('mousemove',()=>{
// console.log('123123')
})
// if(!window.sessionStorage.getItem("click")){
// this.$alert('', '', {
// confirmButtonText: '',
@ -84,11 +132,12 @@
// // socket
window.addEventListener('onmessageWS', this.getSocketData);
// this.timer = setInterval(() =>{
// this.getSocketData('222')
// },3000)
// console.log('5')
// this.getSocketData('22222')
// },5000)
// setTimeout(() =>{
// clearInterval(this.timer)
// },6200)
// },11200)
// }
// });
// }else{
@ -122,11 +171,27 @@
console.log(res)
})
},
closeAlarm(){
this.isAlarm = !this.isAlarm
if(this.isAlarm){
document.querySelector('#play_audio').pause()
}else{
document.querySelector('#play_audio').play()
}
},
cancelAlarm(){
this.isShowAlarm = false;
// this.isAlarm = true
document.querySelector('#play_audio').pause()
},
getSocketData(res) {
console.log(res)
this.cameraCode = []
// this.times++;
// let dom = document.querySelector('#play_audio')
let dom = document.querySelector('#play_audio')
// console.log('dom ===>',dom)
// dom.pause()
dom.pause()
// clearInterval(this.timer)
// if(this.times > 0){
// if(dom.readyState == 4){
// for(let i = 0;i<=this.times;i++){
@ -153,43 +218,102 @@
// message: res,
// type: 'warning'
// })
if (res.detail.data === 'success' || res.detail.data === '连接成功' || res.detail.data === 'heartBath') return
// ...
// // ...
let obj = res.detail.data.indexOf('{') > -1 ? JSON.parse(res.detail.data) : null;
this.times++;
let dom = document.querySelector('#play_audio')
console.log('dom ===>',dom)
dom.pause()
if(this.times > 0){
console.log(this.times)
if(dom.readyState == 4){
for(let i = 0;i<=this.times;i++){
setTimeout(() =>{
this.start++;
this.times--;
this.isMuted = false,
this.isPlay = true
dom.play()
},2500 * i)
}
console.log('obj ===>',obj.cameraCode.indexOf('-') > -1)
if(obj.cameraCode.indexOf('-') > -1){
let arr = obj.cameraCode.split('-')
arr.map(item =>{
this.videoData.push({code:item})
})
if(this.isShowAlarm){
if(this.isAlarm){
return
}else{
console.log('已经存在报警信息')
this.alarmInfo = obj.buildId + '号楼' + obj.floorNo + '层发生报警:' + obj.content
this.isLoop = true;
dom.play()
}
}else{
this.isShowAlarm = true;
if(this.isAlarm){
return
}else{
console.log('已经存在报警信息')
this.alarmInfo = obj.buildId + '号楼' + obj.floorNo + '层发生报警:' + obj.content
this.isLoop = true;
dom.play()
}
}
this.dialogVisible = true
}else{
if(dom.readyState == 4){
this.isMuted = false,
this.isPlay = true
this.start = 0
this.videoData.push({code:obj.cameraCode})
if(this.isShowAlarm){
if(this.isAlarm){
return
}else{
console.log('已经存在报警信息')
this.alarmInfo = obj.buildId + '号楼' + obj.floorNo + '层发生报警:' + obj.content
this.isLoop = true;
dom.play()
}
}
if (obj) {
this.$notify({
title: '警告',
message: obj.buildId + '号楼' + obj.floorNo + '层发生报警:' + obj.content,
type: 'warning'
});
}else{
this.isShowAlarm = true;
if(this.isAlarm){
return
}else{
console.log('已经存在报警信息')
this.alarmInfo = obj.buildId + '号楼' + obj.floorNo + '层发生报警:' + obj.content
this.isLoop = true;
dom.play()
}
}
this.dialogVisible = true
}
console.log('cameraCode ====>',this.videoData)
// this.times++;
// let dom = document.querySelector('#play_audio')
// console.log('dom ===>',dom)
// dom.pause()
// if(this.times > 0){
// console.log(this.times)
// if(dom.readyState == 4){
// for(let i = 0;i<=this.times;i++){
// setTimeout(() =>{
// this.start++;
// this.times--;
// this.isMuted = false,
// this.isPlay = true
// dom.play()
// },2500 * i)
// }
// }
// }else{
// if(dom.readyState == 4){
// this.isMuted = false,
// this.isPlay = true
// this.start = 0
// dom.play()
// }
// }
// if (obj) {
// this.$notify({
// title: '',
// message: obj.buildId + '' + obj.floorNo + '' + obj.content,
// type: 'warning'
// });
// }
},
showCollapse() {
this.$store.commit("SET_COLLAPSE");
@ -261,3 +385,50 @@
}
};
</script>
<style lang="scss" scoped>
.top_alarm{
padding-left: 240px;
height: 40px;
.alarm_mess{
padding: 0 20px;
height: 100%;
background: rgb(231, 199, 199);
display: flex;
align-items: center;
justify-content: space-between;
.alarm_info{
flex: 1;
height: 100%;
display: flex;
align-items: center;
white-space: nowrap;
overflow: hidden;
p{
width: 99%;
animation: scrolling 20s linear infinite;
}
}
@keyframes scrolling {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}
.alarm_cancel{
color: #8a8a8a;
cursor: pointer;
}
}
}
</style>
<style lang="scss">
.video_diao{
width: 70%;
height: 700px;
}
</style>

@ -145,4 +145,14 @@ export default [
isAuth: false,
},
},
{
path: "/videoPlayer",
name: "语音调度",
component: () =>
import(/* webpackChunkName: "views" */ "@/views/h5Player/player"),
meta: {
isTab: false,
isAuth: false,
},
},
];

@ -25,7 +25,7 @@
:url="'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv'"
:playbackUrl="'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv'" />
</el-col> -->
<player :list="videoData"></player>
<player :list="videoData" :showLeft="true"></player>
</el-row>
</div>
</el-dialog>
@ -91,19 +91,19 @@ export default {
label: "设备类型",
prop: "productName",
},
{
label: "报警类型",
type: "select",
dicUrl: "/api/blade-system/dict-biz/dictionary?code=alarm_message_condition",
props: {
label: "dictValue",
value: "dictKey"
},
dataType: "number",
slot: true,
prop: "type",
// search: true,
},
// {
// label: "",
// type: "select",
// dicUrl: "/api/blade-system/dict-biz/dictionary?code=alarm_message_condition",
// props: {
// label: "dictValue",
// value: "dictKey"
// },
// dataType: "number",
// slot: true,
// prop: "type",
// // search: true,
// },
{
label: "楼号",
prop: "buildId",
@ -250,7 +250,16 @@ export default {
this.$message.warning('未查询到该报警点摄像头');
}
else{
this.dialogVisible = true;
// this.dialogVisible = true;
const routeData = this.$router.resolve({
path: '/videoPlayer', //
query: {
list: JSON.stringify(this.videoData), //
showLeft:true
}
})
console.log('href ===>',routeData.href)
window.open(routeData.href, '_blank')
}
});
})
@ -267,7 +276,16 @@ export default {
this.$message.warning('未查询到该报警点摄像头');
}
else{
this.dialogVisible = true;
// this.dialogVisible = true;
const routeData = this.$router.resolve({
path: '/videoPlayer', //
query: {
list: JSON.stringify(this.videoData), //
showLeft:true
}
})
console.log('href ===>',routeData.href)
window.open(routeData.href, '_blank')
}
}
});

@ -279,7 +279,16 @@ export default {
if(this.carmeraCode.length === 0){
this.$message.warning('未查询到该报警点摄像头');
}else{
this.dialogVisible = true;
// this.dialogVisible = true;
const routeData = this.$router.resolve({
path: '/videoPlayer', //
query: {
list: JSON.stringify(this.carmeraCode), //
showLeft:true
}
})
console.log('href ===>',routeData.href)
window.open(routeData.href, '_blank')
}
})
// this.dialogVisible = true;
@ -288,100 +297,65 @@ export default {
})
} else {
// console.log('ceshi2')
this.videoData = [
{
"id":5,
"sort":null,
"version":null,
"createTime":"2023-10-1410:59:40",
"updateTime":"2023-10-1410:59:40",
"delFlag":"0",
"createUser":"client",
"updateUser":"client",
"buildId":206885,
"departmentId":null,
"name":"WLJK-13F-1-3",
"sn":"",
"ip":null,
"brand":"",
"httpPost":null,
"serverPost":null,
"userName":null,
"password":null,
"rtspRealTimeUrl":"rtsp://admin:qlyy123456@171.16.234.5/Streaming/Channels/101?transportmode=unicast",
"rtspHistoryUrl":"",
"rtspDateFormat":"",
"rtspTimeFormat":"",
"floorNo":"Floor13",
"x":213832,
"y":197192,
"videoCode":"H265"
},
{
"id":25,
"sort":null,
"version":null,
"createTime":"2023-10-1516:07:07",
"updateTime":"2023-10-1516:07:07",
"delFlag":"0",
"createUser":"client",
"updateUser":"client",
"buildId":206885,
"departmentId":null,
"name":"JK-13F-1-3",
"sn":"",
"ip":null,
"brand":"",
"httpPost":null,
"serverPost":null,
"userName":null,
"password":null,
"rtspRealTimeUrl":"rtsp://admin:qlyy123456@171.16.234.98/Streaming/Channels/101?transportmode=unicast",
"rtspHistoryUrl":"",
"rtspDateFormat":"",
"rtspTimeFormat":"",
"floorNo":"Floor13",
"x":220432,
"y":200450,
"videoCode":"H265"
},
]
let arr = []
this.videoData.map(item =>{
arr.push(item.name)
})
let tmp = arr.join(',')
console.log('tmp ===>',tmp)
getCameraCode({keys:tmp}).then(res =>{
console.log(res)
// this.carmeraCode = res.data.data
this.carmeraCode = [
{code: "3904f09529de44ffadccaecce4397dcb",name: "JK-13F-1-3"},
{code: "b9697af4dc0544cd85cc76811e08d371",name: "WLJK-13F-1-3"},
]
if(this.carmeraCode.length === 0){
this.$message.warning('未查询到该报警点摄像头');
}else{
this.dialogVisible = true;
}
})
// getDeviceCamera(token, { sn: row.hostSerialNumber }).then(res2 => {
// if (res2.data.code == 401) {
// window.sessionStorage.removeItem('bizToken');
// this.linkVideo(row);
// }
// else if (res2.data.code == 0) {
// const data = res2.data;
// this.videoData = data.data;
// console.log('videoData11 ===>',this.videoData)
// if(this.videoData.length === 0){
// this.$message.warning('');
// }
// else{
// // this.dialogVisible = true;
// let arr = []
// this.videoData = [
// {
// "id":5,
// "sort":null,
// "version":null,
// "createTime":"2023-10-1410:59:40",
// "updateTime":"2023-10-1410:59:40",
// "delFlag":"0",
// "createUser":"client",
// "updateUser":"client",
// "buildId":206885,
// "departmentId":null,
// "name":"WLJK-13F-1-3",
// "sn":"",
// "ip":null,
// "brand":"",
// "httpPost":null,
// "serverPost":null,
// "userName":null,
// "password":null,
// "rtspRealTimeUrl":"rtsp://admin:qlyy123456@171.16.234.5/Streaming/Channels/101?transportmode=unicast",
// "rtspHistoryUrl":"",
// "rtspDateFormat":"",
// "rtspTimeFormat":"",
// "floorNo":"Floor13",
// "x":213832,
// "y":197192,
// "videoCode":"H265"
// },
// {
// "id":25,
// "sort":null,
// "version":null,
// "createTime":"2023-10-1516:07:07",
// "updateTime":"2023-10-1516:07:07",
// "delFlag":"0",
// "createUser":"client",
// "updateUser":"client",
// "buildId":206885,
// "departmentId":null,
// "name":"JK-13F-1-3",
// "sn":"",
// "ip":null,
// "brand":"",
// "httpPost":null,
// "serverPost":null,
// "userName":null,
// "password":null,
// "rtspRealTimeUrl":"rtsp://admin:qlyy123456@171.16.234.98/Streaming/Channels/101?transportmode=unicast",
// "rtspHistoryUrl":"",
// "rtspDateFormat":"",
// "rtspTimeFormat":"",
// "floorNo":"Floor13",
// "x":220432,
// "y":200450,
// "videoCode":"H265"
// },
// ]
// let arr = []
// this.videoData.map(item =>{
// arr.push(item.name)
// })
@ -389,16 +363,69 @@ export default {
// console.log('tmp ===>',tmp)
// getCameraCode({keys:tmp}).then(res =>{
// console.log(res)
// this.carmeraCode = res.data.data
// // this.carmeraCode = res.data.data
// this.carmeraCode = [
// {code: "3904f09529de44ffadccaecce4397dcb",name: "JK-13F-1-3"},
// {code: "b9697af4dc0544cd85cc76811e08d371",name: "WLJK-13F-1-3"},
// ]
// if(this.carmeraCode.length === 0){
// this.$message.warning('');
// }else{
// this.dialogVisible = true;
// // this.dialogVisible = true;
// const routeData = this.$router.resolve({
// path: '/videoPlayer', //
// query: {
// list: JSON.stringify(this.carmeraCode), //
// showLeft:true
// }
// })
// console.log('href ===>',routeData.href)
// window.open(routeData.href, '_blank')
// }
// })
// }
// }
// });
getDeviceCamera(token, { sn: row.hostSerialNumber }).then(res2 => {
if (res2.data.code == 401) {
window.sessionStorage.removeItem('bizToken');
this.linkVideo(row);
}
else if (res2.data.code == 0) {
const data = res2.data;
this.videoData = data.data;
console.log('videoData11 ===>',this.videoData)
if(this.videoData.length === 0){
this.$message.warning('未查询到该报警点摄像头');
}
else{
// this.dialogVisible = true;
let arr = []
this.videoData.map(item =>{
arr.push(item.name)
})
let tmp = arr.join(',')
console.log('tmp ===>',tmp)
getCameraCode({keys:tmp}).then(res =>{
console.log(res)
this.carmeraCode = res.data.data
if(this.carmeraCode.length === 0){
this.$message.warning('未查询到该报警点摄像头');
}else{
// this.dialogVisible = true;
const routeData = this.$router.resolve({
path: '/videoPlayer', //
query: {
list: JSON.stringify(this.carmeraCode), //
showLeft:true
}
})
console.log('href ===>',routeData.href)
window.open(routeData.href, '_blank')
}
})
}
}
});
}
},
//

@ -1,7 +1,7 @@
<template>
<div class="container">
<div id="player"></div>
<div class="form_box">
<div id="player" :style="{width:!showLeft ? '100%' : '65%'}"></div>
<div class="form_box" v-show="showLeft">
<el-form>
<el-form-item label="当前选中摄像头">
{{
@ -19,7 +19,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="预览">
<el-button id="btn-realplay" @click="realplay">开始预览</el-button>
<el-button id="btn-realplay" @click="queryLive">开始预览</el-button>
<el-button id="btn-realplay-stop" @click="stopPlay">停止预览</el-button>
<el-button id="btn-stopall" @click="stopAllPlay"
>停止全部窗口</el-button
@ -101,6 +101,9 @@ export default {
type: Array,
default: () => [],
},
showLeft:{
type:Boolean
}
},
data() {
return {
@ -140,6 +143,7 @@ export default {
};
},
created() {
console.log('list ===>',this.list)
this.cameraList = []
let isTags = this.list.find(item => item.tags)
if(isTags){
@ -235,14 +239,15 @@ export default {
},
});
// _this.realplay();
console.log('length ===>',this.cameraList.length)
this.splitNum =
this.list.length > 1
this.cameraList.length > 1
? 2
: this.list.length > 4
: this.cameraList.length > 4
? 3
: this.list.length > 9
: this.cameraList.length > 9
? 4
: 4;
: 2;
this.arrangeWindow()
this.queryLive();
},
@ -348,12 +353,12 @@ export default {
queryLivePreview({ cameraIndexCode: code.code }).then((res) => {
console.log('res ====>',res)
if (res.data.code === 0 || res.data.code == 200) {
playUrlList.push({name:code.name, code: code.tags ? JSON.parse(code.tags).cameraIndexCode : code.code, url: res.data.data });
playUrlList.push({name:code.name ? code.name : '', code: code.tags ? JSON.parse(code.tags).cameraIndexCode : code.code, url: res.data.data });
this.playUrlList = playUrlList;
this.realplay(index, res.data.data);
}
// else{
// playUrlList.push({name:code.name, code: code.tags ? JSON.parse(code.tags).cameraIndexCode : code.code, url: 'ws://171.16.8.60:559/openUrl/QKCBP32' });
// playUrlList.push({name:code.name ? code.name : '', code: code.tags ? JSON.parse(code.tags).cameraIndexCode : code.code, url: 'ws://171.16.8.60:559/openUrl/QKCBP32' });
// this.playUrlList = playUrlList;
// this.realplay(index, 'ws://171.16.8.60:559/openUrl/QKCBP32');
// }

@ -0,0 +1,479 @@
<template>
<div class="container">
<div id="player" :style="{width:!showLeft ? '100%' : '65%'}"></div>
<div class="form_box" v-show="showLeft">
<el-form>
<el-form-item label="当前选中摄像头">
{{
this.playUrlList.length > 0 && this.player
? this.playUrlList[this.player.currentWindowIndex].name
: "--"
}}
</el-form-item>
<el-form-item label="分屏">
<el-radio-group v-model="splitNum" @change="arrangeWindow">
<el-radio-button label="1">1x1</el-radio-button>
<el-radio-button label="2">2x2</el-radio-button>
<el-radio-button label="3">3x3</el-radio-button>
<el-radio-button label="4">4x4</el-radio-button>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="预览">
<el-button id="btn-realplay" @click="queryLive">开始预览</el-button>
<el-button id="btn-realplay-stop" @click="stopPlay">停止预览</el-button>
<el-button id="btn-stopall" @click="stopAllPlay"
>停止全部窗口</el-button
>
</el-form-item> -->
<el-form-item label="回放时间">
<el-date-picker
v-model="timeRange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
<!-- <el-date-picker
v-model="timeRange"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker> -->
<!-- <e-date-picker
placeholder="开始时间"
format="yyyy-MM-dd HH:mm:ss"
v-model="playback.startTime"
:value-format="playback.valueFormat"
>
</e-date-picker>
<e-date-picker
placeholder="结束时间"
format="yyyy-MM-dd HH:mm:ss"
v-model="playback.endTime"
:value-format="playback.valueFormat"
>
</e-date-picker> -->
</el-form-item>
<el-form-item label="回放">
<el-button id="btn-playback" @click="playbackQuery">开始回放</el-button>
<el-button id="btn-playback-pause" @click="playbackPause"
>暂停</el-button
>
<el-button id="btn-playback-sesume" @click="playbackResume"
>恢复</el-button
>
<el-button id="btn-playback-stop" @click="stopPlay">停止回放</el-button>
</el-form-item>
<el-form-item label="抓图">
<el-button id="btn-capture-jpeg" @click="capture('JPEG')"
>抓取JPEG</el-button
>
<el-button id="btn-capture-bmp" @click="capture('BMP')"
>抓取BMP</el-button
>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
const IS_MOVE_DEVICE = document.body.clientWidth < 992; //
const MSE_IS_SUPPORT = !!window.MediaSource; // mse
// import "@/static/js/h5player.min.js"
import {
queryLivePreview,
queryLiveBack,
} from "@/api/wirelessintrusion/wirelessintrusion";
export default {
// props: {
// list: {
// // cameraCode
// type: Array,
// default: () => [],
// },
// showLeft:{
// type:Boolean
// }
// },
data() {
return {
player: null,
playUrlList: [], //
splitNum: 1,
mseSupport: MSE_IS_SUPPORT,
// tabActive: MSE_IS_SUPPORT ? 'mse' : 'decoder',
tabActive: "decoder",
urls: {
realplay: "ws://10.19.147.22:559/EUrl/q2jQie4",
talk: "wss://10.41.163.126:6014/proxy/10.41.163.126:559/EUrl/6gFx47S",
playback:
"wss://10.41.163.126:6014/proxy/10.41.163.126:559/EUrl/6gFx47S",
},
playback: {
startTime: "2021-07-26 00:00:00",
endTime: "2021-07-26 23:59:59",
valueFormat: "",
seekStart: "2021-07-26T12:00:00",
rate: "",
},
muted: true,
volume: 50,
volumeOnSvg: {
template:
'<svg t="1624453273744" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1421" width="200" height="200"><path d="M597.994667 138.005333q130.005333 28.010667 213.994667 132.992t84.010667 241.002667-84.010667 241.002667-213.994667 132.992l0-88q93.994667-28.010667 153.002667-106.005333t59.008-180.010667-59.008-180.010667-153.002667-106.005333l0-88zM704 512q0 120-106.005333 172.010667l0-344q106.005333 52.010667 106.005333 172.010667zM128 384l170.005333 0 213.994667-213.994667 0 684.010667-213.994667-213.994667-170.005333 0 0-256z" p-id="1422"></path></svg>',
},
volumeOffSvg: {
template:
'<svg t="1624453193279" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9147" width="200" height="200"><path d="M512 170.005333l0 180.010667-90.005333-90.005333zM181.994667 128l714.005333 714.005333-53.994667 53.994667-88-88q-74.005333 58.005333-156.010667 77.994667l0-88q50.005333-13.994667 96-50.005333l-181.994667-181.994667 0 288-213.994667-213.994667-170.005333 0 0-256 202.005333 0-202.005333-202.005333zM810.005333 512q0-101.994667-59.008-180.010667t-153.002667-106.005333l0-88q130.005333 28.010667 213.994667 132.992t84.010667 241.002667q0 96-44.010667 178.005333l-64-66.005333q21.994667-53.994667 21.994667-112zM704 512q0 18.005333-2.005333 26.005333l-104-104 0-93.994667q106.005333 52.010667 106.005333 172.010667z" p-id="9148"></path></svg>',
},
recordStartState: 0,
recordStartText: "录像",
timeRange:[],
cameraList:[],
list:[],
showLeft:true
};
},
created() {
// this.qrcodeData1 = this.$route.query.category
console.log('list ===============>',JSON.parse(this.$route.query.list), this.$route.query.showLeft)
// console.log('list ===>',this.list)
this.list = JSON.parse(this.$route.query.list);
this.showLeft = this.$route.query.showLeft
this.cameraList = []
let isTags = this.list.find(item => item.tags)
if(isTags){
this.list.map(item =>{
console.log('code ====>',JSON.parse(item.tags).cameraIndexCode)
if(JSON.parse(item.tags).cameraCode){
if(JSON.parse(item.tags).cameraCode.indexOf('-') != -1){
JSON.parse(item.tags).cameraCode.split('-').map(item1=>{
this.cameraList.push({name:item.name,code:item1})
})
}else{
this.cameraList.push({name:item.name,code:item.cameraCode})
}
}
})
}else{
this.cameraList = this.list
}
console.log('cameraList =====>',this.cameraList)
// this.timeRange = [this.getYestDayOrNextDay() + ' 00:00:00',new Date().toLocaleString()]
// h5
setTimeout(() => {
this.init();
this.createPlayer();
// this.arrangeWindow();
});
},
methods: {
getYestDayOrNextDay() {
//
const today = new Date();
//
const yesterday = new Date(today);
yesterday.setDate(today.getDate() - 1);
return yesterday.toLocaleDateString();
},
//
init() {
//
window.addEventListener("resize", () => {
this.player.JS_Resize();
});
},
createPlayer() {
this.player = new window.JSPlugin({
szId: "player",
szBasePath: "/js/", //public/jsjs
iMaxSplit: 4,
iCurrentSplit: 2,
openDebug: true,
oStyle: {
borderSelect: "#FFCC00",
},
});
let _this = this;
//
this.player.JS_SetWindowControlCallback({
windowEventSelect: function (iWndIndex) {
//
console.log("windowSelect callback: ", iWndIndex);
},
pluginErrorHandler: function (iWndIndex, iErrorCode, oError) {
//
console.log("pluginError callback: ", iWndIndex, iErrorCode, oError);
},
windowEventOver: function (iWndIndex) {
//
//console.log(iWndIndex);
},
windowEventOut: function (iWndIndex) {
//
//console.log(iWndIndex);
},
windowEventUp: function (iWndIndex) {
//mouseup
//console.log(iWndIndex);
},
windowFullCcreenChange: function (bFull) {
//
console.log("fullScreen callback: ", bFull);
},
firstFrameDisplay: function (iWndIndex, iWidth, iHeight) {
//
console.log(
"firstFrame loaded callback: ",
iWndIndex,
iWidth,
iHeight
);
},
performanceLack: function () {
//
console.log("performanceLack callback: ");
},
});
// _this.realplay();
console.log('length ===>',this.cameraList.length)
this.splitNum =
this.cameraList.length > 1
? 2
: this.cameraList.length > 4
? 3
: this.cameraList.length > 9
? 4
: 2;
this.arrangeWindow()
this.queryLive();
},
arrangeWindow() {
// const splitNum = this.splitNum;
// console.log(this.player)
let splitNum = Number(this.splitNum)
this.player.JS_ArrangeWindow(splitNum).then(
() => { console.log(`arrangeWindow to ${splitNum}x${splitNum} success`) },
e => { console.error(e) }
)
},
//
//
realplay(index, url) {
if (this.playUrlList.length === 0) {
this.$message.warning("当前没有可播放的摄像头");
return;
}
// this.mode = 0 //0 1
// const { player, mode, urls } = this,
// index = player.currentWindowIndex
// // playURL = this.realplay
// console.log('playURL ==>',playURL,'mode ===>',mode,'index1 ===>',index1)
// player.JS_Play(playURL, { playURL, mode }, index1).then(
// () => {
// console.log('realplay success')
// },
// e => { console.error(e) }
// )
if (this.player === null) return;
// let { mode, player } = this;
// let index = this.player.currentWindowIndex;
let mode = 0;
// let playURL = this.playUrlList[player.currentWindowIndex].url;
let playURL = url
console.log('playUrl ===>',playURL, {playURL,mode},index)
// console.log(playURL, { playURL, mode }, index);
this.player.JS_Play(playURL, { playURL, mode }, index).then(
() => {
//
console.log("播放成功");
},
(err) => {
console.log("播放失败", err);
}
);
},
//
stopAllPlay() {
this.player.JS_StopRealPlayAll().then(
() => {
this.playback.rate = 0;
console.log("stopAllPlay success");
// this.closeVideoTree();
},
(e) => {
console.error(e);
}
);
},
//
stopPlay() {
this.player.JS_Stop().then(
() => {
this.playback.rate = 0;
console.log("stop realplay success");
// this.closeVideoTree()
const index = this.player.currentWindowIndex;
this.selectAisle(this.videoList[index], index);
},
(e) => {
console.error(e);
}
);
},
capture(imageType) {
let player = this.player,
index = player.currentWindowIndex;
player.JS_CapturePicture(index, "img", imageType).then(
() => {
console.log("capture success", imageType);
},
(e) => {
console.error(e);
}
);
},
/**
* 视频流查询
*/
//
queryLive() {
console.log("视频流查询", this.cameraList);
let playUrlList = [];
this.cameraList.map((code, index) => {
// console.log('code ===>',code.tags ? JSON.parse(code.tags).cameraIndexCode : code.code)
queryLivePreview({ cameraIndexCode: code.code }).then((res) => {
console.log('res ====>',res)
if (res.data.code === 0 || res.data.code == 200) {
playUrlList.push({name:code.name ? code.name : '', code: code.tags ? JSON.parse(code.tags).cameraIndexCode : code.code, url: res.data.data });
this.playUrlList = playUrlList;
this.realplay(index, res.data.data);
}
// else{
// playUrlList.push({name:code.name ? code.name : '', code: code.tags ? JSON.parse(code.tags).cameraIndexCode : code.code, url: 'ws://171.16.8.60:559/openUrl/QKCBP32' });
// this.playUrlList = playUrlList;
// this.realplay(index, 'ws://171.16.8.60:559/openUrl/QKCBP32');
// }
});
});
},
/* 回放 */
playbackStart() {
let { player, mode, playback } = this,
index = player.currentWindowIndex,
{ startTime, endTime } = playback;
let playURL = this.playUrlList[index].playback;
startTime += "Z";
endTime += "Z";
let timeArr = JSON.parse(JSON.stringify(this.timeRange))
let time1 = timeArr[0].substring(0, 10) + 'T' + timeArr[0].substring(10 + 1) + "Z"
let time2 = timeArr[1].substring(0, 10) + 'T' + timeArr[1].substring(10 + 1) + 'Z'
console.log('index ===>',index,mode,playURL,time1,time2)
player
.JS_Play(playURL, { playURL, mode }, index, time1, time2)
.then(
() => {
console.log("playbackStart success");
this.playback.rate = 1;
},
(e) => {
console.error(e);
}
);
},
playbackPause() {
this.player.JS_Pause().then(
() => {
console.log("playbackPause success");
},
(e) => {
console.error(e);
}
);
},
playbackResume() {
this.player.JS_Resume().then(
() => {
console.log("playbackResume success");
},
(e) => {
console.error(e);
}
);
},
/* 回放 */
playbackQuery() {
if (this.playUrlList.length === 0) {
this.$message.warning("当前没有可播放的摄像头");
return;
}
console.log('payback ===>',this.playUrlList[this.player.currentWindowIndex].playback)
if (
this.playUrlList[this.player.currentWindowIndex].playback != undefined
) {
this.playbackStart();
return;
}
console.log('currentWindowIndex ===>',this.player.currentWindowIndex)
queryLiveBack({
cameraIndexCode: this.playUrlList[this.player.currentWindowIndex].code,
beginTime:this.timeRange[0],
endTime: this.timeRange[1],
}).then((res) => {
if (res.data.code === 0 || res.data.code == 200) {
this.playUrlList[this.player.currentWindowIndex].playback =
res.data.data;
this.playbackStart();
}
// else{
// this.playUrlList[this.player.currentWindowIndex].playback =
// 'ws://171.16.8.60:559/openUrl/fJbYK9G';
// this.playbackStart();
// }
});
},
},
};
</script>
<style lang="scss" scoped>
.container{
display: flex;
// @media screen and (min-width: 992px){
#player {
width:65%;
height: calc((50vw - 8px) * 5 / 8);
}
// }
.form_box{
width: 35%;
display: flex;
// align-items: center;
justify-content: center;
.el-form{
width: 80%;
}
}
}
</style>

@ -0,0 +1,168 @@
<template>
<div id='player'></div>
</template>
<script>
const IS_MOVE_DEVICE = document.body.clientWidth < 992 //
const MSE_IS_SUPPORT = !!window.MediaSource // mse
// import "@/static/js/h5player.min.js"
export default {
data() {
return {
player: null,
splitNum: 1,
mseSupport: MSE_IS_SUPPORT,
// tabActive: MSE_IS_SUPPORT ? 'mse' : 'decoder',
tabActive: 'decoder',
urls: {
realplay: 'ws://10.19.147.22:559/EUrl/q2jQie4',
talk: 'wss://10.41.163.126:6014/proxy/10.41.163.126:559/EUrl/6gFx47S',
playback: 'wss://10.41.163.126:6014/proxy/10.41.163.126:559/EUrl/6gFx47S'
},
playback: {
startTime: '2021-07-26T00:00:00',
endTime: '2021-07-26T23:59:59',
valueFormat: '',
seekStart: '2021-07-26T12:00:00',
rate: ''
},
muted: true,
volume: 50,
volumeOnSvg: {
template: '<svg t="1624453273744" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1421" width="200" height="200"><path d="M597.994667 138.005333q130.005333 28.010667 213.994667 132.992t84.010667 241.002667-84.010667 241.002667-213.994667 132.992l0-88q93.994667-28.010667 153.002667-106.005333t59.008-180.010667-59.008-180.010667-153.002667-106.005333l0-88zM704 512q0 120-106.005333 172.010667l0-344q106.005333 52.010667 106.005333 172.010667zM128 384l170.005333 0 213.994667-213.994667 0 684.010667-213.994667-213.994667-170.005333 0 0-256z" p-id="1422"></path></svg>'
},
volumeOffSvg: {
template: '<svg t="1624453193279" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9147" width="200" height="200"><path d="M512 170.005333l0 180.010667-90.005333-90.005333zM181.994667 128l714.005333 714.005333-53.994667 53.994667-88-88q-74.005333 58.005333-156.010667 77.994667l0-88q50.005333-13.994667 96-50.005333l-181.994667-181.994667 0 288-213.994667-213.994667-170.005333 0 0-256 202.005333 0-202.005333-202.005333zM810.005333 512q0-101.994667-59.008-180.010667t-153.002667-106.005333l0-88q130.005333 28.010667 213.994667 132.992t84.010667 241.002667q0 96-44.010667 178.005333l-64-66.005333q21.994667-53.994667 21.994667-112zM704 512q0 18.005333-2.005333 26.005333l-104-104 0-93.994667q106.005333 52.010667 106.005333 172.010667z" p-id="9148"></path></svg>'
},
recordStartState: 0,
recordStartText: '录像'
}
},
created() {
// h5
setTimeout(() => {
this.init()
this.createPlayer()
this.arrangeWindow()
})
},
methods: {
//
init () {
//
window.addEventListener('resize', () => {
this.player.JS_Resize()
})
},
createPlayer () {
this.player = new window.JSPlugin({
szId: 'player',
szBasePath: "/js/", //public/jsjs
iMaxSplit: 4,
iCurrentSplit: 2,
openDebug: true,
oStyle: {
borderSelect: '#FFCC00',
}
})
let _this = this
//
this.player.JS_SetWindowControlCallback({
windowEventSelect: function (iWndIndex) { //
console.log('windowSelect callback: ', iWndIndex);
},
pluginErrorHandler: function (iWndIndex, iErrorCode, oError) { //
console.log('pluginError callback: ', iWndIndex, iErrorCode, oError);
},
windowEventOver: function (iWndIndex) { //
//console.log(iWndIndex);
},
windowEventOut: function (iWndIndex) { //
//console.log(iWndIndex);
},
windowEventUp: function (iWndIndex) { //mouseup
//console.log(iWndIndex);
},
windowFullCcreenChange: function (bFull) { //
console.log('fullScreen callback: ', bFull);
},
firstFrameDisplay: function (iWndIndex, iWidth, iHeight) { //
console.log('firstFrame loaded callback: ', iWndIndex, iWidth, iHeight);
},
performanceLack: function () { //
console.log('performanceLack callback: ');
}
});
_this.realplay()
},
arrangeWindow () {
const splitNum = this.splitNum
this.player.JS_ArrangeWindow(splitNum).then(
() => { console.log(`arrangeWindow to ${splitNum}x${splitNum} success`) },
e => { console.error(e) }
)
},
//
//
realplay () {
// this.mode = 0 //0 1
// const { player, mode, urls } = this,
// index = player.currentWindowIndex
// // playURL = this.realplay
// console.log('playURL ==>',playURL,'mode ===>',mode,'index1 ===>',index1)
// player.JS_Play(playURL, { playURL, mode }, index1).then(
// () => {
// console.log('realplay success')
// },
// e => { console.error(e) }
// )
if (this.player === null) return;
// let { mode, player } = this;
let index = 0;
let mode = 0
let playURL = 'ws://10.19.147.22:559/EUrl/q2jQie4';
console.log(playURL, { playURL, mode }, index);
this.player.JS_Play(playURL, { playURL, mode }, index).then(
() => {
//
console.log("播放成功");
},
(err) => {
console.log("播放失败", err);
}
);
},
//
stopAllPlay () {
this.player.JS_StopRealPlayAll().then(
() => {
this.playback.rate = 0
console.log('stopAllPlay success')
this.closeVideoTree()
},
e => { console.error(e) }
)
},
//
stopPlay () {
this.player.JS_Stop().then(
() => {
this.playback.rate = 0
console.log('stop realplay success')
// this.closeVideoTree()
const index = this.player.currentWindowIndex
this.selectAisle(this.videoList[index], index)
},
e => { console.error(e) }
)
}
},
}
</script>
<style>
</style>

@ -359,7 +359,7 @@ export default {
row.status = row.status + '';
let time = row.executeTime.split(":");
row.executeTime = time[0] + ':' + time[1];
this.addForm = row;
this.addForm = JSON.parse(JSON.stringify(row)) ;
this.dialogVisible = true;
this.isDetail = false;
this.$nextTick(() => {

@ -36,7 +36,7 @@
:url="'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv'"
:playbackUrl="'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv'" />
</el-col> -->
<player :list="videoData"></player>
<player :list="videoData" :showLeft="true"></player>
</el-row>
</div>
</el-dialog>
@ -118,19 +118,19 @@ export default {
label: "设备类型",
prop: "productName",
},
{
label: "事件类型",
type: "select",
dicUrl: "/api/blade-system/dict-biz/dictionary?code=alarm_message_type",
props: {
label: "dictValue",
value: "dictKey"
},
dataType: "number",
slot: true,
prop: "type",
search: true,
},
// {
// label: "",
// type: "select",
// dicUrl: "/api/blade-system/dict-biz/dictionary?code=alarm_message_type",
// props: {
// label: "dictValue",
// value: "dictKey"
// },
// dataType: "number",
// slot: true,
// prop: "type",
// search: true,
// },
{
label: "楼号",
prop: "buildId",
@ -434,7 +434,16 @@ export default {
this.$message.warning('未查询到该报警点摄像头');
}
else {
this.dialogVisible = true;
// this.dialogVisible = true;
const routeData = this.$router.resolve({
path: '/videoPlayer', //
query: {
list: JSON.stringify(this.videoData), //
showLeft:true
}
})
console.log('href ===>',routeData.href)
window.open(routeData.href, '_blank')
}
});
})
@ -451,7 +460,16 @@ export default {
this.$message.warning('未查询到该报警点摄像头');
}
else {
this.dialogVisible = true;
// this.dialogVisible = true;
const routeData = this.$router.resolve({
path: '/videoPlayer', //
query: {
list: JSON.stringify(this.videoData), //
showLeft:true
}
})
console.log('href ===>',routeData.href)
window.open(routeData.href, '_blank')
}
}
});

Loading…
Cancel
Save