|
@@ -215,7 +215,8 @@ export default {
|
|
|
dataTable: null,
|
|
|
$ws: null,
|
|
|
timer: '',
|
|
|
- isShowHistory: true
|
|
|
+ isShowHistory: true,
|
|
|
+ isAutoCloseWs: false
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -278,9 +279,15 @@ export default {
|
|
|
wsClose: function(e) {
|
|
|
console.log('WebSocket连接关闭...........');
|
|
|
clearInterval(this.timer);
|
|
|
+ if(!this.isAutoCloseWs){
|
|
|
+ setTimeout(() => {
|
|
|
+ this.initWebSocket();
|
|
|
+ }, 3000);
|
|
|
+ }
|
|
|
},
|
|
|
wsError: function(e) {
|
|
|
console.log('WebSocket连接出现错误............');
|
|
|
+
|
|
|
},
|
|
|
wsMessage: function(e) {
|
|
|
let msgData = JSON.parse(e.data);
|
|
@@ -496,6 +503,7 @@ export default {
|
|
|
},
|
|
|
destroyed() {
|
|
|
this.$ws.onclose();
|
|
|
+ this.isAutoCloseWs = true;
|
|
|
},
|
|
|
};
|
|
|
</script>
|