This commit is contained in:
2024-01-03 14:08:49 +08:00
parent 75aa253a29
commit 53f2b242a4
26 changed files with 1357 additions and 271 deletions

View File

@@ -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();