From 35b92e62a6ba557f7feeea1a344e104d8db7ffb4 Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期二, 12 十二月 2023 16:59:44 +0800 Subject: [PATCH] A01启动 B01启动 增加plc地址 单独写入 --- CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue | 126 +++++++++++++++++++++++++++++++---------- 1 files changed, 94 insertions(+), 32 deletions(-) diff --git a/CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue b/CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue index 392a1b4..fee9ef8 100644 --- a/CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue +++ b/CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue @@ -42,7 +42,12 @@ <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" class="item-container"> <div class="item-row"> <span class="name" style="width:300px;">{{ item.name }}</span> - <el-input style="width:250px;" v-if="item.state != 0 && item.type === '0'" v-model="item.value" + + <el-input style="width:250px;" v-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 === 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'" v-model="item.value" class="input-box"></el-input> </div> </div> @@ -112,54 +117,95 @@ }, + + + A01start(){ + const data = []; + +for (let i = 0; i < 1; i++) { + const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => { + return { value: item.value }; + }); + + const values = inputData.map(item => item.value); + + data.push(values); +} +data.push([], [], [],[]); + + + +const jsonObject = { data }; + +// 鎻愪氦鏁版嵁鍒板悗绔� +const jsonString = JSON.stringify(jsonObject); +console.log('鎵�鏈塗ype涓�0鐨剉alue:', jsonString); +socket?.send(jsonString); + + + }, + A02start(){ + + const data = []; + +for (let i = 1; i < 2; i++) { + const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => { + return { value: item.value }; + }); + + const values = inputData.map(item => item.value); + data.unshift([]); + data.push(values); +} +data.push([], [], []); + + +const jsonObject = { data }; + +// 鎻愪氦鏁版嵁鍒板悗绔� +const jsonString = JSON.stringify(jsonObject); +console.log('鎵�鏈塗ype涓�0鐨剉alue:', jsonString); +socket?.send(jsonString); + }, //鎻愪氦鏂规硶 submitDataToBackend (currentButtonName) { if (currentButtonName === 'A01缈昏浆鍚姩' || currentButtonName === 'A01 SERVE TURN') { const data = []; - for (let i = 0; i < 1; i++) { - const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => { - return { value: item.value }; - }); +const values = [this.jsonData[0][3].button.value] - const values = inputData.map(item => item.value); - - data.push(values); - } - data.push([], [], [],[]); + data.push(values); + + data.unshift([], [], [],[],[]); - const jsonObject = { data }; + const jsonObject = { data }; - // 鎻愪氦鏁版嵁鍒板悗绔� - const jsonString = JSON.stringify(jsonObject); - console.log('鎵�鏈塗ype涓�0鐨剉alue:', jsonString); - socket?.send(jsonString); + // 鎻愪氦鏁版嵁鍒板悗绔� + const jsonString = JSON.stringify(jsonObject); + console.log('鎵�鏈塗ype涓�0鐨剉alue:', jsonString); + socket?.send(jsonString); } if (currentButtonName === 'A02缈昏浆鍚姩' || currentButtonName === 'A02 SERVE TURN') { const data = []; - for (let i = 1; i < 2; i++) { - const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => { - return { value: item.value }; - }); +const values = [this.jsonData[0][3].button.value] - const values = inputData.map(item => item.value); - data.unshift([]); - data.push(values); - } - data.push([], [], []); + data.push(values); + + data.unshift([], [], [],[],[],[]); - const jsonObject = { data }; - // 鎻愪氦鏁版嵁鍒板悗绔� - const jsonString = JSON.stringify(jsonObject); - console.log('鎵�鏈塗ype涓�0鐨剉alue:', jsonString); - socket?.send(jsonString); + const jsonObject = { data }; + + // 鎻愪氦鏁版嵁鍒板悗绔� + const jsonString = JSON.stringify(jsonObject); + console.log('鎵�鏈塗ype涓�0鐨剉alue:', jsonString); + socket?.send(jsonString); } @@ -306,6 +352,12 @@ document.addEventListener('mouseover', handleMouseMove); + + if(obj.zuhe1){ + + + + // 閬嶅巻guzhang鏁扮粍 for (let i = 0; i < jsonData2.length; i++) { let arr = jsonData2[i]; @@ -328,7 +380,7 @@ for (let j = 0; j < arr2.length; j++) { let obj3 = arr2[j]; if (obj3.button) { - if (obj3.button && (obj3.button.name === "鏈洖闆�" || obj3.button.name === "NotZero")) { + if (obj3.button && (obj3.button.name === "鏈洖闆�" || obj3.button.name === "NotZero" || obj3.button.name === "宸插洖闆�" || obj3.button.name === "Zero")) { obj3.button.value = weihuiling[0][i]; // console.log(obj3.button.value) } @@ -360,11 +412,19 @@ for (let j = 0; j < arr.length; j++) { let obj = arr[j]; if (obj.button && obj.button.value===1) { - if ( obj.button.name.includes("鏈洖闆�")&& this.language==="zh-CN") { + if ( obj.button.name==="鏈洖闆�" && this.language==="zh-CN") { obj.button.name =obj.button.name.replace("鏈洖闆�","宸插洖闆�") ; } - if ( obj.button.name.includes("NotZero")) { + if ( obj.button.name==="NotZero") { obj.button.name =obj.button.name.replace("NotZero","Zero") ; + } + } + if (obj.button && obj.button.value===0) { + if ( obj.button.name==="宸插洖闆�"&& this.language==="zh-CN") { + obj.button.name =obj.button.name.replace("宸插洖闆�","鏈洖闆�") ; + } + if ( obj.button.name==="Zero") { + obj.button.name =obj.button.name.replace("Zero","NotZero") ; } } @@ -372,6 +432,8 @@ } } +} + }; -- Gitblit v1.8.0