From f6405c6f042e7f18466b2ced952def962272f495 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Tue, 2 Apr 2019 11:50:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=9D=E6=8A=A4=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E5=8A=9F=E8=83=BD=E6=94=B9=E4=B8=BA=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/template/P2pIpTemplate.java | 2 +- .../basics/InnerProtectionListService.java | 4 +- .../webapp/static/global/scripts/common.js | 54 ++++++++++++------- 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/template/P2pIpTemplate.java b/src/main/java/com/nis/domain/configuration/template/P2pIpTemplate.java index ae2223d4c..74de95655 100644 --- a/src/main/java/com/nis/domain/configuration/template/P2pIpTemplate.java +++ b/src/main/java/com/nis/domain/configuration/template/P2pIpTemplate.java @@ -10,7 +10,7 @@ public class P2pIpTemplate extends IpAllTemplate { private String userRegion2; - @ExcelField(title="p2p_ip_config_type",dictType="P2P_IP_TYPE",align=2,sort=2) + @ExcelField(title="p2p_ip_config_type",dictType="P2P_IP_TYPE",align=2,sort=5) public String getUserRegion2() { return userRegion2; } diff --git a/src/main/java/com/nis/web/service/basics/InnerProtectionListService.java b/src/main/java/com/nis/web/service/basics/InnerProtectionListService.java index 1c8ef0a96..611144f2e 100644 --- a/src/main/java/com/nis/web/service/basics/InnerProtectionListService.java +++ b/src/main/java/com/nis/web/service/basics/InnerProtectionListService.java @@ -96,7 +96,9 @@ public class InnerProtectionListService extends BaseService{ if(dictMap.containsKey(info.getTargetType())) { putList = dictMap.get(info.getTargetType()); } - putList.add(info.getKeyword()); + if(!putList.contains(info.getKeyword())) { + putList.add(info.getKeyword()); + } dictMap.put(info.getTargetType(), putList); } CacheUtils.put(Constants.CACHE_PROTECTION_LIST_DICT, dictMap); diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 74ebd6c64..cbf14de7a 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -34,7 +34,6 @@ $(function(){ type:'get', url:pathName+'/basics/innerProtectionList/ajaxGetAllInfo', dataType:"json", - async:false, success:function(data){ if(data != null){ protectionData = data; @@ -42,18 +41,15 @@ $(function(){ var list = data[key]; $("."+key).each(function(){ if(!$(this).hasClass("tags")){ - this.setAttribute("onblur","protectedListWarn(this,'"+list+"')"); + this.setAttribute("onblur","protectedListWarn(this,'"+key+"')"); } - protectedListWarn(this,list); + protectedListWarn(this,key); }); - } - } - } }); - + //增加描述新增时的文字长度限制 $("form input[name='cfgDesc']").attr("maxlength","128"); $("form input[name='cfgDesc']").addClass("required"); @@ -459,7 +455,7 @@ $(function(){ var tagObj = $(this); for(var key in protectionData){ if(tagObj.hasClass(key)){ - protectedListWarn(tagObj,protectionData[key]); + protectedListWarn(tagObj,key); } } }, @@ -476,7 +472,7 @@ $(function(){ var tagObj = $(this); for(var key in protectionData){ if(tagObj.hasClass(key)){ - protectedListWarn(tagObj,protectionData[key]); + protectedListWarn(tagObj,key); } } } @@ -1746,15 +1742,35 @@ function addPrintTableCss(rowValue,cellValue,tableIdValue,cssName){ } } /**保护名单提醒**/ -function protectedListWarn(obj,protectedList){ - $(obj).next(".fa-warning").remove(); - var value = $(obj).val(); - if(value != ""){ - protectedList = typeof(protectedList) == 'string' ? protectedList.split(",") : protectedList; - if(protectedList.indexOf(value) >= 0){ - //$(obj).after(""+$.validator.messages.protect_warn+""); - $.jBox.info($.validator.messages.protect_warn,$.validator.messages.info); - $('.jbox-body .jbox-icon').css('top','55px'); +function protectedListWarn(obj,tagKey){ + var pathName = window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4); + $.ajax({ + type:'get', + url:pathName+'/basics/innerProtectionList/ajaxGetAllInfo', + dataType:"json", + success:function(data){ + if(data != null){ + for(var key in data){ + var list = data[key]; + $("."+key).each(function(){ + if(!$(this).hasClass("tags")){ + this.setAttribute("onblur","protectedListWarn(this,'"+key+"')"); + } + }); + } + + $(obj).next(".fa-warning").remove(); + var value = $(obj).val(); + var protectedList = data[tagKey]; + if(value != "" && typeof(protectedList) != "undefined"){ + if(protectedList.indexOf(value) >= 0){ // 关键字匹配则弹出提示框 + $.jBox.info($.validator.messages.protect_warn,$.validator.messages.info); + $('.jbox-body .jbox-icon').css('top','55px'); + } + } + + } } - } + }); + }