| | |
| | |
|
| | |
|
| | | <el-input style="width:250px;" v-if="item.state != 0 && item.type === '0' && groupIndex === 0 && (itemIndex === 2)" readonly v-model="item.value"
|
| | | class="input-box"></el-input>
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`"></el-input>
|
| | |
|
| | |
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1 && (itemIndex === 2)" readonly v-model="item.value"
|
| | | class="input-box"></el-input>
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`"></el-input>
|
| | |
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 0 " v-model="item.value" @keyup.enter.native="A01start"
|
| | | class="input-box"></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 0 " v-model="item.value" @keyup.enter.native="A01start($event)"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`"></el-input>
|
| | |
|
| | |
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1 " v-model="item.value" @keyup.enter.native="A02start"
|
| | | class="input-box"></el-input>
|
| | | <el-input style="width:250px;" v-else-if="item.state != 0 && item.type === '0' && groupIndex === 1 " v-model="item.value" @keyup.enter.native="A02start($event)"
|
| | | class="input-box" :oninput="`value=value.replace(/^0|[^0-9]/g,'');if(value<`+item.min+`){value=`+item.value+`}else if(value>`+item.max+`){value=`+item.value+`}`"></el-input>
|
| | |
|
| | |
|
| | |
|
| | |
| | | <script>
|
| | | import LanguageMixin from '../../lang/LanguageMixin'
|
| | | import data from '../../configuration/Manualoneposition2'
|
| | | import { throttle } from 'lodash';
|
| | |
|
| | | let socket;
|
| | | export default {
|
| | | name: "ManualonePosition2",
|
| | |
| | | },
|
| | |
|
| | |
|
| | | A01start(){
|
| | | A01start(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(); // 取消输入框焦点
|
| | |
|
| | | },
|
| | | A02start(){
|
| | | A02start(event){
|
| | |
|
| | | const data = [];
|
| | |
|
| | |
| | | const jsonString = JSON.stringify(jsonObject);
|
| | | console.log('所有Type为0的value:', jsonString);
|
| | | socket?.send(jsonString);
|
| | | event.target.blur(); // 取消输入框焦点
|
| | | },
|
| | | //提交方法
|
| | | submitDataToBackend (currentButtonName) {
|
| | |
| | | }
|
| | |
|
| | | if (currentButtonName === '故障' || currentButtonName === 'Fault') {
|
| | | return false;
|
| | |
|
| | | const data2 = [];
|
| | | const resetButtonValues = this.jsonData.map(item => {
|
| | | const buttonItem = item.find(subItem => subItem.button && ['故障', 'Fault'].includes(subItem.button.name));
|
| | | // const data2 = [];
|
| | | // const resetButtonValues = this.jsonData.map(item => {
|
| | | // const buttonItem = item.find(subItem => subItem.button && ['故障', 'Fault'].includes(subItem.button.name));
|
| | |
|
| | | return buttonItem ? buttonItem.button.value : null;
|
| | | }).filter(value => value !== null);
|
| | | // return buttonItem ? buttonItem.button.value : null;
|
| | | // }).filter(value => value !== null);
|
| | |
|
| | | // 将得到的值添加到 data 数组中
|
| | | data2.push(...resetButtonValues);
|
| | | data2.unshift([], []);
|
| | | const jsonObject2 = { data2 };
|
| | | data2.push([], []);
|
| | | // // 将得到的值添加到 data 数组中
|
| | | // data2.push(...resetButtonValues);
|
| | | // data2.unshift([], []);
|
| | | // const jsonObject2 = { data2 };
|
| | | // data2.push([], []);
|
| | |
|
| | | // 提交数据到后端
|
| | | const jsonString2 = JSON.stringify(jsonObject2);
|
| | | console.log('所有故障的value:', jsonString2);
|
| | | socket?.send(jsonString2);
|
| | | // // 提交数据到后端
|
| | | // const jsonString2 = JSON.stringify(jsonObject2);
|
| | | // console.log('所有故障的value:', jsonString2);
|
| | | // socket?.send(jsonString2);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | };
|
| | |
|
| | | // 收到消息
|
| | | socket.onmessage = (msg) => {
|
| | | if (!msg.data) {
|
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑
|
| | | }
|
| | | // let 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) {
|
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑
|
| | | }
|
| | |
|
| | | if (document.activeElement.tagName.toLowerCase() === 'input') {
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | let obj = JSON.parse(msg.data);
|
| | | // console.log(obj)
|
| | | const jsonData2 = this.jsonData;
|
| | | const weihuiling = obj.weihuiling;
|
| | | const handleMouseMove = throttle(function (event) {
|
| | | const inputBox = document.querySelectorAll('.el-card__body');
|
| | | const target = event.target;
|
| | | if (obj.zuhe1 && inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
|
| | |
|
| | |
|
| | |
|
| | | |
| | | if (obj.zuhe1 ) {
|
| | | // 执行更新逻辑
|
| | | for (let i = 0; i < 2; i++) {
|
| | | jsonData2[i].forEach((item, index) => {
|
| | |
| | |
|
| | |
|
| | | }
|
| | | }, 50);
|
| | | |
| | |
|
| | | document.addEventListener('mouseover', handleMouseMove);
|
| | | |
| | |
|
| | |
|
| | |
|
| | | if(obj.zuhe1){
|