|
|
@ -584,9 +584,6 @@ export default { |
|
|
|
caseId: { |
|
|
|
handler: function(newV, oldV) { |
|
|
|
this.queryForm() |
|
|
|
// if (this.isSearch === '3') { |
|
|
|
// this.initWebSoket() |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -596,7 +593,6 @@ export default { |
|
|
|
clearTimeout(this.timeoutnum) |
|
|
|
clearTimeout(this.timeoutObj) |
|
|
|
clearTimeout(this.serverTimeoutObj) |
|
|
|
this.ws.close() |
|
|
|
this.ws = null |
|
|
|
} |
|
|
|
}, |
|
|
@ -759,15 +755,13 @@ export default { |
|
|
|
console.log('start') |
|
|
|
self.reconnect() |
|
|
|
} |
|
|
|
self.serverTimeoutObj = setTimeout(function() { |
|
|
|
// 超时关闭 |
|
|
|
self.ws.close() |
|
|
|
}, self.timeout) |
|
|
|
}, self.timeout) |
|
|
|
}, |
|
|
|
initWebSoket() { |
|
|
|
try { |
|
|
|
const url = process.env.VUE_APP_WS_URL |
|
|
|
// const url = 'ws://192.168.0.151:1894/data' |
|
|
|
// const url = 'ws://192.168.0.151:4649/Chat' |
|
|
|
const self = this |
|
|
|
this.ws = new WebSocket(url) |
|
|
|
this.ws.onopen = function() { |
|
|
@ -775,11 +769,14 @@ export default { |
|
|
|
self.connectFlag = true |
|
|
|
self.start() |
|
|
|
} |
|
|
|
this.ws.onclose = function() { |
|
|
|
this.ws.onclose = function(err) { |
|
|
|
self.connectFlag = false |
|
|
|
console.log('closed', err) |
|
|
|
self.reconnect() |
|
|
|
} |
|
|
|
this.ws.onerror = function() { |
|
|
|
this.ws.onerror = function(err) { |
|
|
|
self.connectFlag = false |
|
|
|
console.log('error', err) |
|
|
|
self.reconnect() |
|
|
|
} |
|
|
|
this.ws.onmessage = (msg) => { |
|
|
|