|
|
@@ -3,7 +3,19 @@
|
|
|
<div class="part-box-wrapper h-full">
|
|
|
<UseFullscreen class="h-full" v-slot="{ toggle, isFullscreen }">
|
|
|
<div class="part-video-box relative screen-full-target h-full">
|
|
|
- <pub-video-new :newClass="'p-video' + currentActive" />
|
|
|
+ <vue-photo-zoom-pro
|
|
|
+ ref="zoomRef"
|
|
|
+ class="w-full h-full"
|
|
|
+ :scale="3"
|
|
|
+ :width="150"
|
|
|
+ :disabled-event="isZoom"
|
|
|
+ >
|
|
|
+ <pub-video-new :newClass="'p-video' + currentActive" />
|
|
|
+ <template v-slot:zoomer>
|
|
|
+ <pub-video-new :newClass="'p-zoom-video' + currentActive" :key="resetKey" />
|
|
|
+ </template>
|
|
|
+ </vue-photo-zoom-pro>
|
|
|
+
|
|
|
<!-- 操作按钮 -->
|
|
|
<div class="part-main-btn-box" absolute top-10px right-10px flex flex-row-reverse z-999>
|
|
|
<!-- 全屏按钮 -->
|
|
|
@@ -38,8 +50,12 @@
|
|
|
height="25"
|
|
|
cursor-pointer
|
|
|
alt="关闭画面"
|
|
|
- @click="closeVideo(currentActive)"
|
|
|
+ @click="closeVideo()"
|
|
|
/>
|
|
|
+ <span
|
|
|
+ class="size-28px mr-1 color-#8ac5ff cursor-pointer i-ph:magnifying-glass-plus"
|
|
|
+ @click="magnifying(!magnifyingFlag)"
|
|
|
+ ></span>
|
|
|
</div>
|
|
|
<div
|
|
|
v-if="!playerObj"
|
|
|
@@ -64,6 +80,7 @@
|
|
|
import { uuid, getAutofitScale } from '@/utils'
|
|
|
import { omatVideoPlayer } from '@/assets/js/video-lib/flv/omatVideoPlayer'
|
|
|
import { UseFullscreen } from '@vueuse/components'
|
|
|
+ import VuePhotoZoomPro from 'vue-photo-zoom-pro'
|
|
|
|
|
|
const useSystem = useOutsideSystemStore()
|
|
|
|
|
|
@@ -95,7 +112,6 @@
|
|
|
videoUrl.value,
|
|
|
() => {
|
|
|
const videoDom = document.querySelector('.p-video' + props.currentActive)
|
|
|
- console.log(useSystem.partObj)
|
|
|
setTimeout(() => {
|
|
|
videoDom.style.width = videoDom.videoWidth + 'px'
|
|
|
const { width, height } = videoDom.getBoundingClientRect()
|
|
|
@@ -123,7 +139,50 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ let magnifyingWorkerObj = null
|
|
|
+ const isZoom = ref(true)
|
|
|
+ const zoomRef = ref(null)
|
|
|
+ const resetKey = ref(uuid())
|
|
|
+ const magnifyingFlag = ref(false)
|
|
|
+ const magnifying = (flag) => {
|
|
|
+ zoomRef.value?.mouseLeave()
|
|
|
+ magnifyingFlag.value = flag
|
|
|
+ if (flag) {
|
|
|
+ if (magnifyingWorkerObj) return
|
|
|
+ // const url = videoList.value.pano_view.replace('{14}', useSystem.deviceInfo.id)
|
|
|
+ magnifyingWorkerObj = omatVideoPlayer(
|
|
|
+ '.p-zoom-video' + props.currentActive,
|
|
|
+ videoUrl.value,
|
|
|
+ () => {
|
|
|
+ const videoDom = document.querySelector('.p-zoom-video' + props.currentActive)
|
|
|
+ const videoDomOrigin = document.querySelector('.p-video' + props.currentActive)
|
|
|
+ setTimeout(() => {
|
|
|
+ videoDom.style.width = videoDomOrigin.videoWidth + 'px'
|
|
|
+ const { width, height } = videoDomOrigin.getBoundingClientRect()
|
|
|
+ const { PartCenterY: py, PartCenterX: px } = useSystem.partObj
|
|
|
+ const [x, y] = [
|
|
|
+ px < 237 ? 0 : px > width ? width : px - 237,
|
|
|
+ py < 132 ? 0 : py > height ? height : py - 132
|
|
|
+ ]
|
|
|
+ videoDom.style.transform = `translate(${-x}px, ${-y}px)`
|
|
|
+ isZoom.value = false
|
|
|
+ zoomRef.value.mouseEnter()
|
|
|
+ }, 200)
|
|
|
+ }
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ isZoom.value = true
|
|
|
+ zoomRef.value.mouseLeave()
|
|
|
+ magnifyingWorkerObj?.destroyed()
|
|
|
+ resetKey.value = uuid()
|
|
|
+ magnifyingWorkerObj = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const closeVideo = () => {
|
|
|
+ if (magnifyingFlag.value) {
|
|
|
+ magnifying(false)
|
|
|
+ }
|
|
|
closeWorker()
|
|
|
}
|
|
|
// 关闭线程
|