|
|
@@ -26,6 +26,7 @@
|
|
|
<span class="rec-badge">⬤ REC</span>
|
|
|
</div>
|
|
|
<div class="camera-screen">
|
|
|
+ <H5PlayerVideo v-if="videoData" :videoProps="videoData"></H5PlayerVideo>
|
|
|
<img v-if="data.cameraUrl" :src="data.cameraUrl" class="cam-img" alt="camera" />
|
|
|
<div v-else class="cam-placeholder">
|
|
|
<span>暂无画面</span>
|
|
|
@@ -82,19 +83,72 @@
|
|
|
<button class="btn-emergency" @click="emergency()">⚠ 应急疏散</button>
|
|
|
<button class="btn-confirm" @click="confirm()">确认处理</button>
|
|
|
</div>
|
|
|
+ <fullH5PlayerVideo v-if="fullVideoType" :fullVideoProps="fullVideoProps"></fullH5PlayerVideo>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getCameraStream } from '@/api/screen'
|
|
|
+import H5PlayerVideo from '@/components/H5PlayerVideo/H5PlayerVideo.vue'
|
|
|
+import fullH5PlayerVideo from '@/components/fullH5PlayerVideo/fullH5PlayerVideo.vue'
|
|
|
export default {
|
|
|
name: 'Alarm',
|
|
|
+ components: {
|
|
|
+ H5PlayerVideo,fullH5PlayerVideo
|
|
|
+ },
|
|
|
props: {
|
|
|
data: {
|
|
|
type: Object,
|
|
|
default: () => ({})
|
|
|
}
|
|
|
},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ videoData:null,
|
|
|
+ //全屏视频参数
|
|
|
+ fullVideoProps:{},
|
|
|
+ fullVideoType:false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ this.getCameraStream(this.data);
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ async getCameraStream(data) {
|
|
|
+ console.log('data',data)
|
|
|
+ try {
|
|
|
+ let obj = {
|
|
|
+ "subIds": [data.subId],
|
|
|
+ "streamType": 1,
|
|
|
+ "protocol": window.location.href.indexOf('https') !== -1 ? 'wss' : 'ws',
|
|
|
+ "source": 4,
|
|
|
+ "page": 1,
|
|
|
+ "pageSize": 10
|
|
|
+ }
|
|
|
+ const res = await getCameraStream(obj)
|
|
|
+ if(res.data.list[0]){
|
|
|
+ this.$set(this,'videoData',{
|
|
|
+ width: 400, //(宽度:非必传-默认600)
|
|
|
+ height: 210, //(高度:非必传-默认338)
|
|
|
+ url: res.data.list[0].streamUrl,
|
|
|
+ cameraIndexCode: res.data.list[0].deviceNo,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.error('AlertModal:', e)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //全屏开启-关闭轮播
|
|
|
+ stopTime(cameraIndexCode){
|
|
|
+ this.$set(this,'fullVideoProps',{cameraIndexCode:cameraIndexCode});
|
|
|
+ this.$set(this,'fullVideoType',true);
|
|
|
+ },
|
|
|
+ //全屏关闭-开启轮播
|
|
|
+ outFullScreen(){
|
|
|
+ let self = this;
|
|
|
+ this.$set(this,'fullVideoType',false);
|
|
|
+ this.$set(this,'fullVideoProps',{});
|
|
|
+ },
|
|
|
//切换疏散弹窗按钮
|
|
|
emergency(){
|
|
|
console.log('疏散切换');
|