调整协议字段取值

This commit is contained in:
wangxin
2018-10-06 23:10:54 +08:00
parent 210ba71901
commit 34d56b814e
3 changed files with 40 additions and 7 deletions

View File

@@ -287,7 +287,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='ipType'] option[value='"+ipTypeVal+"']").length>0){
o.find("select[name$='ipType']").selectpicker("val",ipTypeVal);
}else{
o.find("select[name$='ipType']").selectpicker("val",4);
if(o.find("select[name$='ipType'] option[value=4]").length>0){
o.find("select[name$='ipType']").selectpicker("val",4);
}else{
o.find("select[name$='ipType']").get(0).selectedIndex=0;
o.find("select[name$='ipType']").selectpicker("refresh");
}
}
}
@@ -310,7 +315,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='ipPattern'] option[value='"+ipPatternVal+"']").length>0){
o.find("select[name$='ipPattern']").selectpicker("val",ipPatternVal);
}else{
o.find("select[name$='ipPattern']").selectpicker("val",1);
if(o.find("select[name$='ipPattern'] option[value=1]").length>0){
o.find("select[name$='ipPattern']").selectpicker("val",1);
}else{
o.find("select[name$='ipPattern']").get(0).selectedIndex=0;
o.find("select[name$='ipPattern']").selectpicker("refresh");
}
}
}
//端口格式处理
@@ -332,7 +342,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='portPattern'] option[value='"+portPatternVal+"']").length>0){
o.find("select[name$='portPattern']").selectpicker("val",portPatternVal);
}else{
o.find("select[name$='portPattern']").selectpicker("val",1);
if(o.find("select[name$='portPattern'] option[value=1]").length>0){
o.find("select[name$='portPattern']").selectpicker("val",1);
}else{
o.find("select[name$='portPattern']").get(0).selectedIndex=0;
o.find("select[name$='portPattern']").selectpicker("refresh");
}
}
}
//方向处理
@@ -354,7 +369,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='direction'] option[value='"+directionVal+"']").length>0){
o.find("select[name$='direction']").selectpicker("val",directionVal);
}else{
o.find("select[name$='direction']").selectpicker("val",0);
if(o.find("select[name$='direction'] option[value=0]").length>0){
o.find("select[name$='direction']").selectpicker("val",0);
}else{
o.find("select[name$='direction']").get(0).selectedIndex=0;
o.find("select[name$='direction']").selectpicker("refresh");
}
}
}
//协议处理
@@ -376,7 +396,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='protocol'] option[value='"+protocolVal+"']").length>0){
o.find("select[name$='protocol']").selectpicker("val",protocolVal);
}else{
o.find("select[name$='protocol']").selectpicker("val",0);
if(o.find("select[name$='protocol'] option[value=0]").length>0){
o.find("select[name$='protocol']").selectpicker("val",0);
}else{
o.find("select[name$='protocol']").get(0).selectedIndex=0;
o.find("select[name$='protocol']").selectpicker("refresh");
}
}
}
}