'
This commit is contained in:
@@ -88,23 +88,26 @@ export default {
|
||||
visitedViews(newVal, oldVal){
|
||||
let num = 0
|
||||
newVal && newVal.map(item => {
|
||||
console.log(item)
|
||||
if (item.path === '/databoard/kiln' || item.path === '/databoard/whole-plant' || item.path === '/databoard/deep-processing') {
|
||||
num++
|
||||
}
|
||||
})
|
||||
if (num > 0) {
|
||||
if(!this.wsIsOpen) {
|
||||
getDcsMsg()
|
||||
this.wsIsOpen = true
|
||||
console.log('开启websocket==========')
|
||||
this.$nextTick(() => {
|
||||
if (num > 0) {
|
||||
if(!this.wsIsOpen) {
|
||||
getDcsMsg()
|
||||
this.wsIsOpen = true
|
||||
console.log('开启websocket==========')
|
||||
}
|
||||
}else{
|
||||
if (this.wsIsOpen) {
|
||||
closeDcsMsg()
|
||||
this.wsIsOpen = false
|
||||
console.log('关闭============')
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (this.wsIsOpen) {
|
||||
closeDcsMsg()
|
||||
this.wsIsOpen = false
|
||||
console.log('关闭============')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
Reference in New Issue
Block a user