配置id的检索in方式,增加id个数不大于200的校验
This commit is contained in:
@@ -42,6 +42,24 @@ jQuery.validator.addMethod("compileIdCheck",function(value,element){
|
||||
}
|
||||
return flagTypeSame ;
|
||||
},$.validator.messages.compileIdCheck);
|
||||
// 新增配置ID 查询条件验证 1,2,3 查询个数不能大于200个的校验
|
||||
jQuery.validator.addMethod("compileIdCheckNum",function(value,element){
|
||||
var flagTypeSame=true;
|
||||
if(this.optional(element) || /^(\d+,)*\d+$/.test(value) || /^(\d+-)?\d+$/.test(value)){
|
||||
flagTypeSame=true;
|
||||
if(/^(\d+,)*\d+$/.test(value)){
|
||||
var strArr=value.split(",");
|
||||
if(strArr.length >200){
|
||||
flagTypeSame=false;
|
||||
}else{
|
||||
flagTypeSame=true;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
flagTypeSame=false;
|
||||
}
|
||||
return flagTypeSame ;
|
||||
},$.validator.messages.compileIdCheckNum);
|
||||
jQuery.validator.addMethod("hexCheck", function(value, element) {
|
||||
return this.optional(element) || /^([0-9|a-f|A-F]*)$/.test(value);
|
||||
}, $.validator.messages.hexCheck);
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
log_no_data:"This hour no data",
|
||||
expireTip:"Start time and end time interval is at least 1 minute",
|
||||
compareTip:"Start time should not be less than the current time plus 2 minutes.",
|
||||
compileIdCheck:"Please enter the correct query format"
|
||||
compileIdCheck:"Please enter the correct query format",
|
||||
compileIdCheckNum:"The number of queries should not be greater than 200"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
log_no_data:"Нет данных за этот час",
|
||||
expireTip:"Start time and end time interval is at least 1 minute",
|
||||
compareTip:"Start time should not be less than the current time plus 2 minutes.",
|
||||
compileIdCheck:"Please enter the correct query format"
|
||||
compileIdCheck:"Please enter the correct query format",
|
||||
compileIdCheckNum:"The number of queries should not be greater than 200"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
log_no_data:"本小时无数据",
|
||||
expireTip:"开始时间结束时间间隔至少为1分钟",
|
||||
compareTip:"开始时间不能小于当前时间加上2分钟 ",
|
||||
compileIdCheck:"请输入正确的查询格式"
|
||||
compileIdCheck:"请输入正确的查询格式",
|
||||
compileIdCheckNum:"查询个数不能大于200"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -741,23 +741,29 @@ window.onload=function(){
|
||||
// 配置id的搜索下拉框选择切换
|
||||
if ($("#searchForm #seltype").val() == 'compileIdNew') {
|
||||
$("#searchForm #intype").addClass("compileIdCheck");
|
||||
$("#searchForm #intype").addClass("compileIdCheckNum");
|
||||
} else {
|
||||
$("#searchForm #intype").removeClass("compileIdCheck");
|
||||
$("#searchForm #intype").removeClass("compileIdCheckNum");
|
||||
}
|
||||
// reset时去掉number
|
||||
$("#resetBtn").on("click", function() {
|
||||
if ($("#searchForm #seltype").val() == 'compileIdNew') {
|
||||
$("#searchForm #intype").addClass("compileIdCheck");
|
||||
$("#searchForm #intype").addClass("compileIdCheckNum");
|
||||
} else {
|
||||
$("#searchForm #intype").removeClass("compileIdCheck");
|
||||
$("#searchForm #intype").removeClass("compileIdCheckNum");
|
||||
}
|
||||
});
|
||||
// 切换时为compileId加上number
|
||||
$("#searchForm #seltype").on("change", function() {
|
||||
if ($("#searchForm #seltype").val() == 'compileIdNew') {
|
||||
$("#searchForm #intype").addClass("compileIdCheck");
|
||||
$("#searchForm #intype").addClass("compileIdCheckNum");
|
||||
} else {
|
||||
$("#searchForm #intype").removeClass("compileIdCheck");
|
||||
$("#searchForm #intype").removeClass("compileIdCheckNum");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user