Files
dvcp_v2_wxcp_app/library/apps/AppIntelligentSecurity/monitorDetail.vue

93 lines
1.7 KiB
Vue
Raw Normal View History

2022-02-14 10:36:23 +08:00
<template>
<section class="monitorDetail">
<div class="videoBox">
2022-04-20 18:11:05 +08:00
<SlwVideo :id="id" :style="style"></SlwVideo>
2022-02-14 10:36:23 +08:00
</div>
</section>
</template>
<script>
2022-03-23 15:22:41 +08:00
import SlwVideo from './SlwVideo'
2022-02-14 10:36:23 +08:00
export default {
name: "monitorDetail",
data() {
return {
style: {},
2022-03-23 15:22:41 +08:00
videoUrl: '',
2022-04-20 18:11:05 +08:00
monitor: {},
id: ''
2022-02-14 10:36:23 +08:00
}
},
2022-03-23 15:22:41 +08:00
components: {
SlwVideo
},
2022-02-14 10:36:23 +08:00
mounted() {
this.$nextTick(() => {
this.detectOrient()
})
document.title = '视频监控'
},
methods: {
getDetail(deviceId) {
deviceId && this.$http.post("/app/appzyvideoequipment/getWebSdkUrl", null, {
params: {deviceId}
}).then(res => {
if (res?.data) {
2022-03-23 15:22:41 +08:00
this.videoUrl = res.data
2022-02-14 10:36:23 +08:00
}
})
},
detectOrient() {
var width = document.querySelector('.monitorDetail').clientWidth
var height = document.querySelector('.monitorDetail').clientHeight
if (width >= height) { // 竖屏
this.style = {
width: '100%',
height: '100%',
transform: 'rotate(0eg)',
transformOrigin: `0 0`
}
} else {
this.style = {
width: height + 'px',
height: width + 'px',
transform: 'rotate(90deg)',
transformOrigin: `${width / 2}px ${width / 2}px`
}
}
}
},
onLoad(params) {
2022-04-20 18:11:05 +08:00
this.id = params.id
// this.getDetail(params.id)
2022-02-14 10:36:23 +08:00
}
}
</script>
<style lang="scss" scoped>
.monitorDetail {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100vw;
height: 100vh;
background: #000;
color: #fff;
.videoBox {
width: 100vw;
height: 100vh;
iframe {
}
}
}
</style>