Przeglądaj źródła

fix:添加工序标注验证

luoxiao 3 miesięcy temu
rodzic
commit
2f9b07029b

+ 2 - 2
src/views/base/craftManagement/process/index.vue

@@ -413,8 +413,8 @@ option.value = Object.assign(option.value, {
       span: 12,
       rules: [
         {
-          max: 20,
-          message: "工序标注不能超过20个字符",
+          max: 16,
+          message: "工序标注不能超过16个字符",
           trigger: "blur",
         },
       ],

+ 7 - 0
src/views/base/craftManagement/route/bindConfig.ts

@@ -225,6 +225,13 @@ export const formOption = {
       prop: "operationLabel",
       span: 24,
       type: "textarea",
+      rules: [
+        {
+          max: 16,
+          message: "工序标注不能超过16个字符",
+          trigger: "blur",
+        },
+      ],
     },
     {
       label: "自定义名称",

+ 5 - 1
src/views/base/craftManagement/route/bindProcess.vue

@@ -562,6 +562,10 @@ const deleteFlow = () => {
 };
 
 const saveInfo = async () => {
+  let isValid = await formRef.value.validate();
+  if (!isValid) {
+    return;
+  }
   // 处理currentProcess的自定义对象名称字段,如果customFieldNameValues在customFieldOptions中存在,则设置isSelected为true,否则设置为false,最后转为json
   const customFieldArr = [];
   customFieldOptions.value.forEach((item) => {
@@ -632,7 +636,7 @@ const loadProcessesFlow = async () => {
       flowData.edges = jsonData.edges;
       flowDataCopy.value = JSON.parse(JSON.stringify(jsonData));
       cancelStatus.value = true;
-      if (res.data.usable == 1||res.data.flowState==="1") {
+      if (res.data.usable == 1 || res.data.flowState === "1") {
         usableStatus.value = false;
       }