Merge branch 'master' of http://192.168.0.149:10010/r/高精2.0
This commit is contained in:
@@ -273,11 +273,17 @@ export default {
|
||||
OPNAME141: 'OP1410',
|
||||
OPNAME142: 'OP1420',
|
||||
OPNAME143: 'OP1430',
|
||||
OPNAME144: 'OP1440'
|
||||
OPNAME144: 'OP1440',
|
||||
timer: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.connect()
|
||||
this.timer = setInterval(this.searchState, 15 * 1000) // 工位状态 15秒 一刷新
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 页面结束之前关闭所有timer,防止资源占用
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
/* socket连接*/
|
||||
@@ -303,6 +309,7 @@ export default {
|
||||
// 数据接收
|
||||
websocketonmessage(msg) {
|
||||
this.msg = msg
|
||||
console.log(msg)
|
||||
const aa = this.msg.data.split('|')
|
||||
console.log(aa[1])
|
||||
// if (aa[1] === '') {
|
||||
@@ -319,7 +326,8 @@ export default {
|
||||
websocketerror() {
|
||||
console.log('WebSocket连接失败')
|
||||
this.socketConnect = false
|
||||
}
|
||||
},
|
||||
searchState() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user