|
|
@ -50,7 +50,7 @@ export default {
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
timeInterval = setInterval(() => {
|
|
|
|
timeInterval = setInterval(() => {
|
|
|
|
this.selectOffLineDevice()
|
|
|
|
this.selectOffLineDevice()
|
|
|
|
},1000)
|
|
|
|
}, 1000)
|
|
|
|
console.log('App mounted - 初始化全局WebSocket连接')
|
|
|
|
console.log('App mounted - 初始化全局WebSocket连接')
|
|
|
|
this.initGlobalWebSocket()
|
|
|
|
this.initGlobalWebSocket()
|
|
|
|
|
|
|
|
|
|
|
@ -369,7 +369,7 @@ export default {
|
|
|
|
selectOffLineDevice() {
|
|
|
|
selectOffLineDevice() {
|
|
|
|
Object.keys(this.isOnline).forEach(key => {
|
|
|
|
Object.keys(this.isOnline).forEach(key => {
|
|
|
|
// console.log(key, new Date().getTime() - this.isOnline[key])
|
|
|
|
// console.log(key, new Date().getTime() - this.isOnline[key])
|
|
|
|
if (new Date().getTime() - this.isOnline[key] > (1000 * 60 * 30)) {
|
|
|
|
if (new Date().getTime() - this.isOnline[key] > (1000 * 60 * 60)) {
|
|
|
|
this.$confirm(`设备${key}已离线`, '设备离线', {
|
|
|
|
this.$confirm(`设备${key}已离线`, '设备离线', {
|
|
|
|
cancelButtonText: '关闭',
|
|
|
|
cancelButtonText: '关闭',
|
|
|
|
showConfirmButton: false,
|
|
|
|
showConfirmButton: false,
|
|
|
|