From a1f8e1779a1b31ad69439d66447ba1ed69d030fe Mon Sep 17 00:00:00 2001 From: duandongmei Date: Mon, 21 Jan 2019 14:46:57 +0600 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=B8=AD=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=E6=A3=80?= =?UTF-8?q?=E7=B4=A2=E6=9D=A1=E4=BB=B6=EF=BC=8Cjs=E4=BD=BF=E7=94=A8el?= =?UTF-8?q?=E8=A1=A8=E8=BE=BE=E5=BC=8F=E8=B5=8B=E5=80=BC=E6=97=B6=E5=AD=98?= =?UTF-8?q?=E5=9C=A8html=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6=E6=9C=AA?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E9=97=AE=E9=A2=98=EF=BC=9B=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=AD=97=E6=AE=B5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0escapeHtml4=E8=BD=AC=E6=8D=A2=EF=BC=9B=20=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E6=A0=A1=E9=AA=8C=E4=B8=8D=E4=BD=BF=E7=94=A8=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E7=9A=84=E5=9F=9F=E5=90=8D=E6=A0=BC=E5=BC=8F=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/excel/ImportBigExcel.java | 3 ++- .../jquery-validation/1.11.0/jquery.validate.method.js | 2 +- src/main/webapp/static/global/scripts/jeesite.js | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/nis/util/excel/ImportBigExcel.java b/src/main/java/com/nis/util/excel/ImportBigExcel.java index 71a39afad..1425d8074 100644 --- a/src/main/java/com/nis/util/excel/ImportBigExcel.java +++ b/src/main/java/com/nis/util/excel/ImportBigExcel.java @@ -20,6 +20,7 @@ import java.util.concurrent.BlockingQueue; import javax.xml.parsers.ParserConfigurationException; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; @@ -468,7 +469,7 @@ public class ImportBigExcel extends XLSXCovertCSVReader{ if(StringUtils.endsWith(s, ".0") && !s.endsWith("0.0.0.0")){ val = StringUtils.substringBefore(s, ".0"); }else{ - val = String.valueOf(val.toString().trim()); + val=val == null ? "" : StringEscapeUtils.escapeHtml4(val.toString().trim()); } }else if (valType == Integer.class){ val = Double.valueOf(val.toString().trim()).intValue(); 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 645ec890f..15123c1b4 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 @@ -193,7 +193,7 @@ jQuery.validator.addMethod("notStartZero",function(value, element) { }, "请填写正确的数值"); //域名验证正则 jQuery.validator.addMethod("domainCheck",function(value, element) { - var regexp=/^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/; + var regexp=/^[a-zA-Z0-9.-]*$/ if(this.optional(element)||regexp.test(value)){ return true; } diff --git a/src/main/webapp/static/global/scripts/jeesite.js b/src/main/webapp/static/global/scripts/jeesite.js index 1ae873ff2..42ef1bc72 100644 --- a/src/main/webapp/static/global/scripts/jeesite.js +++ b/src/main/webapp/static/global/scripts/jeesite.js @@ -304,7 +304,7 @@ function abbr(name, maxLength){ /*筛选按钮初始化*/ function filterActionInit() { - + escapIntypeHtml(); var isFilterAction = $("#isFilterAction").val(); if(isFilterAction=="true") { fiterPanleShow(); @@ -322,7 +322,12 @@ function filterActionInit() { } }); } - +/*******配置界面中下拉选择检索条件,js使用el表达式赋值时存在html特殊字符未转换问题*********/ +function escapeIntypeHtml(){ + //首先使用html()方法将检索内容特殊字符转换,再次使用text()将转换后的正常字符串赋值给intype + $("#intype").val($("#intype").html($("#intype").val()).text()); + $("#intype").html(''); +} function tzheight(){ var hei=document.documentElement.clientHeight; hei=hei-91;