解决更新通道导致的点播丢失

This commit is contained in:
panlinlin
2021-04-19 14:24:08 +08:00
parent 57bbbc9f7a
commit 6e67b1902e
5 changed files with 13 additions and 7 deletions

View File

@@ -59,8 +59,8 @@ export default {
sseControl() {
let that = this;
if (this.alarmNotify) {
console.log("申请SSE推送API调用浏览器ID: " + this.$browserId);
this.sseSource = new EventSource('/api/emit?browserId=' + this.$browserId);
console.log("申请SSE推送API调用浏览器ID: " + this.$browserId);
this.sseSource = new EventSource('/api/emit?browserId=' + this.$browserId);
this.sseSource.addEventListener('message', function(evt) {
that.$notify({
title: '收到报警信息',

View File

@@ -1,7 +1,6 @@
<template>
<div id="channelList">
<el-container>
<el-header>
<uiHeader></uiHeader>
</el-header>
@@ -118,7 +117,7 @@ export default {
},
methods: {
initData: function () {
if (this.parentChannelId == "" || this.parentChannelId == 0) {
if (typeof (this.parentChannelId) == "undefined" || this.parentChannelId == 0) {
this.getDeviceChannelList();
} else {
this.showSubchannels();
@@ -153,6 +152,7 @@ export default {
},
getDeviceChannelList: function () {
let that = this;
if (typeof (this.$route.params.deviceId) == "undefined") return;
this.$axios({
method: 'get',
url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,