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'); + } + } + + } } - } + }); + }