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 @@ + + + + + + + 查看回放 + + + 日志查看 + + + 关闭 + + + 全关闭 + + + 开启定时 + + + 关闭定时 + + + + 上页 + + + + 下页 + + + + + 当前页:{{ currentPage }} + + + + + + 1路 + + + 4路 + + + 6路 + + + + + + + 总数:{{ videoNum.totalNum }} + + + + 在线:{{ videoNum.onlineNum }} + + + + 离线:{{ videoNum.offlineNum }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * + 备注: + + + + 确定 + 取消 + + + + + + + + + + + + + + + diff --git a/src/views/screen/components/video/components/videoPlayNew.vue b/src/views/screen/components/video/components/videoPlayNew.vue index 1f7e675..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) // 十分钟一次 + } + } }, // 点击视频盒子事件 @@ -728,7 +763,7 @@ export default { // 计算最大pages divideAndRoundUp(a, b) { - if (a === 0) { + if (a == 0) { return 1 } let result = a / b @@ -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 + } }, }