ZengTao
2023-12-21 12c065f48d6a4f5b1489da95f2091edb9a831196
CanadaMes-ui/src/views/Electrical/ServoManualone.vue
@@ -328,7 +328,36 @@
          });
        const values = inputData.map((item) => item.value);
        // console.log(values)
        if (values.length > 0) {
if (!(values[1] == "1" || values[1] == "2")) {
  values.shift();
  this.$message.error("Out of range");
  return false;
}
// if (!(values[2] < "380" ) ) {
//   values.shift();
//   this.$message.error("Out of range");
//   return false;
// }
if (!(values[4] >= "1" && values[4]  <= "210")  && values[4]  !== "1000") {
  values.shift();
  this.$message.error("Out of range");
  return false;
}
if (!(values[5] >= "1" && values[5]  <= "210")  && values[5]  !== "1000") {
  values.shift();
  this.$message.error("Out of range");
  return false;
}
}
        data.push(values);
      }
@@ -342,8 +371,13 @@
          });
        const values = inputData.map((item) => item.value);
        data.push(values);
        const pattern = /^[\w ]{1,14}$/;   // 匹配长度为14的数字、字母、空格的组合
if (!pattern.test(values[0])) {
  values.shift();
  this.$message.error("Please enter a 14-character string.");
  return false;
}
       data.push(values);
      }
      data.push([], [], []);
@@ -366,6 +400,29 @@
        const values2 = inputData.map((item) => item.value);
        if (values2.length > 0) {
if (!(values2[1] >= "1" && values2[1]  <= "210")  && values2[1]  !== "1000") {
  values2.shift();
  this.$message.error("Out of range");
  return false;
}
if (!(values2[2] >= "1" && values2[2]  <= "210")  && values2[2]  !== "1000") {
  values2.shift();
  this.$message.error("Out of range");
  return false;
}
if (!(values2[3] == "1" || values2[3] == "2")) {
  values2.shift();
  this.$message.error("Out of range");
  return false;
}
}
        data2.push(values2);
      }
      data2.unshift([]);
@@ -380,7 +437,12 @@
          });
        const values2 = inputData.map((item) => item.value);
        const pattern = /^[\w ]{1,14}$/;  // 匹配长度为14的数字、字母、空格的组合
if (!pattern.test(values2[0])) {
  values2.shift();
  this.$message.error("Please enter a 14-character string.");
  return false;
}
        data2.push(values2);
        data2.push([], [], []);
      }