<template> <div class="video"> <el-row> <el-col :span="6"> <video-tree @click="handleCameraClicked"/> </el-col> <el-col :span="18"> <div id="tabDiv"> <iframe name="playHK" class="iframe-body" src="/static/webCtrl/hk/demo_embedded_for_iframe.html"/> </div> </el-col> </el-row> </div> </template> <script> import VideoTree from './videoTree' export default { name: 'VideoMonitor', components: { VideoTree }, data() { return { tabHeight: '', tabWidth: '' } }, mounted() { setTimeout(() => { window.frames['playHK'].initPlugin('real', document.getElementById('tabDiv').getBoundingClientRect().left + 20, 110) }, 100) }, beforeDestroy() { window.frames['playHK'].destoryPlugin() }, methods: { handleCameraClicked(camera) { console.log(camera) if (typeof camera.indexCode === 'undefined' || camera.indexCode === '') { console.log('monitorPoint is null') return false } else { window.frames['playHK'].play(camera.indexCode) } } } } </script> <style scoped> .iframe-body{ height: calc(100vh - 130px); width: 100%; position: relative; top: 0px; left: 0px; scrolling: no; border: 1px; } .video{ background: white; width: 100%; height: calc(100vh - 80px); } </style>