From 5617114e1bc89c2f8461a8da117536f028b67b80 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 19 Oct 2022 11:59:09 +0800 Subject: [PATCH] vchannelSelect --- src/views/am/monitor.vue | 61 +++++++++++++++++++++++++++++------ src/views/bigScreen/index.vue | 19 +++++++++++ 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/src/views/am/monitor.vue b/src/views/am/monitor.vue index cae32d11..27aeb5cc 100644 --- a/src/views/am/monitor.vue +++ b/src/views/am/monitor.vue @@ -5,21 +5,23 @@ 同步
- + >
- @@ -132,9 +134,12 @@ export default { }, code: "video_realtime", }, + areaId:'', channelCode: '', channelId: '', channelArea: '', + pageData:[], + areaoptions: [], channelAreas: [], channelLocation: {}, flvPlayer: null, @@ -150,8 +155,21 @@ export default { scriptInfo.setAttribute("data-callType", "callScript"); scriptInfo.src = "https://cdn.bootcdn.net/ajax/libs/flv.js/1.6.2/flv.js"; document.head.appendChild(scriptInfo); + this.getAllVchannel(); + }, + mounted(){ + this.getArea(); }, methods: { + getAllVchannel(){ + debugger; + this.$API.am.video.list.req({pageSize:999}).then(res=>{ + debugger; + console.log(res) + let allVchannel = JSON.stringify(res.pageData); + localStorage.setItem('allVchannel',allVchannel) + }) + }, handleView(row) { let that = this; that.channelCode = row.channelCode; @@ -174,9 +192,15 @@ export default { }, viewClose() { this.limitedVisible = false; + }, + //区域 + getArea() { + this.$API.am.area.list.req({ page: 0 }).then((res) => { + this.areaoptions = res; + }); }, handlePosition(row) { - debugger; + // debugger; console.log(row) if(row.my_info.id&&row.my_info.id!==null){ this.channelId = row.my_info.id ? row.my_info.id : null; @@ -196,7 +220,24 @@ export default { }, //搜索 - handleQuery() { this.$refs.table.refresh(); }, + handleQuery() { + debugger; + let that = this; + let vchannel = localStorage.getItem('allVchannel'); + console.log(vchannel) + let allVchannel = JSON.parse(vchannel); + debugger; + console.log(allVchannel) + console.log(that.areaId) + + that.pageData = allVchannel.filter(item=>{ + if(item.my_info.area == that.areaId){ + debugger; + } + return item.my_info.area == that.areaId; + }) + // console.log(localStorage.getItem('allVchannel')) + }, resetQuery() { this.query = {}; diff --git a/src/views/bigScreen/index.vue b/src/views/bigScreen/index.vue index 25996ac4..2b152bb8 100644 --- a/src/views/bigScreen/index.vue +++ b/src/views/bigScreen/index.vue @@ -2197,6 +2197,25 @@ export default { this.music.play();//播放 }, }, + beforeRouteLeave(to, from, next){ + next(); + if (this.timerUser) { + clearInterval(this.timerUser); + this.timerUser = null; + } + if (this.timerTime) { + clearInterval(this.timerTime); + this.timerTime = null; + } + if (this.eventTimer) { + clearInterval(this.eventTimer); + this.eventTimer = null; + } + if (this.eventAudioTimer) { + clearInterval(this.eventAudioTimer); + this.eventAudioTimer = null; + } + }, unmounted() { // window.map.destroy(); window.map = null;