| | |
| | | <el-input |
| | | v-if="item.type === '0' && groupIndex==15" |
| | | v-model="item.value" |
| | | @keyup.enter.native="timeout" |
| | | @keyup.enter.native="timeout($event)" |
| | | style="width: 300px" |
| | | class="input-box2" |
| | | ></el-input> |
| | |
| | | } |
| | | }, |
| | | //范围 0-100 |
| | | timeout(){ |
| | | timeout(event){ |
| | | |
| | | |
| | | const data3 = []; |
| | |
| | | // setTimeout(()=> |
| | | // window.location.reload(),2000 |
| | | // ) |
| | | |
| | | event.target.blur(); // 取消输入框焦点 |
| | | }, |
| | | |
| | | |
| | |
| | | socket.onopen = function () { |
| | | console.log("websocket已打开"); |
| | | }; |
| | | let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | // let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | let isUpdated = false; // 定义标志变量 |
| | | const inputBox = document.querySelectorAll('.input-box2'); |
| | | inputBox.forEach(box => { |
| | | box.addEventListener('mouseenter', () => { |
| | | isMouseInInputBox = true; |
| | | }); |
| | | box.addEventListener('mouseleave', () => { |
| | | isMouseInInputBox = false; |
| | | }); |
| | | }); |
| | | // const inputBox = document.querySelectorAll('.input-box2'); |
| | | // inputBox.forEach(box => { |
| | | // box.addEventListener('mouseenter', () => { |
| | | // isMouseInInputBox = true; |
| | | // }); |
| | | // box.addEventListener('mouseleave', () => { |
| | | // isMouseInInputBox = false; |
| | | // }); |
| | | // }); |
| | | // 收到消息 |
| | | socket.onmessage = (msg) => { |
| | | if (!msg.data) { |
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑 |
| | | } |
| | | if (document.activeElement.tagName.toLowerCase() === 'input') { |
| | | return; |
| | | } |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | | |
| | |
| | | // const inputBox = document.querySelectorAll('.id'); |
| | | // const target = event.target; |
| | | |
| | | if (parms && !isMouseInInputBox) { |
| | | if (parms ) { |
| | | //急停按钮 |
| | | jsonData2[13][0].button.value = obj.jiting[0][0]; |
| | | jsonData2[14][0].button.value = obj.jiting[0][1]; |
| | |
| | | } |
| | | } |
| | | } |
| | | this.$forceUpdate(); |
| | | |
| | | //扫描枪扫码的ID |
| | | |
| | | jsonData2.forEach((item) => { |