wuyouming666
2023-12-07 9bc80fd0aab5bd3d58aad90038685195f4966dee
CanadaMes-ui/src/views/Electrical/ServoManualone.vue
@@ -267,6 +267,33 @@
  // )
}
// 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半自动提交
@@ -441,7 +468,7 @@
  }
  let obj = JSON.parse(msg.data);
  // console.log(obj)
  //  console.log(obj)
const weihuiling=obj.weihuiling;
  const jsonData2 = this.jsonData;
@@ -451,11 +478,6 @@
  if (obj.zuhe1 && inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
    
    //启动按钮
 
    jsonData2[0][9].button.value = obj.qidong[0][0];  // 第一个子数组中第一个 type=66 的 button
jsonData2[0][10].button.value = obj.qidong[0][1]; // 第一个子数组中第二个 type=66 的 button
@@ -463,17 +485,6 @@
jsonData2[1][8].button.value = obj.qidong[0][3];
// 输出更新后的 jsonData2
    
    // 执行更新逻辑
    for (let i = 0; i < 6; i++) {
@@ -515,30 +526,14 @@
}
//未回零更新
for (let i = 3; i < jsonData2.length; i++) {
  let arr2 = jsonData2[i];
  for (let j = 3; j < arr2.length; j++) {
    let obj3 = arr2[j];
    if(obj3.button){
      if (obj3.button && (obj3.button.name === "未回零" || obj3.button.name === "NotZero" )) {
      obj3.button.value = weihuiling[0][i];
      //  console.log(obj3.button.value)
    }
jsonData2[2][3].button.value = weihuiling[0][0];
jsonData2[3][3].button.value = weihuiling[0][1];
jsonData2[4][4].button.value = weihuiling[0][2];
jsonData2[5][4].button.value = weihuiling[0][3];
    }
  }
}
// console.log(jsonData2)
//进片id
jsonData2.forEach((item) => {
  item.forEach((subItem) => {
@@ -556,11 +551,6 @@
  });
});
//急停
jsonData2[6][0].button.value = obj.resumeTasks[0][0];