diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index 2487196bc..b46d9c9d3 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -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); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js index 75d4b37ff..7dddbf8db 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js @@ -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)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js index 3353a4757..35ef0523a 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js @@ -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)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js index 104ce97e0..814d3b2cb 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js @@ -93,6 +93,7 @@ log_no_data:"本小时无数据", expireTip:"开始时间结束时间间隔至少为1分钟", compareTip:"开始时间不能小于当前时间加上2分钟 ", - compileIdCheck:"请输入正确的查询格式" + compileIdCheck:"请输入正确的查询格式", + compileIdCheckNum:"查询个数不能大于200" }); }(jQuery)); diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 9be15efb1..cd8f1dca2 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -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"); } });