配置保护名单功能改为实时查询.

This commit is contained in:
zhangwenqing
2019-04-02 11:50:12 +08:00
parent 04db6bcb47
commit f6405c6f04
3 changed files with 39 additions and 21 deletions

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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("<i class='fa fa-warning font-red-flamingo'>"+$.validator.messages.protect_warn+"</i>");
$.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');
}
}
}
}
}
});
}