Просмотр исходного кода

修复数据网格和多选按钮校验异常的问题

unknown 5 лет назад
Родитель
Сommit
90a9ece0b9

+ 59 - 0
o2web/source/x_component_process_Xform/Checkbox.js

@@ -256,6 +256,65 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
                 this.errNode = null;
             }
         }
+    },
+    validationConfigItem: function(routeName, data){
+        var flag = (data.status==="all") ? true: (routeName === data.decision);
+        if (flag){
+            var n = this.getInputData();
+            if( typeOf(n)==="array" && n.length === 0 )n = "";
+            var v = (data.valueType==="value") ? n : n.length;
+            switch (data.operateor){
+                case "isnull":
+                    if (!v){
+                        this.notValidationMode(data.prompt);
+                        return false;
+                    }
+                    break;
+                case "notnull":
+                    if (v){
+                        this.notValidationMode(data.prompt);
+                        return false;
+                    }
+                    break;
+                case "gt":
+                    if (v>data.value){
+                        this.notValidationMode(data.prompt);
+                        return false;
+                    }
+                    break;
+                case "lt":
+                    if (v<data.value){
+                        this.notValidationMode(data.prompt);
+                        return false;
+                    }
+                    break;
+                case "equal":
+                    if (v==data.value){
+                        this.notValidationMode(data.prompt);
+                        return false;
+                    }
+                    break;
+                case "neq":
+                    if (v!=data.value){
+                        this.notValidationMode(data.prompt);
+                        return false;
+                    }
+                    break;
+                case "contain":
+                    if (v.indexOf(data.value)!=-1){
+                        this.notValidationMode(data.prompt);
+                        return false;
+                    }
+                    break;
+                case "notcontain":
+                    if (v.indexOf(data.value)==-1){
+                        this.notValidationMode(data.prompt);
+                        return false;
+                    }
+                    break;
+            }
+        }
+        return true;
     }
 	
 }); 

+ 1 - 0
o2web/source/x_component_process_Xform/DatagridMobile.js

@@ -1305,6 +1305,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
         var flag = (data.status=="all") ? true: (routeName == data.decision);
         if (flag){
             var n = this.getData();
+            if( typeOf(n)==="object" && JSON.stringify(n) === JSON.stringify({data:[]}) )n = "";
             var v = (data.valueType=="value") ? n : n.length;
             switch (data.operateor){
                 case "isnull":

+ 2 - 0
o2web/source/x_component_process_Xform/DatagridPC.js

@@ -1089,9 +1089,11 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
     },
 
     validationConfigItem: function(routeName, data){
+		debugger;
         var flag = (data.status=="all") ? true: (routeName == data.decision);
         if (flag){
             var n = this.getData();
+			if( typeOf(n)==="object" && JSON.stringify(n) === JSON.stringify({data:[]}) )n = "";
             var v = (data.valueType=="value") ? n : n.length;
             switch (data.operateor){
                 case "isnull":