123 1 year ago
parent
commit
b3fa1abf11
1 changed files with 4 additions and 14 deletions
  1. 4 14
      src/views/runData/components/systemData/components/EditDialog.vue

+ 4 - 14
src/views/runData/components/systemData/components/EditDialog.vue

@@ -351,19 +351,7 @@ const amendTimeValidator = (row: any, index: number, data: []) => {
     },
   ];
 };
-/**验证目标温度 */
-const tempValidator = (val) => {
-  if (val !== 0 && val !== null && val !== '' && val !== undefined) {
-    if (val < 30 || val > 50) {
-      return {
-        result: false,
-        message: '范围在30到50之间',
-        type: 'error',
-      };
-    }
-  }
-  return true;
-};
+
 const formRule = reactive({
   sysName: [
     {
@@ -393,7 +381,6 @@ const formRule = reactive({
       type: 'error',
     },
   ],
-  targetTemperature: [{ validator: tempValidator }],
 });
 
 const formData = reactive({
@@ -509,6 +496,9 @@ const remoteMethod = (search: string | number) => {
 const sendList = () => {
   let value = formData.targetTemperature;
   if (!value) return MessagePlugin.error('目标温度不能为空');
+  if (value < 30 || value > 50) {
+    return MessagePlugin.error('范围在30至50之间');
+  }
   const confirmDia = DialogPlugin({
     header: '提示',
     body: `此操作将进行(目标温度 :${value})下发,确定吗?`,