|
@@ -134,8 +134,22 @@ export default {
|
134
|
134
|
mounted () {
|
135
|
135
|
setTimeout(window.location.reload, 600 * 1000)
|
136
|
136
|
},
|
|
137
|
+ beforeRouteLeave (to, from, next) {
|
|
138
|
+ // 导航离开该组件的对应路由时调用
|
|
139
|
+ // 可以访问组件实例 `this`
|
|
140
|
+ console.log(this.websockets)
|
|
141
|
+ Object.keys(this.websockets).forEach((key) => {
|
|
142
|
+ console.log(key, this.websockets[key])
|
|
143
|
+ this.websockets[key].onclose()
|
|
144
|
+ })
|
|
145
|
+ next()
|
|
146
|
+ },
|
137
|
147
|
methods: {
|
138
|
148
|
init () {
|
|
149
|
+ Object.keys(this.websockets).forEach((key) => {
|
|
150
|
+ console.log(key, this.websockets[key])
|
|
151
|
+ this.websockets[key].onclose()
|
|
152
|
+ })
|
139
|
153
|
console.log('init')
|
140
|
154
|
var param = []
|
141
|
155
|
if (!this.caseid) {
|