diff --git a/xiuosiot-frontend/src/views/terminal/PLC/monitor.vue b/xiuosiot-frontend/src/views/terminal/PLC/monitor.vue index 5a953e6..8d9b338 100644 --- a/xiuosiot-frontend/src/views/terminal/PLC/monitor.vue +++ b/xiuosiot-frontend/src/views/terminal/PLC/monitor.vue @@ -89,14 +89,14 @@
-

{{ item.valueName }}

+

{{ item.valueName }}

-

{{ item.valueName }}

+

{{ item.valueName }}

-

{{ item.valueName }}

-

{{ item.valueName }}{{ item.value }}

+

{{ item.valueName }}

+

{{ item.valueName }}{{ item.value }}

@@ -522,17 +522,24 @@ export default { methods: { resize() { const heightMinus = Math.abs(document.body.clientHeight - 920) - console.log('heightMinus', heightMinus) this.paddingTop = 120 + (heightMinus - 20) / 2 }, + guid() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + var r = Math.random() * 16 | 0; var v = c == 'x' ? r : (r & 0x3 | 0x8) + + return v.toString(16) + }) + }, openSocket() { - const socketUrl = 'ws://115.238.53.59:18080/websocket/jxsd' + const tid = this.guid() + const socketUrl = 'ws://115.238.53.59:18080/websocket/jxsd/' + tid const socket = new WebSocket(socketUrl) socket.onopen = () => { console.log('socket已打开') } socket.onmessage = (msg) => { - if (msg.data && msg.data !== 'jxsd-连接已建立-') { + if (msg.data && msg.data.includes('jxsd-连接已建立-')) { this.data = JSON.parse(msg.data) const itemList = this.data.readItemList.map((item, index) => { if (index < 66) {