Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
zhangwei
2018-05-31 09:33:41 +08:00
9 changed files with 225 additions and 205 deletions

View File

@@ -27,7 +27,6 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
private static final String tableName="cfg_index_info";
private List<AvVoipAccountCfg> voipAccounts;//Add表单使用
private List<AvVoipIpCfg> voipIps; //Add表单使用
private AreaIpCfg areaIpCfg;
private AvVoipAccountCfg voipAccount;//Search使用
private AvVoipIpCfg voipIp;//Search使用
private IpPortCfg ipPort;
@@ -143,11 +142,5 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
public static String getTablename() {
return tableName;
}
public AreaIpCfg getAreaIpCfg() {
return areaIpCfg;
}
public void setAreaIpCfg(AreaIpCfg areaIpCfg) {
this.areaIpCfg = areaIpCfg;
}
}

View File

@@ -141,9 +141,12 @@ public class AvContentController extends BaseController {
@RequestMapping(value = {"/contentIpForm"})
public String contIpForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")AvContIpCfg cfg){
if(!StringUtil.isEmpty(ids)){
cfg.setCfgId(Long.parseLong(ids));
cfg = avContentCfgService.getContIpCfgById(cfg);
}
initUpdateFormCondition(model, cfg);
}else{
initFormCondition(model,cfg);
}
model.addAttribute("_cfg", cfg);
return "/cfg/av/contIp/contIpForm";
}
@@ -151,9 +154,10 @@ public class AvContentController extends BaseController {
//保存voip信息
@RequestMapping(value = {"/saveContIp"})
public String saveContIp(Model model,HttpServletRequest request,HttpServletResponse response,
@ModelAttribute("cfg")AvContIpCfg cfg){
@ModelAttribute("cfg")AvContIpCfg cfg,
@ModelAttribute("areaCfgIds")String areaCfgIds){
try{
avContentCfgService.saveOrUpdateAvContIp(cfg);
avContentCfgService.saveOrUpdateAvContIp(cfg,areaCfgIds);
addMessage(model,"save_success");
}catch(Exception e){
logger.error("信息保存失败",e);

View File

@@ -17,10 +17,9 @@ import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface AreaIpCfgDao extends CrudDao<AreaIpCfg>{
public List<AreaIpCfg> getByCompileId(@Param("compileId") int compileId) ;
public List<AreaIpCfg> findAreaIpCfgList(CfgIndexInfo entity);
public void saveAreaIpCfg(AreaIpCfg entity);
public void saveAreaIpCfgFromCfgIndexInfo(CfgIndexInfo entity);
public void updateAreaIpCfgFromCfgIndexInfo(CfgIndexInfo entity);
public void updateAreaIpCfg(AreaIpCfg entity);
public void updateAreaIpCfgValid(AreaIpCfg entity);
public void deleteAreaIpCfg(AreaIpCfg entity);
public void deleteAreaIpCfgByCfgId(CfgIndexInfo entity);
public void deleteAreaIpCfgByCfgId(AreaIpCfg entity);
}

View File

@@ -52,26 +52,6 @@
</if>
AND IS_VALID!=-1
</trim>
</select>
<!-- 根据compileId获取avVoipAccountCfg信息 -->
<select id="findAreaIpCfgList" resultMap="BaseIpMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
select
<include refid="AreaIpCfg_Column_List_with_id" />
from area_ip_cfg r
<where>
<if test="compileId != null">
and r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<choose>
<when test="isValid != null">
and r.is_valid=#{isValid,jdbcType=INTEGER}
</when>
<otherwise>
and r.is_valid != -1
</otherwise>
</choose>
</where>
</select>
<!-- insert area_ip_cfg表信息 -->
<insert id="saveAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
@@ -141,76 +121,9 @@
#{cfgRegionCode,jdbcType=INTEGER}
)
</insert>
<!-- insert area_ip_cfg表信息 -->
<insert id="saveAreaIpCfgFromCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
insert into area_ip_cfg (
CFG_DESC,
ACTION,
IS_VALID,
IS_AUDIT,
CREATOR_ID,
CREATE_TIME,
EDITOR_ID,
EDIT_TIME,
AUDITOR_ID,
AUDIT_TIME,
SERVICE_ID,
REQUEST_ID,
COMPILE_ID,
IS_AREA_EFFECTIVE,
CLASSIFY,
ATTRIBUTE,
LABLE,
AREA_EFFECTIVE_IDS,
function_id,
ip_type,
src_ip_address,
ip_pattern,
port_pattern,
src_port,
protocol,
protocol_id,
direction,
dest_port,
dest_ip_address,
cfg_type,
cfg_region_code
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
0,
0,
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},
#{auditTime,jdbcType=TIMESTAMP},
#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},
#{compileId,jdbcType=INTEGER},
#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER},
#{areaIpCfg.ipType,jdbcType=INTEGER},
#{areaIpCfg.srcIpAddress,jdbcType=VARCHAR},
#{areaIpCfg.ipPattern,jdbcType=INTEGER},
#{areaIpCfg.portPattern,jdbcType=INTEGER},
#{areaIpCfg.srcPort,jdbcType=VARCHAR},
#{areaIpCfg.protocol,jdbcType=INTEGER},
#{areaIpCfg.protocolId,jdbcType=INTEGER},
#{areaIpCfg.direction,jdbcType=INTEGER},
#{areaIpCfg.destPort,jdbcType=VARCHAR},
#{areaIpCfg.destIpAddress,jdbcType=VARCHAR},
#{areaIpCfg.cfgType,jdbcType=VARCHAR},
#{areaIpCfg.cfgRegionCode,jdbcType=INTEGER}
)
</insert>
<!-- update av_voip_ip_cfg表信息 -->
<update id="updateAreaIpCfgFromCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
<update id="updateAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
update area_ip_cfg
<set >
<trim suffixOverrides=",">
@@ -265,47 +178,47 @@
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.ipType != null" >
ip_type = #{areaIpCfg.ipType,jdbcType=INTEGER},
<if test="ipType != null" >
ip_type = #{ipType,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.srcIpAddress != null and areaIpCfg.srcIpAddress != ''" >
src_ip_address = #{areaIpCfg.srcIpAddress,jdbcType=VARCHAR},
<if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.ipPattern != null" >
ip_pattern = #{areaIpCfg.ipPattern,jdbcType=INTEGER},
<if test="ipPattern != null" >
ip_pattern = #{ipPattern,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.portPattern != null" >
port_pattern = #{areaIpCfg.portPattern,jdbcType=INTEGER},
<if test="portPattern != null" >
port_pattern = #{portPattern,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.srcPort != null and areaIpCfg.srcPort != ''" >
src_port = #{areaIpCfg.srcPort,jdbcType=VARCHAR},
<if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.protocol != null" >
protocol = #{areaIpCfg.protocol,jdbcType=INTEGER},
<if test="protocol != null" >
protocol = #{protocol,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.protocolId != null" >
protocol_id = #{areaIpCfg.protocolId,jdbcType=INTEGER},
<if test="protocolId != null" >
protocol_id = #{protocolId,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.direction != null" >
direction = #{areaIpCfg.direction,jdbcType=INTEGER},
<if test="direction != null" >
direction = #{direction,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.destPort != null and areaIpCfg.destPort != ''" >
dest_port = #{areaIpCfg.destPort,jdbcType=VARCHAR},
<if test="destPort != null and destPort != ''" >
dest_port = #{destPort,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.destIpAddress != null and areaIpCfg.destIpAddress != ''" >
dest_ip_address = #{areaIpCfg.destIpAddress,jdbcType=VARCHAR},
<if test="destIpAddress != null and destIpAddress != ''" >
dest_ip_address = #{destIpAddress,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.cfgType != null and areaIpCfg.cfgType != ''" >
cfg_type = #{areaIpCfg.cfgType,jdbcType=VARCHAR},
<if test="cfgType != null and cfgType != ''" >
cfg_type = #{cfgType,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.cfgRegionCode != null " >
cfg_region_code = #{areaIpCfg.cfgRegionCode,jdbcType=INTEGER},
<if test="cfgRegionCode != null " >
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
</if>
</trim>
</set>
<where>
<if test="areaIpCfg != null and areaIpCfg.cfgId != null" >
and cfg_id = #{areaIpCfg.cfgId,jdbcType=INTEGER}
<if test="cfgId != null" >
and cfg_id = #{cfgId,jdbcType=INTEGER}
</if>
<if test="compileId != null" >
and compile_id = #{compileId,jdbcType=INTEGER}
@@ -319,20 +232,23 @@
<delete id="deleteAreaIpCfg" >
delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<update id="updateAreaIpCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
update area_ip_cfg set is_valid = #{isValid,jdbcType=INTEGER},
editor_id = #{editorId,jdbcType=INTEGER} ,
edit_time = #{editTime,jdbcType=TIMESTAMP}
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="cfgId !=null ">
AND cfg_id = #{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId !=null ">
AND compile_id = #{compileId,jdbcType=INTEGER}
</if>
and function_id=#{functionId,jdbcType=INTEGER}
</trim>
</update>
<!-- 删除区域IP配置 -->
<!-- 删除voipIp信息 -->
<delete id="deleteAreaIpCfgByCfgId" parameterType="com.nis.domain.configuration.AreaIpCfg" >
delete from area_ip_cfg
<where>
<if test="areaIpCfg != null and areaIpCfg.cfgId != null" >
and cfg_id = #{areaIpCfg.cfgId,jdbcType=INTEGER}
</if>
<if test="compileId != null" >
and compile_id = #{compileId,jdbcType=INTEGER}
</if>
<if test="functionId != null" >
and function_id = #{functionId,jdbcType=INTEGER}
</if>
</where>
delete from area_ip_cfg where cfg_id = #{cfgId,jdbcType=INTEGER}
</delete>
</mapper>

View File

@@ -31,7 +31,7 @@ public interface AvContentCfgDao {
public void updateAvVoipAccount(CfgIndexInfo entity);
public void deleteAvVoipIp(CfgIndexInfo entity);
public void deleteAvVoipAccount(CfgIndexInfo entity);
public AvContIpCfg findVoipIpCfgById(AvContIpCfg entity) ;
public AvContIpCfg findContIpCfgById(AvContIpCfg entity) ;
public void insertAvContIp(AvContIpCfg entity);
public void updateAvContIp(AvContIpCfg entity);
}

View File

@@ -177,8 +177,8 @@ public class AvContentCfgService extends BaseService{
//保存区域IP信息
if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
entity.setAreaIpCfg(areaIpCfg);
areaIpCfgDao.saveAreaIpCfgFromCfgIndexInfo(entity);
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
//保存cfgIndexInfo
@@ -247,14 +247,14 @@ public class AvContentCfgService extends BaseService{
//修改
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
entity.setAreaIpCfg(areaIpCfg);
areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity);
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
}else{
//新增
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
entity.setAreaIpCfg(areaIpCfg);
areaIpCfgDao.saveAreaIpCfgFromCfgIndexInfo(entity);
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
}
@@ -288,8 +288,7 @@ public class AvContentCfgService extends BaseService{
CfgIndexInfo cfg=new CfgIndexInfo();
AreaIpCfg areaIpCfg=new AreaIpCfg();
areaIpCfg.setCfgId(Long.parseLong(cfgId));
cfg.setAreaIpCfg(areaIpCfg);
areaIpCfgDao.deleteAreaIpCfgByCfgId(cfg);
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
}
}
@@ -319,7 +318,9 @@ public class AvContentCfgService extends BaseService{
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg);
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
}
}
/**
@@ -351,11 +352,13 @@ public class AvContentCfgService extends BaseService{
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
voipIpList=avContentCfgDao.findVoipIpCfgList(entity);
voipAccountList=avContentCfgDao.findVoipAccountCfgList(entity);
areaIpCfgList=areaIpCfgDao.findAreaIpCfgList(entity);
areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
@@ -455,11 +458,37 @@ public class AvContentCfgService extends BaseService{
* @return
*/
public AvContIpCfg getContIpCfgById(AvContIpCfg entity) {
return avContentCfgDao.findVoipIpCfgById(entity);
return avContentCfgDao.findContIpCfgById(entity);
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAvContIp(AvContIpCfg entity){
public void saveOrUpdateAvContIp(AvContIpCfg entity,String areaCfgIds){
Date createTime=new Date();
//区域IPsetAreaEffectiveIds设置
List<AreaIpCfg> areaCfg=entity.getAreaCfg();
List<AreaBean> areaIsps=entity.getAreaIsp();
if(Constants.IS_AREA_EFFECTIVE_NO==entity.getIsAreaEffective()){
entity.setAreaEffectiveIds("");
entity.setAreaType(null);
}else if(Constants.IS_AREA_EFFECTIVE_YES==entity.getIsAreaEffective()){
if(Constants.AREA_EFFECTIVE_TYPE_AREA_ISP==entity.getAreaType()&&areaIsps!=null&&areaIsps.size()>0){
StringBuffer areaEffectiveIds=new StringBuffer();
for(int i=0;i<areaIsps.size();i++){
if(StringUtils.isNotBlank(areaIsps.get(i).getIsp())){
areaEffectiveIds.append(areaIsps.get(i).getArea()+":"+areaIsps.get(i).getIsp());
}else{
areaEffectiveIds.append(areaIsps.get(i).getArea());
}
if(i!=areaIsps.size()-1){
areaEffectiveIds.append(",");
}
}
entity.setAreaEffectiveIds(areaEffectiveIds.toString());
}else if(Constants.AREA_EFFECTIVE_TYPE_AREA_IP==entity.getAreaType()&&areaCfg!=null&&areaCfg.size()>0){
entity.setAreaEffectiveIds("");
}
}
//新增
if(entity.getCfgId()==null){
entity.setCreatorId(UserUtils.getUser().getId());
@@ -470,7 +499,6 @@ public class AvContentCfgService extends BaseService{
List<Integer> compileIds = new ArrayList<Integer>();
try {
compileIds = ConfigServiceUtil.getId(1,1);
//compileIds.add((int)Math.floor(Math.random()*1000000+1));
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
@@ -478,6 +506,15 @@ public class AvContentCfgService extends BaseService{
}
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
entity.setCompileId(compileIds.get(0));
//保存区域IP信息
if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
//保存cfgIndexInfo
avContentCfgDao.insertAvContIp(entity);
}else{
@@ -489,6 +526,39 @@ public class AvContentCfgService extends BaseService{
Date editTime=new Date();
entity.setIsValid(0);
entity.setIsAudit(0);
areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:"";
if(!StringUtil.isEmpty(entity.getAreaCfg())){
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
if(!StringUtil.isEmpty(areaIpCfg.getCfgId())){
if(areaCfgIds.contains(","+areaIpCfg.getCfgId()+",")){
areaCfgIds=areaCfgIds.replace(areaIpCfg.getCfgId()+",", "");
}
//修改
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
}else{
//新增
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
}
//delete 真是删除areaIpCfg信息
if(!StringUtil.isEmpty(areaCfgIds.replaceAll(",", ""))){
areaCfgIds=areaCfgIds.substring(1,areaCfgIds.length());
for (String cfgId : areaCfgIds.split(",")) {
AreaIpCfg areaIpCfg=new AreaIpCfg();
areaIpCfg.setCfgId(Long.parseLong(cfgId));
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
}
}
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
avContentCfgDao.updateAvContIp(entity);

View File

@@ -5,40 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
areaControlInit();
$("input[name='isAreaEffective']").on('change',function(){
var val=$(this).val();
if(val==1){
$(".areaType").removeClass("hidden");
if($("input[name='areaType']:checked").val()==1){//areaISP
$("#areaIsp").removeClass("hidden");
}else if($("input[name='areaType']:checked").val()==0){//areaIp
$("#areaIp").removeClass("hidden");
}
}else{
$(".areaType").addClass("hidden");
$("#areaIp").addClass("hidden");
$("#areaIsp").addClass("hidden");
}
});
$("select[name$='ipType']").on("change",function(){
switchIpType($(this));
});
$("input[name='areaType']").on('change',function(){
var val=$(this).val();
if($(this).is(":visible")){
if(val==0){
$("#areaIp").removeClass("hidden");
$("#areaIsp").addClass("hidden");
}else{
$("#areaIsp").removeClass("hidden");
$("#areaIp").addClass("hidden");
}
}else{
$("#areaIsp").addClass("hidden");
$("#areaIp").addClass("hidden");
}
});
$("#cancel").on("click",function(){
window.history.back();
});
@@ -123,7 +89,7 @@ $(function(){
</div>
<!-- desc and action -->
<%@include file="/WEB-INF/include/form/ipInfo.jsp" %>
<%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> --%>
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<input type="hidden" name="isAreaEffective" value="0">
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div>

View File

@@ -117,7 +117,7 @@
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<shiro:hasPermission name="avContIp:config">
<shiro:hasPermission name="avContentIp:config">
<sys:delRow url="${ctx}/ntc/av/contentIpForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/ntc/av/updateAvContIpValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>

View File

@@ -71,59 +71,131 @@ $(function(){
if($(this).is(":visible")){
if(val==0){
$("#areaIp").removeClass("hidden");
/*$("#areaIsp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
$(this).attr("disabled","true");
});*/
$("#areaIsp").addClass("hidden");
if($("#areaIp").find(".container-fluid:visible").size() <1){
$("#areaIp").find(".glyphicon-plus").click();
}
/*$("#areaIp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
$("#areaIp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).removeAttr("disabled");
});*/
$(this).removeClass("disabled");
})
});
$("#areaIsp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
}else{
$("#areaIsp").removeClass("hidden");
/*$("#areaIp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
$(this).attr("disabled","true");
});*/
$("#areaIp").addClass("hidden");
if($("#areaIsp").find(".container-fluid:visible").size() <1){
$("#areaIsp").find(".glyphicon-plus").click();
}
/*$("#areaIsp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
$("#areaIsp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).removeAttr("disabled");
});*/
$(this).removeClass("disabled");
})
});
$("#areaIp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
}
}else{
$("#areaIsp").addClass("hidden");
$("#areaIp").addClass("hidden");
$("#areaIsp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
$("#areaIp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
}
});
$("input[name='isAreaEffective']").on('change',function(){
var val=$(this).val();
if(val==1){
$(".areaType").find("input,select,div,button").each(function(){
$(this).removeAttr("disabled");
$(this).removeClass("disabled");
});
$(".areaType").removeClass("hidden");
if($("input[name='areaType']:checked").val()==1){//areaISP
$("#areaIsp").removeClass("hidden");
if($("#areaIsp").find(".container-fluid:visible").size() <1){
$("#areaIsp").find(".glyphicon-plus").click();
}
$("#areaIsp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).removeAttr("disabled");
$(this).removeClass("disabled");
})
});
$("#areaIp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
}else if($("input[name='areaType']:checked").val()==0){//areaIp
$("#areaIp").removeClass("hidden");
if($("#areaIp").find(".container-fluid:visible").size() <1){
$("#areaIp").find(".glyphicon-plus").click();
}
$("#areaIp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).removeAttr("disabled");
$(this).removeClass("disabled");
})
});
$("#areaIsp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
}else{
$(".areaType").find("[value='1']").prop("checked",true);
$("#areaIsp").removeClass("hidden");
if($("#areaIsp").find(".container-fluid:visible").size() <1){
$("#areaIsp").find(".glyphicon-plus").click();
}
$("#areaIsp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).removeAttr("disabled");
$(this).removeClass("disabled");
})
});
$("#areaIp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
}
}else{
$(".areaType").addClass("hidden");
$("#areaIp").addClass("hidden");
$("#areaIsp").addClass("hidden");
$(".areaType").find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
});
$("#areaIsp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
$("#areaIp").find(".container-fluid").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","disabled");
})
});
}
});
areaControlInit();