| | |
| | | <el-input |
| | | v-if="item.type === '0' && groupIndex === 0" |
| | | v-model="item.value" |
| | | @keyup.enter.native="zuhe1" |
| | | @keyup.enter.native="zuhe1($event)" |
| | | class="input-box" |
| | | :class="{ |
| | | 'special-class': groupIndex === 0, |
| | |
| | | <el-input |
| | | v-else-if="item.type === '0' && groupIndex === 1" |
| | | v-model="item.value" |
| | | @keyup.enter.native="zuhe2" |
| | | @keyup.enter.native="zuhe2($event)" |
| | | class="input-box" |
| | | :class="{ |
| | | 'special-class': groupIndex === 0, |
| | |
| | | this.$set(dataGroup[itemIndex].button, "value", 1); |
| | | } |
| | | }, |
| | | zuhe1() { |
| | | zuhe1(event) { |
| | | const data = []; |
| | | |
| | | for (let i = 0; i < 1; i++) { |
| | |
| | | const jsonString = JSON.stringify(jsonObject); |
| | | console.log("所有Type为0的value:", jsonString); |
| | | socket?.send(jsonString); |
| | | event.target.blur(); // 取消输入框焦点 |
| | | }, |
| | | zuhe2() { |
| | | zuhe2(event) { |
| | | const data2 = []; |
| | | |
| | | for (let i = 1; i < 2; i++) { |
| | |
| | | const jsonString = JSON.stringify(jsonObject); |
| | | console.log("所有Type为0的value:", jsonString); |
| | | socket?.send(jsonString); |
| | | event.target.blur(); // 取消输入框焦点 |
| | | }, |
| | | submitDataToBackend(currentButtonName) { |
| | | const data = []; |
| | |
| | | console.log("websocket已打开"); |
| | | }; |
| | | |
| | | let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | // let isMouseInInputBox = false; // 标记鼠标是否在输入框内 |
| | | |
| | | const inputBox = document.querySelectorAll(".input-box"); |
| | | inputBox.forEach((box) => { |
| | | box.addEventListener("mouseenter", () => { |
| | | isMouseInInputBox = true; |
| | | }); |
| | | box.addEventListener("mouseleave", () => { |
| | | isMouseInInputBox = false; |
| | | }); |
| | | }); |
| | | // const inputBox = document.querySelectorAll(".input-box"); |
| | | // inputBox.forEach((box) => { |
| | | // box.addEventListener("mouseenter", () => { |
| | | // isMouseInInputBox = true; |
| | | // }); |
| | | // box.addEventListener("mouseleave", () => { |
| | | // isMouseInInputBox = false; |
| | | // }); |
| | | // }); |
| | | |
| | | socket.onmessage = (msg) => { |
| | | if (!msg.data) { |
| | |
| | | // console.log(obj) |
| | | const weihuiling = obj.weihuiling; |
| | | const jsonData2 = this.jsonData; |
| | | if (document.activeElement.tagName.toLowerCase() === 'input') { |
| | | return; |
| | | } |
| | | |
| | | if (obj.zuhe1 && !isMouseInInputBox) { |
| | | if (obj.zuhe1 ) { |
| | | //启动按钮 |
| | | |
| | | // 执行更新逻辑 |