From 58fd73d9b3f20d15d99f4b2915a2aa8f567f9519 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 3 Mar 2025 15:25:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=88=E7=AB=AF=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=92=AD=E6=94=BE=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FlvH264/index.vue | 71 +- .../components/video/TerminalInspection.vue | 9 +- .../components/video/components/Player.vue | 1 + .../components/video/components/VideoPlay.vue | 168 +++- .../video/components/videoPlayNew-2.vue | 895 ++++++++++++++++++ .../video/components/videoPlayNew.vue | 2 +- 6 files changed, 1122 insertions(+), 24 deletions(-) create mode 100644 src/views/screen/components/video/components/videoPlayNew-2.vue diff --git a/src/components/FlvH264/index.vue b/src/components/FlvH264/index.vue index 0bf8117..240e7bc 100644 --- a/src/components/FlvH264/index.vue +++ b/src/components/FlvH264/index.vue @@ -7,6 +7,8 @@ diff --git a/src/views/screen/components/video/TerminalInspection.vue b/src/views/screen/components/video/TerminalInspection.vue index 2e34275..de1ec21 100644 --- a/src/views/screen/components/video/TerminalInspection.vue +++ b/src/views/screen/components/video/TerminalInspection.vue @@ -250,7 +250,8 @@ - diff --git a/src/views/screen/components/video/components/videoPlayNew-2.vue b/src/views/screen/components/video/components/videoPlayNew-2.vue new file mode 100644 index 0000000..0e92326 --- /dev/null +++ b/src/views/screen/components/video/components/videoPlayNew-2.vue @@ -0,0 +1,895 @@ + + + + + + diff --git a/src/views/screen/components/video/components/videoPlayNew.vue b/src/views/screen/components/video/components/videoPlayNew.vue index 1f7e675..77ec8ac 100644 --- a/src/views/screen/components/video/components/videoPlayNew.vue +++ b/src/views/screen/components/video/components/videoPlayNew.vue @@ -728,7 +728,7 @@ export default { // 计算最大pages divideAndRoundUp(a, b) { - if (a === 0) { + if (a == 0) { return 1 } let result = a / b From 3ce754ba6ab143d7542034ed6ac5c7707ca7d668 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 3 Mar 2025 16:03:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E6=91=84=E5=83=8F?= =?UTF-8?q?=E5=A4=B4=E5=B7=A1=E6=A3=80=20=E5=AE=9A=E6=97=B6=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/components/videoPlayNew.vue | 62 ++++++++++++++++++- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/src/views/screen/components/video/components/videoPlayNew.vue b/src/views/screen/components/video/components/videoPlayNew.vue index 77ec8ac..a2f0ba7 100644 --- a/src/views/screen/components/video/components/videoPlayNew.vue +++ b/src/views/screen/components/video/components/videoPlayNew.vue @@ -56,7 +56,7 @@ icon="el-icon-check" @click="changeTimingStatus(1)" style="background: #a4a4a4; border: 1px solid #a4a4a4; padding: 6px" - :disabled="timingStatus" + :disabled="!isTimingStatus" > 开启定时 @@ -68,7 +68,7 @@ icon="el-icon-error" @click="changeTimingStatus(2)" style="background: #1aa4e1; border: 1px solid #1aa4e1; padding: 6px" - :disabled="!timingStatus" + :disabled="isTimingStatus" > 关闭定时 @@ -441,6 +441,8 @@ export default { activePlayVideo: null, currentPage: 1, // 当前页数 + regularTimePlay: null, + isTimingStatus: false, } }, methods: { @@ -664,8 +666,28 @@ export default { startTiming.style.border = '1px solid #1aa4e1' closeTiming.style.background = '#a4a4a4' closeTiming.style.border = '1px solid #a4a4a4' + this.isTimingStatus = true + } + // this.$emit('changeTimingStatus', type) + + if (type == 1) { + // 开启定时 + if (!this.regularTimePlay) { + this.regularTimePlay = setInterval(() => { + if (this.currentPage == this.maxPages) { + this.currentPage = 1 + } + + this.onLinePlayerListFun() + }, 1000 * 6 * 100) // 十分钟一次 + } + } else { + // 关闭定时 + if (this.regularTimePlay) { + clearInterval(this.regularTimePlay) + this.regularTimePlay = null + } } - this.$emit('changeTimingStatus', type) }, autoPlayVideo(item) { const playerRef = `player${this.activePlayer}` @@ -705,6 +727,19 @@ export default { this.fixedData = res.data this.onLineList = this.fixedData.filter(e => e.status == 1) this.onLinePlayerListFun() + if (!this.isTimingStatus) { + // 开启定时 + if (!this.regularTimePlay) { + this.regularTimePlay = setInterval(() => { + if (this.currentPage == this.maxPages) { + this.currentPage = 1 + } else { + this.currentPage++ + } + this.onLinePlayerListFun() + }, 1000 * 6 * 100) // 十分钟一次 + } + } }, // 点击视频盒子事件 @@ -807,6 +842,27 @@ export default { mounted() { this.getDeviceList() + const startTiming = document.getElementById('startTiming') + const closeTiming = document.getElementById('closeTiming') + if (!this.iStimingStatus) { + startTiming.style.background = '#a4a4a4' + startTiming.style.border = '1px solid #a4a4a4' + closeTiming.style.background = '#1aa4e1' + closeTiming.style.border = '1px solid #1aa4e1' + } else { + startTiming.style.background = '#1aa4e1' + startTiming.style.border = '1px solid #1aa4e1' + closeTiming.style.background = '#a4a4a4' + closeTiming.style.border = '1px solid #a4a4a4' + } + }, + + beforeDestroy() { + // 判断当前页面的定时器是否存在 如存在则关闭 + if (this.regularTimePlay) { + clearInterval(this.regularTimePlay) + this.regularTimePlay = null + } }, }