补充上一个

dongguan-华为云
LAPTOP-S9HJSOEB\昊天 2 years ago
parent 63df48585b
commit 9c9625085c

@ -5,7 +5,7 @@
<a-row :gutter="24">
<a-col :span="4" >
<a-form-item label="巷道">
<a-form-item label="类型">
<a-select :default-value="0" style="width: 100px" @change="handleChange">
类型
<a-select-option :value="0">
@ -47,9 +47,6 @@
:pagination="pagination"
@change="handleGetalarmLog"
>
<span slot="streetType" slot-scope="text">
{{ text === null ? '-' : text === 0 ? '单伸' : '双伸' }}
</span>
<span slot="pics" slot-scope="text" style="width:auto">
<template>
@ -129,6 +126,10 @@ export default {
title: "情况说明",
dataIndex: "warmName",
},
{
title: "类型",
dataIndex: "typeName",
},
{
title: "告警时间",
dataIndex: "startTime",

@ -1,7 +1,7 @@
<template>
<div style="position: relative;width: 700px;height: 576px;">
<div :style="{position: relative,width:w,height:h}">
<video
:style="{ height: videoHeight,}"
:style="{ height: h,}"
:id="`camera${id}`"
autoplay
muted
@ -139,12 +139,8 @@ import WebRtcPlayer from "../../public/static/webrtcplayer";
export default {
data() {
return {
w:
document.documentElement.offsetWidth ||
document.body.offsetWidth,
h:
document.documentElement.offsetHeight ||
document.body.offsetHeight,
w : 700,
h:554,
confirmLoading: false,
videoHeight: "576px",
id: "12",
@ -174,7 +170,16 @@ export default {
mounted() {
this.mdata = this.$route.path;
console.log(this.mdata);
this.id = this.mdata.toString().split("/").pop();
var req = this.mdata.toString().split("/").pop().split("?");
this.id = req[0];
if(this.$route.query!= null && this.$route.query.h !=null){
this.h = this.$route.query.h +"px"
}
if(this.$route.query!= null && this.$route.query.w !=null){
this.w = this.$route.query.w +"px"
}
this.$axios
.get("/camera/" + this.id, {
data: {},
@ -209,9 +214,10 @@ export default {
let server;
if (this.camera.rtcServerPort != null) {
server= this.camera.rtcServer + ":" + this.camera.rtcServerPort ;
server =
this.camera.rtcServer + ":" + this.camera.rtcServerPort;
} else {
server= this.camera.rtcServer
server = this.camera.rtcServer;
}
let player = new WebRtcPlayer(

@ -84,11 +84,11 @@ export default {
data() {
return {
pageNum:1,
pageSize:10,
pageSize:30,
data: [],
pagination:{
total:0,
defaultPageSize:10, //
defaultPageSize:30, //
showTotal: total => `${total} 条数据`, //
showSizeChanger:true, //
pageSizeOptions: ['10', '20', '30'],

@ -289,42 +289,6 @@ export default {
})
.catch((err) => {});
},
// initWebSocket() {
// //weosocket
// const wsuri = "ws://127.0.0.1:8099/ws/111";
// this.websock = new WebSocket(wsuri);
// this.websock.onmessage = this.websocketonmessage;
// this.websock.onopen = this.websocketonopen;
// this.websock.onerror = this.websocketonerror;
// this.websock.onclose = this.websocketclose;
// },
// websocketonopen() {
// //send
// this.websocketsend(JSON.stringify(actions));
// },
// websocketonerror() {
// //
// this.initWebSocket();
// },
// websocketonmessage(e) {
// console.log("aaaa");
// var el = JSON.parse(e.data)
// console.log(el.type);
// if (el.type == "InventoryPush") {
// this.wsData.push(el);
// }
// //
// const redata = JSON.parse(e.data);
// },
// websocketsend(Data) {
// //
// this.websock.send(Data);
// },
// websocketclose(e) {
// //
// console.log("", e);
// },
},
components: {
Subsection,

@ -0,0 +1,208 @@
<template>
<div id="videos">
<a-button type="primary" @click="full" v-if="!isFullscreen"> <a-icon type="right" /> </a-button>
<a-button type="primary" @click="full" v-if="isFullscreen"><a-icon type="left" /> 退出全屏 </a-button>
<a-row v-for='rowIndex in row' :key='rowIndex'>
<a-col v-for='colIndex in column' :key='colIndex' :span="24/column" :style="{height: videoHeight}" >
<video class="camera" :id="rowIndex+'-'+colIndex" autoplay muted :style="{'height': '100%',width:'100%','object-fit':'fill'}" ></video>
</a-col>
</a-row>
</div>
</template>
<script>
import WebRtcPlayer from "../../../public/static/webrtcplayer"
export default {
name: 'top',
components: {},
props: {
id: {
type: String,
default () {
return ''
}
}
},
data () {
return {
row : 0,
column : 0,
a: 0,
clientHeight: 0,
videoH: 0,
isFullscreen: false,
originHeight: 0,
fullHeight: 0,
players: []
}
},
//watch: {},
computed: {
videoHeight() {
return( this.clientHeight/ this.row ) + 'px';
}
},
destroyed() {
this.destory()
},
mounted () {
this.getWallStyle();
this.$nextTick(() => {
this.getAllCameras()
});
let isFullscreen =
document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullscreenElement ||
document.fullScreen ||
document.mozFullScreen ||
document.webkitIsFullScreen;
this.isFullscreen = !!isFullscreen;
let that = this;
document.addEventListener("fullscreenchange", () => {
that.isFullscreen = !that.isFullscreen;
});
document.addEventListener("mozfullscreenchange", () => {
that.isFullscreen = !that.isFullscreen;
});
document.addEventListener("webkitfullscreenchange", () => {
that.isFullscreen = !that.isFullscreen;
});
document.addEventListener("msfullscreenchange", () => {
that.isFullscreen = !that.isFullscreen;
});
},
methods: {
getWallStyle(){
this.$api.httpApi.getWallStyle({
data: {}
}).then(res => {
if(res.code == 200) {
this.row = res.data[0];
this.column = res.data[1];
this.getClientHeight();
sessionStorage.setItem('originHeight', this.clientHeight)
}
}).catch(err => {
console.log(err)
})
},
getClientHeight() {
this.clientHeight = this.$el.clientHeight-40;
console.log("clientHeight:"+this.clientHeight)
},
getAllCameras(){
this.$api.httpApi.getAllCameras7({
data: {}
}).then(res => {
if(res.code == 200) {
let cameras = res.data;
for(let i = 1;i<=cameras.length;i++){
let rowIndex = Math.floor((i-1) / this.column) + 1;
if(rowIndex > this.row){
return
}
let columnIndex = i % this.column;
if(columnIndex == 0){
columnIndex = this.column;
}
let idName = rowIndex + "-" + columnIndex;
console.log("idName:"+idName);
let server ;
if(cameras[i-1].rtcServerPort != null){
server= cameras[i-1].rtcServer+":"+ cameras[i-1].rtcServerPort
}else{
server= cameras[i-1].rtcServer
}
let video = document.getElementById(idName);
let player = new WebRtcPlayer(server,video,"camera"+cameras[i-1].id);
this.players.push(player);
}
}
}).catch(err => {
console.log(err)
})
},
destory(){
for(let player of this.players){
console.log("stop")
player.destroy()
}
},
full () {
if(this.isFullscreen){
this.exitfullscreen()
}else{
this.enterfullscreen()
}
},
//
enterfullscreen () { //
var docElm = document.getElementById('videos') // id
//W3C
if (docElm.requestFullscreen) {
docElm.requestFullscreen()
}
//FireFox
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen()
}
//Chrome
else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen()
}
//IE11
else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen()
}
this.$nextTick(() => {
this.clientHeight = document.body.clientHeight;
console.log("full:"+document.body.clientHeight)
})
},
//退
exitfullscreen () {
console.log("tuichu");
if (document.exitFullscreen) {
document.exitFullscreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen()
} else if (document.msExitFullscreen) {
document.msExitFullscreen()
}
this.$nextTick(() => {
let origin = sessionStorage.getItem('originHeight');
if(origin){
this.clientHeight = origin;
}else{
this.getClientHeight();
}
})
}
}
}
</script>
<style>
/* #videos > .ant-row {
height: calc(100% / 8);
}
#videos > .ant-row > .ant-col{
height: calc(100% / 8);
} */
</style>
Loading…
Cancel
Save