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) {