窑炉
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
<script>
|
||||
import ScrollPane from './ScrollPane';
|
||||
import path from 'path';
|
||||
import { getDcsMsg, closeDcsMsg } from "@/websocket/wsInterface"
|
||||
|
||||
export default {
|
||||
components: { ScrollPane },
|
||||
@@ -58,6 +59,7 @@ export default {
|
||||
left: 0,
|
||||
selectedTag: {},
|
||||
affixTags: [],
|
||||
wsIsOpen: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -83,6 +85,27 @@ export default {
|
||||
document.body.removeEventListener('click', this.closeMenu);
|
||||
}
|
||||
},
|
||||
visitedViews(newVal, oldVal){
|
||||
let num = 0
|
||||
newVal && newVal.map(item => {
|
||||
if (item.path === '/databoard/kiln' || item.path === '/databoard/whole-plant') {
|
||||
num++
|
||||
}
|
||||
})
|
||||
if (num > 0) {
|
||||
if(!this.wsIsOpen) {
|
||||
getDcsMsg()
|
||||
this.wsIsOpen = true
|
||||
console.log('开启websocket==========')
|
||||
}
|
||||
}else{
|
||||
if (this.wsIsOpen) {
|
||||
closeDcsMsg()
|
||||
this.wsIsOpen = false
|
||||
console.log('关闭============')
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initTags();
|
||||
|
||||
Reference in New Issue
Block a user