From 4d2865a5edff2c60844e4fde5258e794df81124e Mon Sep 17 00:00:00 2001 From: dearlin <1261008090@qq.com> Date: Thu, 9 Nov 2023 10:26:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=89=8B=E5=8A=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=90=8E=20=E5=AE=9A=E6=97=B6=E5=99=A8=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../videoinfomanager/components/list.vue | 4 ++- .../videomanager/components/bobileCamer.vue | 25 +++++++++++++++++-- .../videomanager/components/video-list.vue | 4 ++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/views/keyprojects/videoinfomanager/components/list.vue b/src/views/keyprojects/videoinfomanager/components/list.vue index f2abc65..ce7ad03 100644 --- a/src/views/keyprojects/videoinfomanager/components/list.vue +++ b/src/views/keyprojects/videoinfomanager/components/list.vue @@ -318,7 +318,7 @@ export default { }, over() { // 定时器手动关闭 - console.log('定时器手动关闭') + console.log('定时器自动关闭') this.$message.warning('单次播放时长已到5分钟自动关闭') clearInterval(this.timer) }, @@ -363,6 +363,8 @@ export default { } }, back() { + console.log('手动关闭定时器') + clearInterval(this.timer) if (this.dialogVideo) this.dialogVideo = false if (this.dialogVideoBack) this.dialogVideoBack = false if (this.dialogVideoAll) { diff --git a/src/views/keyprojects/videomanager/components/bobileCamer.vue b/src/views/keyprojects/videomanager/components/bobileCamer.vue index 46f4294..bbf11c6 100644 --- a/src/views/keyprojects/videomanager/components/bobileCamer.vue +++ b/src/views/keyprojects/videomanager/components/bobileCamer.vue @@ -100,6 +100,7 @@ export default { dialogVideoBack: false, dialogVideoAll: false, VIDEOURL: '', + timer: '', player: {}, // config: config, @@ -125,6 +126,18 @@ export default { }, methods: { + // 五分钟关闭视频播放页面定时任务 + start() { + console.log('定时器开启') + this.timer = setInterval(this.over, (5 * 60 * 1000)) // 5分钟; + }, + over() { + // 定时器手动关闭 + console.log('定时器自动关闭') + this.$message.warning('单次播放时长已到5分钟自动关闭') + this.back() + clearInterval(this.timer) + }, async init(UNITS_ID) { this.visible = true this.UNITS_ID = UNITS_ID @@ -172,6 +185,8 @@ export default { } }, back() { + console.log('定时器手动关闭') + clearInterval(this.timer) if (this.dialogVideo) this.dialogVideo = false if (this.dialogVideoBack) this.dialogVideoBack = false if (this.dialogVideoAll) { @@ -187,6 +202,8 @@ export default { } }, showVideo(row) { + this.$message.warning('单次播放最多五分钟') + this.start() if (!row.PLATFORMVIDEOMANAGEMENT_ID) { this.VIDEOURL = row.VIDEOURL this.dialogVideo = true @@ -217,6 +234,7 @@ export default { }) }) }).catch((e) => { + this.over() this.listLoading = false }) } @@ -264,8 +282,11 @@ export default { closeWindow() { this.handleClose() } - } - + }, + beforeDestroy() { + console.log('页面定时器关闭') + clearInterval(this.timer) + }, } diff --git a/src/views/keyprojects/videomanager/components/video-list.vue b/src/views/keyprojects/videomanager/components/video-list.vue index a709776..67f9176 100644 --- a/src/views/keyprojects/videomanager/components/video-list.vue +++ b/src/views/keyprojects/videomanager/components/video-list.vue @@ -249,7 +249,7 @@ export default { }, over() { // 定时器手动关闭 - console.log('定时器手动关闭') + console.log('定时器自动关闭') clearInterval(this.timer) }, closeVideoStart() { @@ -702,6 +702,8 @@ export default { }) }, back() { + console.log('手动关闭定时器') + clearInterval(this.timer) if (this.dialogVideo) this.dialogVideo = false if (this.dialogVideoBack) this.dialogVideoBack = false if (this.dialogVideoAll) {