| | |
| | | <div class="item-container"> |
| | | <div class="item-row"> |
| | | <span class="name" style='width:230px;'>{{ item.name }}</span> |
| | | <el-input v-if="item.type === '0'" v-model="item.value" class='input-box' :class="{ 'special-class': groupIndex === 0,'special-class2': groupIndex === 1 }" v-show="groupIndex !== 0 && groupIndex !== 1" ></el-input> |
| | | |
| | | <el-input v-if="item.type === '0' && groupIndex === 0" v-model="item.value" @keyup.enter.native="zuhe1" class='input-box' :class="{ 'special-class': groupIndex === 0,'special-class2': groupIndex === 1 }" v-show="groupIndex !== 0 && groupIndex !== 1" ></el-input> |
| | | <el-input v-else-if="item.type === '0' && groupIndex === 1" v-model="item.value" @keyup.enter.native="zuhe2" class='input-box' :class="{ 'special-class': groupIndex === 0,'special-class2': groupIndex === 1 }" v-show="groupIndex !== 0 && groupIndex !== 1" ></el-input> |
| | | <el-input v-else-if="item.type === '0' " v-model="item.value" class='input-box' :class="{ 'special-class': groupIndex === 0,'special-class2': groupIndex === 1 }" v-show="groupIndex !== 0 && groupIndex !== 1" ></el-input> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="button-row" style="display: flex; justify-content: space-between;"> |
| | | <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex"> |
| | | <el-button v-if="item.button && language === 'en-US' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1,'error-button2': item.button.name === 'NotZero' && item.button.value === 0,'error-button3': item.button.name === 'NotZero' && item.button.value === 1,'fuwei': item.button.name === 'Reset' && item.button.value === 1,'huiling': item.button.name === 'Home' && item.button.value === 1,'qidong': item.button.name === 'A01 Semi-Auto' && item.button.value === 1,'qidong2': item.button.name === 'A02 Semi-Auto' && item.button.value === 1,'qidong3': item.button.name === 'A01 Semi-Auto Start' && item.button.value === 1,'qidong4': item.button.name === 'A02 Semi-Auto Start' && item.button.value === 1,'qidong5': item.button.name === 'A02 Semi-Auto' && item.button.value === 1,'jiting': item.button.name === 'Abort/ResumeTasks' && item.button.value === 1}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> |
| | | <el-button v-if="item.button && language === 'zh-CN' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '故障' && item.button.value === 1,'error-button3': item.button.name === '未回零' && item.button.value === 1,'error-button2': item.button.name === '未回零' && item.button.value === 0,'fuwei': item.button.name === '复位' && item.button.value === 1,'huiling': item.button.name === '回零' && item.button.value === 1,'qidong': item.button.name === 'A01半自动' && item.button.value === 1,'qidong2': item.button.name === 'A02半自动' && item.button.value === 1,'qidong3': item.button.name === 'A01半自动启动' && item.button.value === 1,'qidong4': item.button.name === 'A02半自动启动' && item.button.value === 1,'qidong5': item.button.name === 'A02半自动' && item.button.value === 1,'jiting': item.button.name === '急停后中止/继续选择' && item.button.value === 1 }" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> |
| | | <el-button v-if="item.button && language === 'en-US' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1,'error-button2': item.button.name === 'NotZero' && item.button.value === 0,'error-button3': item.button.name === 'NotZero' && item.button.value === 1,'fuwei': item.button.name === 'Reset' && item.button.value === 1,'huiling': item.button.name === 'Home' && item.button.value === 1,'qidong': item.button.name === 'A01 Semi-Auto' && item.button.value === 1,'qidong2': item.button.name === 'A02 Semi-Auto' && item.button.value === 1,'qidong3': item.button.name === 'A01 Semi-Auto Start' && item.button.value === 1,'qidong4': item.button.name === 'A02 Semi-Auto Start' && item.button.value === 1,'qidong5': item.button.name === 'A02 Semi-Auto' && item.button.value === 1,'jiting': item.button.name === 'Abort/ResumeTasks' && item.button.value === 1,'yihuiling': item.button.name === 'Zero' && item.button.value === 1}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> |
| | | <el-button v-if="item.button && language === 'zh-CN' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '故障' && item.button.value === 1,'error-button3': item.button.name === '未回零' && item.button.value === 1,'error-button2': item.button.name === '未回零' && item.button.value === 0,'fuwei': item.button.name === '复位' && item.button.value === 1,'huiling': item.button.name === '回零' && item.button.value === 1,'qidong': item.button.name === 'A01半自动' && item.button.value === 1,'qidong2': item.button.name === 'A02半自动' && item.button.value === 1,'qidong3': item.button.name === 'A01半自动启动' && item.button.value === 1,'qidong4': item.button.name === 'A02半自动启动' && item.button.value === 1,'qidong5': item.button.name === 'A02半自动' && item.button.value === 1,'jiting': item.button.name === '急停后中止/继续选择' && item.button.value === 1,'yihuiling': item.button.name === '已回零' && item.button.value === 1 }" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | |
| | | this.$set(dataGroup[itemIndex].button, 'value', 1); |
| | | } |
| | | }, |
| | | submitDataToBackend(currentButtonName) { |
| | | zuhe1(){ |
| | | |
| | | //A01半自动启动提交 |
| | | if (currentButtonName === 'A01半自动启动' ||currentButtonName === 'A01 Semi-Auto Start') { |
| | | const data = []; |
| | | const data = []; |
| | | |
| | | for (let i = 0; i < 1; i++) { |
| | | const inputData = this.jsonData[i].filter(item => item.type === '0' && item.read !== 9999).map(item => { |
| | |
| | | console.log('所有Type为0的value:', jsonString); |
| | | socket?.send(jsonString); |
| | | |
| | | } |
| | | //A02半自动启动 提交 |
| | | }, |
| | | zuhe2(){ |
| | | |
| | | if (currentButtonName === 'A02半自动启动' ||currentButtonName === 'A02 Semi-Auto Start') { |
| | | const data2 = []; |
| | | const data2 = []; |
| | | |
| | | for (let i = 1; i < 2; i++) { |
| | | const inputData = this.jsonData[i].filter(item => item.type === '0' && item.read !== 8888).map(item => { |
| | |
| | | data2.push( [],[], []); |
| | | |
| | | } |
| | | |
| | | |
| | | const jsonObject = { data:data2 }; |
| | | |
| | | // 提交数据到后端 |
| | | const jsonString = JSON.stringify(jsonObject); |
| | | console.log('所有Type为0的value:', jsonString); |
| | | socket?.send(jsonString); |
| | | |
| | | }, |
| | | submitDataToBackend(currentButtonName) { |
| | | |
| | | //A01半自动启动提交 |
| | | if (currentButtonName === 'A01半自动启动' ||currentButtonName === 'A01 Semi-Auto Start') { |
| | | const data = []; |
| | | |
| | | |
| | | const values = [this.jsonData[0][10].button.value] |
| | | |
| | | data.push(values); |
| | | |
| | | |
| | | data.unshift([], [],[],[], [],[],[], []); |
| | | |
| | | |
| | | const jsonObject = { data }; |
| | | |
| | | // 提交数据到后端 |
| | | const jsonString = JSON.stringify(jsonObject); |
| | | console.log('所有Type为0的value:', jsonString); |
| | | socket?.send(jsonString); |
| | | |
| | | } |
| | | //A02半自动启动 提交 |
| | | |
| | | if (currentButtonName === 'A02半自动启动' ||currentButtonName === 'A02 Semi-Auto Start') { |
| | | const data2 = []; |
| | | |
| | | const values2 = [this.jsonData[1][8].button.value] |
| | | |
| | | data2.push(values2); |
| | | |
| | | |
| | | data2.unshift([],[], [],[],[], [],[],[], []); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const jsonObject = { data:data2 }; |
| | |
| | | // ) |
| | | } |
| | | |
| | | // if (currentButtonName === 'Abort/ResumeTasks' || currentButtonName === '急停后中止/继续选择') { |
| | | // const data3 = []; |
| | | // const resetButtonValues3 = this.jsonData.map(item => { |
| | | // const buttonItem3 = item.find(subItem => subItem.button && ['Abort/resumeTasks', '急停后中止/继续选择'].includes(subItem.button.name)); |
| | | |
| | | // return buttonItem3 ? buttonItem3.button.value : null; |
| | | // }).filter(value => value !== null); |
| | | |
| | | // // 将得到的值添加到 data 数组中 |
| | | // data3.push(resetButtonValues3.flat()); |
| | | |
| | | // // 在 data3 数组前面添加两个空数组 |
| | | |
| | | // data3.push([], [], [],[], [], [], [],[]); |
| | | |
| | | // // 创建 jsonObject3 对象,并添加 data3 属性 |
| | | // const jsonObject3 = { data: data3 }; |
| | | |
| | | // // 提交数据到后端 |
| | | // const jsonString3 = JSON.stringify(jsonObject3); |
| | | // console.log('急停后中止/继续选择:', jsonString3); |
| | | // socket?.send(jsonString3); |
| | | // // setTimeout(()=> |
| | | // // window.location.reload(),2000 |
| | | // // ) |
| | | // } |
| | | |
| | | |
| | | //A01半自动提交 |
| | |
| | | } |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | | // console.log(obj) |
| | | console.log(obj) |
| | | const weihuiling=obj.weihuiling; |
| | | const jsonData2 = this.jsonData; |
| | | |
| | |
| | | }, 50); |
| | | |
| | | document.addEventListener('mouseover', handleMouseMove); |
| | | |
| | | |
| | | if (obj.qidong){ |
| | | |
| | | |
| | | |
| | |
| | | // } |
| | | |
| | | // console.log(jsonData2[5][4].button.value) |
| | | if(jsonData2[2][3].button.value===1){ |
| | | if(jsonData2[2][3].button.value===1 && (jsonData2[2][3].button.name==="NotZero" ||jsonData2[2][3].button.name==="未回零")){ |
| | | jsonData2[2][3].button.name=jsonData2[2][3].button.name.replace("未回零","已回零") ; |
| | | jsonData2[2][3].button.name=jsonData2[2][3].button.name.replace("NotZero","Zero") ; |
| | | } |
| | | if(jsonData2[3][3].button.value===1){ |
| | | if(jsonData2[3][3].button.value===1 && (jsonData2[3][3].button.name==="NotZero" ||jsonData2[3][3].button.name==="未回零")){ |
| | | jsonData2[3][3].button.name=jsonData2[3][3].button.name.replace("未回零","已回零") ; |
| | | jsonData2[3][3].button.name=jsonData2[3][3].button.name.replace("NotZero","Zero") ; |
| | | } |
| | | if(jsonData2[4][4].button.value===1){ |
| | | if(jsonData2[4][4].button.value===1 && (jsonData2[4][4].button.name==="NotZero" ||jsonData2[4][4].button.name==="未回零")){ |
| | | jsonData2[4][4].button.name=jsonData2[4][4].button.name.replace("未回零","已回零") ; |
| | | jsonData2[4][4].button.name=jsonData2[4][4].button.name.replace("NotZero","Zero") ; |
| | | } |
| | | if(jsonData2[5][4].button.value===1){ |
| | | if(jsonData2[5][4].button.value===1 && (jsonData2[5][4].button.name==="NotZero" ||jsonData2[5][4].button.name==="未回零")){ |
| | | jsonData2[5][4].button.name=jsonData2[5][4].button.name.replace("未回零","已回零") ; |
| | | jsonData2[5][4].button.name=jsonData2[5][4].button.name.replace("NotZero","Zero") ; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | if(jsonData2[2][3].button.value===0 && (jsonData2[2][3].button.name==="Zero" ||jsonData2[2][3].button.name==="已回零")){ |
| | | jsonData2[2][3].button.name=jsonData2[2][3].button.name.replace("已回零","未回零") ; |
| | | jsonData2[2][3].button.name=jsonData2[2][3].button.name.replace("Zero","NotZero") ; |
| | | } |
| | | if(jsonData2[3][3].button.value===0 && (jsonData2[3][3].button.name==="Zero" ||jsonData2[3][3].button.name==="已回零")){ |
| | | jsonData2[3][3].button.name=jsonData2[3][3].button.name.replace("已回零","未回零") ; |
| | | jsonData2[3][3].button.name=jsonData2[3][3].button.name.replace("Zero","NotZero") ; |
| | | } |
| | | if(jsonData2[4][4].button.value===0 && (jsonData2[4][4].button.name==="Zero" ||jsonData2[4][4].button.name==="已回零")){ |
| | | jsonData2[4][4].button.name=jsonData2[4][4].button.name.replace("已回零","未回零") ; |
| | | jsonData2[4][4].button.name=jsonData2[4][4].button.name.replace("Zero","NotZero") ; |
| | | } |
| | | if(jsonData2[5][4].button.value===0 && (jsonData2[5][4].button.name==="Zero" ||jsonData2[5][4].button.name==="已回零")){ |
| | | jsonData2[5][4].button.name=jsonData2[5][4].button.name.replace("已回零","未回零") ; |
| | | jsonData2[5][4].button.name=jsonData2[5][4].button.name.replace("Zero","NotZero") ; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | }; |
| | |
| | | background-color: green; |
| | | |
| | | } |
| | | |
| | | .yihuiling{ |
| | | |
| | | background-color: green; |
| | | } |
| | | </style> |