diff --git a/src/main/java/com/nis/domain/FunctionRegionDict.java b/src/main/java/com/nis/domain/FunctionRegionDict.java index 613daeaf6..dd442663a 100644 --- a/src/main/java/com/nis/domain/FunctionRegionDict.java +++ b/src/main/java/com/nis/domain/FunctionRegionDict.java @@ -28,6 +28,14 @@ public class FunctionRegionDict extends BaseCfg { private String configDirection; private String configProtocol; private Integer configRegionSort; + private Integer isImport; + + public Integer getIsImport() { + return isImport; + } + public void setIsImport(Integer isImport) { + this.isImport = isImport; + } public Integer getConfigRegionSort() { return configRegionSort; diff --git a/src/main/java/com/nis/domain/FunctionServiceDict.java b/src/main/java/com/nis/domain/FunctionServiceDict.java index 912676a1a..8ae98dc94 100644 --- a/src/main/java/com/nis/domain/FunctionServiceDict.java +++ b/src/main/java/com/nis/domain/FunctionServiceDict.java @@ -18,6 +18,15 @@ public class FunctionServiceDict extends BaseCfg { private String actionCode; private String regionCode; + private Integer isImport; + + public Integer getIsImport() { + return isImport; + } + public void setIsImport(Integer isImport) { + this.isImport = isImport; + } + public String getRegionCode() { return regionCode; } diff --git a/src/main/java/com/nis/domain/configuration/template/IpPayloadTemplate.java b/src/main/java/com/nis/domain/configuration/template/IpPayloadTemplate.java index a9342e762..08f028394 100644 --- a/src/main/java/com/nis/domain/configuration/template/IpPayloadTemplate.java +++ b/src/main/java/com/nis/domain/configuration/template/IpPayloadTemplate.java @@ -23,14 +23,14 @@ public class IpPayloadTemplate extends IpAllTemplate { public String getUserRegion2() { return userRegion2; } - public void setUserRegion2(String userRegion1) { + public void setUserRegion2(String userRegion2) { this.userRegion2 = userRegion2; } @ExcelField(title="replace_content",align=2,sort=4) public String getUserRegion3() { return userRegion3; } - public void setUserRegion3(String userRegion1) { + public void setUserRegion3(String userRegion3) { this.userRegion3 = userRegion3; } } diff --git a/src/main/java/com/nis/util/excel/ImportExcel.java b/src/main/java/com/nis/util/excel/ImportExcel.java index 05a939490..5256a4dbf 100644 --- a/src/main/java/com/nis/util/excel/ImportExcel.java +++ b/src/main/java/com/nis/util/excel/ImportExcel.java @@ -359,7 +359,11 @@ public class ImportExcel { ExcelField ef = (ExcelField)os[0]; // If is dict type, get dict value if (StringUtils.isNotBlank(ef.dictType())){ - val = DictUtils.getDictCode(ef.dictType(), val.toString(), ""); + Object val1 = DictUtils.getDictCode(ef.dictType(), val.toString(), ""); + //没有获取到字典值的话会影响验证判断 + if(val1!=null&&StringUtils.isNotBlank(val1.toString())) { + val=val1; + } //log.debug("Dictionary type value: ["+i+","+colunm+"] " + val); } // Get param type and type cast diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 7d93f7b33..bee22fcd3 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -50,6 +50,7 @@ import com.nis.domain.configuration.RequestInfo; import com.nis.domain.configuration.StringCfgTemplate; import com.nis.domain.configuration.template.IpAllTemplate; import com.nis.domain.configuration.template.IpCfgTemplate; +import com.nis.domain.configuration.template.IpPayloadTemplate; import com.nis.domain.configuration.template.IpRateLimitTemplate; import com.nis.domain.log.BaseLogEntity; import com.nis.domain.log.SearchReport; @@ -825,6 +826,44 @@ public class BaseController { StringBuffer errInfo = new StringBuffer(); IpPortCfg baseIpCfg = new IpPortCfg(); BeanUtils.copyProperties(list.get(i), baseIpCfg); + //特殊字段验证 + //packet ip ratelimit + if(serviceDict.getFunctionId().intValue()==5&&serviceDict.getAction().intValue()==64) { + String userRegion1=baseIpCfg.getUserRegion1(); + try { + Double ratelimt= Double.parseDouble(userRegion1); + if(ratelimt>0.009||ratelimt<0.001) { + errInfo.append(prop.getProperty("ratelimit")+"."+String.format(prop.getProperty("must_between"),0.001,0.009)+";"); + } + } catch (Exception e) { + // TODO: handle exception + errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("ratelimit"))+";"); + } + } + //payload ip + if(regionDict.getFunctionId().equals(212)) { + //replace_zone + String userRegion1=baseIpCfg.getUserRegion1(); + if(StringUtils.isNotBlank(userRegion1)) { + Object val = DictUtils.getDictLabel("INTERCEPT_REPLACE_ZONE", userRegion1); + if(StringUtils.isBlank(val.toString())) { + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("replace_zone"))+";"); + } + }else { + errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("replace_zone"))+";"); + } + + //replaced_content + String userRegion2=baseIpCfg.getUserRegion2(); + if(StringUtils.isBlank(userRegion2)) { + errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("replaced_content"))+";"); + } + //replace_content + String userRegion3=baseIpCfg.getUserRegion3(); + if(StringUtils.isBlank(userRegion3)) { + errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("replace_content"))+";"); + } + } if (regionDict.getRegionType().equals(1)) { // 校验必填的IP,端口 for (String code : configIpPortShow.split(",")) { @@ -1205,7 +1244,7 @@ public class BaseController { } } if (!has) { - errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("direction")) + "," + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("direction")) + "." + String.format(prop.getProperty("alternative_values"), directionPattern) + ";"); } return has; @@ -1233,7 +1272,7 @@ public class BaseController { } } if (!has) { - errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("protocol")) + "," + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("protocol")) + "." + String.format(prop.getProperty("alternative_values"), protocolPattern) + ";"); } return has; @@ -2415,6 +2454,11 @@ public class BaseController { ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list); } } + }else if(regionDict.getFunctionId().equals(212)) { + if (regionDict.getRegionType().equals(1)) { + List list = ei.getDataList(IpPayloadTemplate.class); + ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list); + } } else if (regionDict.getRegionType().equals(1)) { List list = ei.getDataList(IpAllTemplate.class); ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java index 521e38303..4a2d523c3 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java @@ -5,6 +5,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -232,29 +233,18 @@ public class IpController extends BaseController{ ,FunctionRegionDict regionDict ,FunctionServiceDict serviceDict ,Integer requestId) throws Exception{ - String fileName = "template.xlsx"; - //ip类模板 - if(regionDict.getRegionType().equals(1)){ - if(regionDict.getFunctionId().equals(5)){// IP Address - if(serviceDict.getAction().equals(64)){//ip限速 - List classList=new ArrayList(); - ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpRateLimitTemplate.class, 2); - excel.setDataList(this.getMsgProp(),classList,null). - write(request,response, fileName).dispose(); - }else{ - List classList=new ArrayList(); - ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllTemplate.class, 2); - excel.setDataList(this.getMsgProp(),classList,null). - write(request,response, fileName).dispose(); - } - }else if(regionDict.getFunctionId().equals(212)){ //IP Payload - List classList=new ArrayList(); - ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpPayloadTemplate.class, 2); - excel.setDataList(this.getMsgProp(),classList,null). - write(request,response, fileName).dispose(); - }else if(regionDict.getFunctionId().equals(7)){ //Dns IP - List classList=new ArrayList(); - ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DnsIpTemplate.class, 2); + Properties pro=getMsgProp(); + String serviceName=pro.getProperty(serviceDict.getServiceName()); + String regionName=pro.getProperty(regionDict.getConfigRegionValue()); + serviceName=StringUtil.isEmpty(serviceName) ?serviceDict.getServiceName():serviceName; + regionName=StringUtil.isEmpty(regionName) ?regionDict.getConfigRegionValue():regionName; + String fileName = serviceName+"_"+regionName+"_template.xlsx"; + //ip类模板 + if(regionDict.getRegionType().equals(1)){ + if(regionDict.getFunctionId().equals(5)){// IP Address + if(serviceDict.getAction().equals(64)){//ip限速 + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpRateLimitTemplate.class, 2); excel.setDataList(this.getMsgProp(),classList,null). write(request,response, fileName).dispose(); }else{ @@ -263,41 +253,57 @@ public class IpController extends BaseController{ excel.setDataList(this.getMsgProp(),classList,null). write(request,response, fileName).dispose(); } - } - //str类模板 - if(regionDict.getRegionType().equals(2)){ - List classList=new ArrayList(); - ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllTemplate.class, 2); + }else if(regionDict.getFunctionId().equals(212)){ //IP Payload + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpPayloadTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); + }else if(regionDict.getFunctionId().equals(7)){ //Dns IP + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DnsIpTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); + }else{ + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllTemplate.class, 2); excel.setDataList(this.getMsgProp(),classList,null). write(request,response, fileName).dispose(); } - //district类模板 - if(regionDict.getRegionType().equals(3)){ - if(regionDict.getFunctionId().equals(7)){//DNS DISTRICT STRING - List classList=new ArrayList(); - ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllTemplate.class, 2); - excel.setDataList(this.getMsgProp(),classList,null). - write(request,response, fileName).dispose(); - }else{ - List classList=new ArrayList(); - ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, ComplexStringAllTemplate.class, 2); - excel.setDataList(this.getMsgProp(),classList,null). - write(request,response, fileName).dispose(); - } + } + //str类模板 + if(regionDict.getRegionType().equals(2)){ + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); + } + //district类模板 + if(regionDict.getRegionType().equals(3)){ + if(regionDict.getFunctionId().equals(7)){//DNS DISTRICT STRING + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); + }else{ + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, ComplexStringAllTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); } + } } //ip配置导入 - @RequestMapping(value = "import", method=RequestMethod.POST) - public String importIp(RedirectAttributes redirectAttributes, - @RequestParam("files") MultipartFile[] files - ,Integer serviceDictId - ,Integer requestId - ,String regionDictIds) { - this._import(redirectAttributes, files,serviceDictId,regionDictIds,requestId); - - return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+5; - } + @RequestMapping(value = "import", method=RequestMethod.POST) + public String importIp(RedirectAttributes redirectAttributes, + @RequestParam("files") MultipartFile[] files + ,Integer serviceDictId + ,Integer requestId + ,String regionDictIds + ,String importPath) { + this._import(redirectAttributes, files,serviceDictId,regionDictIds,requestId); + return "redirect:" + adminPath+ importPath; + } //ip配置导出 @RequestMapping(value = "exportIpAddr") public void exportIp(Model model,HttpServletRequest request,HttpServletResponse response, diff --git a/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml b/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml index 49996a435..a7e1d8644 100644 --- a/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml +++ b/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml @@ -23,12 +23,13 @@ + dict_id, function_id, config_region_value,config_region_code, config_district, config_desc, is_valid,is_maat,region_type ,config_multi_keywords,config_hex,config_expr_type,config_match_method,config_service_type,config_ip_port_show,config_ip_type, - config_ip_pattern,config_port_pattern,config_direction,config_protocol,config_region_sort + config_ip_pattern,config_port_pattern,config_direction,config_protocol,config_region_sort,is_import select diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 966ed1d0e..baf7b777b 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -780,7 +780,7 @@ intra=Inbound #=============about Maintenance========= #=============some validation=========== line=line %s -can_not_null=%sCan't be empty +can_not_null=%s can't be empty is_incorrect=%s value is incorrect are_the_same=%s and %s can't be equal is_in_wrong_format=%s formatting error diff --git a/src/main/resources/sql/20181019/alert_service_region_dict_table.sql b/src/main/resources/sql/20181019/alert_service_region_dict_table.sql new file mode 100644 index 000000000..cd3581205 --- /dev/null +++ b/src/main/resources/sql/20181019/alert_service_region_dict_table.sql @@ -0,0 +1,2 @@ +ALTER TABLE function_region_dict ADD is_import int(2) DEFAULT 0 COMMENT '域是否是否支持导出'; +ALTER TABLE function_service_dict ADD is_import int(2) DEFAULT 0 COMMENT '业务是否支持导出'; \ No newline at end of file diff --git a/src/main/resources/sql/20181019/alert_table_website_domain_topic.sql b/src/main/resources/sql/20181019/alert_table_website_domain_topic.sql new file mode 100644 index 000000000..0387b18d8 --- /dev/null +++ b/src/main/resources/sql/20181019/alert_table_website_domain_topic.sql @@ -0,0 +1,2 @@ +#域名修改长度为1024 +ALTER TABLE website_domain_topic MODIFY domain VARCHAR(1024); \ No newline at end of file diff --git a/src/main/resources/sql/20181019/import_service_region_Set.sql b/src/main/resources/sql/20181019/import_service_region_Set.sql new file mode 100644 index 000000000..b27bf5290 --- /dev/null +++ b/src/main/resources/sql/20181019/import_service_region_Set.sql @@ -0,0 +1,33 @@ +#ip addr +update function_service_dict set is_import=1 where function_id=5 and is_valid=1 and dict_id in(23,24,25,108); +update function_region_dict set is_import=1 where function_id=5 and is_valid=1 and dict_id in(27,35,228); +#basic +update function_service_dict set is_import=1 where function_id=407 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=407 and is_valid=1 and dict_id in(107); +#tunnel +update function_service_dict set is_import=1 where function_id=408 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=408 and is_valid=1 and dict_id in(157); +#ip payload +update function_service_dict set is_import=1 where function_id=212 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=212 and is_valid=1 and dict_id in(230); +#app +update function_service_dict set is_import=1 where function_id=63 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=63 and is_valid=1 and dict_id in(78); +#dns +update function_service_dict set is_import=1 where function_id=7 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=7 and is_valid=1 and dict_id in(28,29); +#url +update function_service_dict set is_import=1 where function_id=6 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=6 and is_valid=1 ; +#url advanced +update function_service_dict set is_import=1 where function_id=8 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=8 and is_valid=1 and dict_id in(9,10,11,12,13,14); +#mail +update function_service_dict set is_import=1 where function_id=37 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=37 and is_valid=1 and dict_id in(599); +#mail advanced +update function_service_dict set is_import=1 where function_id=35 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=35 and is_valid=1 and dict_id in(30,31,33); +#ftp +update function_service_dict set is_import=1 where function_id=51 and is_valid=1 ; +update function_region_dict set is_import=1 where function_id=51 and is_valid=1 and dict_id in(36,37,38); \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/excel/importModal.jsp b/src/main/webapp/WEB-INF/include/excel/importModal.jsp index c1250720e..b0cca3eb3 100644 --- a/src/main/webapp/WEB-INF/include/excel/importModal.jsp +++ b/src/main/webapp/WEB-INF/include/excel/importModal.jsp @@ -1,12 +1,8 @@ <%@ page contentType="text/html;charset=UTF-8"%> <%@ include file="/WEB-INF/include/taglib.jsp"%> - + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp index a00ef0c6d..81ed43cc6 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp @@ -165,7 +165,7 @@ $(function(){ selected>${_district } - +
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp index b472b80b8..10a2bf0d0 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp @@ -164,7 +164,7 @@ $(function(){ selected>${dict.itemValue } - +
diff --git a/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp index 6902e84a6..e3af30bb6 100644 --- a/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp @@ -41,7 +41,7 @@ selected>${_district } - +
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp index fd9bbeed8..f8b1ceb56 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp @@ -99,6 +99,11 @@ onClick="javascript:window.location='${ctx}/proxy/intercept/intercept${interceptType}Form?functionId=${cfg.functionId}'"> + + + @@ -531,6 +536,8 @@ - + + + <%@include file="/WEB-INF/include/excel/importModal.jsp" %> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp index d17c98064..cd3c74b11 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp @@ -85,8 +85,6 @@
- - <%@include file="/WEB-INF/include/excel/importModal.jsp" %>
- + + +<%@include file="/WEB-INF/include/excel/importModal.jsp" %> \ No newline at end of file diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 0a1814252..8646b311a 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -2,6 +2,7 @@ $(function(){ //增加描述新增时的文字长度限制 $("form input[name='cfgDesc']").attr("maxlength","128"); $("form input[name$='cfgKeywords']").attr("maxlength","1024"); + $("form input[class~='domainCheck']").attr("maxlength","1024"); //截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb $("#contentTable").not(".logTb").find("td").each(function(i){ //获取td当前对象的文本,如果长度大于25; diff --git a/src/main/webapp/static/pages/scripts/importExcel.js b/src/main/webapp/static/pages/scripts/importExcel.js index 795a5ed03..b0c3c7aff 100644 --- a/src/main/webapp/static/pages/scripts/importExcel.js +++ b/src/main/webapp/static/pages/scripts/importExcel.js @@ -7,12 +7,30 @@ $(function(){ show:true }); }); + $("#appIdId").on("change",function(){ + ajaxBehaviour($(this).val()); + }); + switchService(); $("input[name='serviceDictId']").click(function(){ + switchService(); }); $("input[name='regionDictIds']").click(function(){ }); }); - +/** + * action动作切换 + */ +function switchService(){ + var functionId=$("#functionId").val(); + if(functionId==5){//IP配置特殊处理 + var cfgRegionCodeS=$("input[name='serviceDictId']:checked").attr("cfgRegionCodeS"); + var cfgRegionCode=cfgRegionCodeS.split(",")[0]; + $("input[name='regionDictIds'][cfgregioncoder!='"+cfgRegionCode+"']").prop("checked",false); + $("input[name='regionDictIds'][cfgRegionCodeR!='"+cfgRegionCode+"']").parents(".radio-inline").addClass("hidden"); + $("input[name='regionDictIds'][cfgRegionCodeR='"+cfgRegionCode+"']").prop("checked",true); + $("input[name='regionDictIds'][cfgRegionCodeR='"+cfgRegionCode+"']").parents(".radio-inline").removeClass("hidden"); + } +} /** * 模板下载 * TODO 后期修改为传入regionDictId @@ -27,3 +45,46 @@ function downLoadTemplate(path){ document.location.href = path+'/ntc/iplist/import/template?' + params; } + + +var ajaxBehaviour=function(val){ + var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.indexOf("/nis")+4); + var request=$.ajax({ + type:'post', + url:pathName+'/specific/specificServiceCfg/childrenList', + data:{"parent":val}, + dataType:'json', + async:true, + success:function(data,textStatus){//处理返回结果 + if(textStatus=="success"){ + var html=''; + $("#behaviorId").html(html); + $("[name='behaviorId']").selectpicker("refresh"); + $("[name='behaviorId']").selectpicker("render"); + }else{ + html+=''; + $("#behaviorId").html(html); + $("[name='behaviorId']").selectpicker("refresh"); + $("[name='behaviorId']").selectpicker("render"); + } + + } + }, + complete:function(XMLHttpRequest,status){//超时设置 + if(status=="timeout"){ + var html=''; + $("#behaviorId").html(html); + $("[name='behaviorId']").selectpicker("refresh"); + $("[name='behaviorId']").selectpicker("render"); + } + } + }); +}