| | |
| | | import {getFlowVideoData} from '@/api/screen/graphic/index.js' |
| | | import EZUIKit from 'ezuikit-js'; |
| | | import {useRoute} from "vue-router"; |
| | | import FullScreenVideo from "./components/FullScreenVideo.vue"; |
| | | |
| | | const route = useRoute(); |
| | | |
| | |
| | | const searchVal = ref('') |
| | | const playerData = ref([]) |
| | | const hasFullScreen = ref(false) |
| | | const fullIndex = ref() |
| | | let ezKitList = []; //视频组件实例数组 |
| | | let ezKitId = []; //视频盒子id数组 |
| | | let timer = null; |
| | | |
| | | // 全屏操作 |
| | | const handleFullScreen = () => { |
| | | const dom = document.getElementById(ezKitId[0]) |
| | | dom.requestFullscreen() |
| | | // 全屏弹窗 |
| | | const handleFullScreen = (index) => { |
| | | fullIndex.value = index; |
| | | hasFullScreen.value = true; |
| | | } |
| | | |
| | | // 监听全屏状态,是否要开起蒙层 |
| | | document.addEventListener('fullscreenchange', (val) => { |
| | | if (!document.fullscreenElement) { //退出全屏 |
| | | hasFullScreen.value = false; |
| | | } else { //开起全屏 |
| | | hasFullScreen.value = true; |
| | | } |
| | | }); |
| | | // 关闭全屏弹窗 |
| | | const closeFullScreen = () => { |
| | | hasFullScreen.value = false; |
| | | } |
| | | |
| | | // 抓拍 |
| | | const handleSnap = (index) => { |
| | |
| | | if (timer) { |
| | | clearInterval(timer) |
| | | } |
| | | // 停止播放 |
| | | ezKitList?.forEach(item => { |
| | | item.stop(); |
| | | }) |
| | | }) |
| | | </script> |
| | | |
| | |
| | | 新增 |
| | | </el-button> |
| | | </div> |
| | | <div class="tool-r" @click="handleFullScreen"> |
| | | <img src="@/assets/images/flow/fullscreen.png"/> |
| | | 全屏 |
| | | </div> |
| | | </div> |
| | | <div class="monitor-box"> |
| | | <div class="monitor-list"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="info-btn"> |
| | | <div class="fullScreen" @click="handleFullScreen(index)"> |
| | | <img src="@/assets/images/flow/screenIconWhite.png" alt="" /> |
| | | 全屏 |
| | | </div> |
| | | <el-button style="width: 6rem" @click="handleSnap(index)">抓拍</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="mask" v-show="hasFullScreen"> |
| | | <div class="mask-item"></div> |
| | | </div> |
| | | <FullScreenVideo |
| | | v-if="hasFullScreen" |
| | | :data="playerData[fullIndex]" |
| | | @close="closeFullScreen" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | font-size: 1.1rem; |
| | | } |
| | | } |
| | | |
| | | .tool-r { |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | img { |
| | | width: 25px; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .monitor-box { |
| | |
| | | } |
| | | |
| | | .info-btn { |
| | | width: 20%; |
| | | width: 15%; |
| | | padding: 1rem 0; |
| | | display: flex; |
| | | align-items: flex-end; |
| | | |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | :deep(.el-button) { |
| | | color: #fff; |
| | | background: rgba(94, 229, 92, 0.6); |
| | | border-radius: 4px 4px 4px 4px; |
| | | border: 1px solid rgba(94, 229, 92, 0.6); |
| | | } |
| | | .fullScreen{ |
| | | width: 100%; |
| | | height: 50px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | color: #fff; |
| | | img{ |
| | | width: 25px; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |