单域配置调整
(1)简化逻辑部分代码写到了BaseController里 (2)字符串,增强字符串配置的区域GK提交 (3)单域配置的审核部分目前不会下发area_ip_cfg给maat,后续会调整
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(".glyphicon-plus").on("click",function(){
|
||||
var obj=$(this).parents(".form-section").next(".container").clone();
|
||||
var len=$(this).parents("div").find(".container:visible").size();
|
||||
var obj=$(this).parents(".form-section").next(".container-fluid").clone();
|
||||
var len=$(this).parents("div").find(".container-fluid:visible").size();
|
||||
if($(this).parent().parent().parent().attr("id")=="areaIp"){
|
||||
obj.find("[id^='_areaCfg']").each(function(){
|
||||
var name=$(this).attr("id").replace("_areaCfg.","");
|
||||
@@ -18,7 +18,7 @@ $(function(){
|
||||
switchIpType($(this));
|
||||
});
|
||||
obj.appendTo("#areaIp");
|
||||
$("#areaIsp").find(".container").each(function(){
|
||||
$("#areaIsp").find(".container-fluid").each(function(){
|
||||
if(!$(this).hasClass("hidden")) $(this).remove();
|
||||
});
|
||||
}else if($(this).parent().parent().parent().attr("id")=="areaIsp"){
|
||||
@@ -33,7 +33,7 @@ $(function(){
|
||||
});
|
||||
obj.removeClass("hidden");
|
||||
obj.appendTo("#areaIsp");
|
||||
$("#areaIp").find(".container").each(function(){
|
||||
$("#areaIp").find(".container-fluid").each(function(){
|
||||
if(!$(this).hasClass("hidden")) $(this).remove();
|
||||
});
|
||||
}
|
||||
@@ -41,12 +41,12 @@ $(function(){
|
||||
});
|
||||
function delAreaIp(obj){
|
||||
var thisObj=$(obj);
|
||||
thisObj.parents(".container").remove();
|
||||
var len=$("#areaIp").find(".container:visible").size();
|
||||
thisObj.parents(".container-fluid").remove();
|
||||
var len=$("#areaIp").find(".container-fluid:visible").size();
|
||||
//调整角标
|
||||
if(len>0){
|
||||
len--;
|
||||
$("#areaIp").find(".container:visible").each(function(){
|
||||
$("#areaIp").find(".container-fluid:visible").each(function(){
|
||||
$(this).find("[name^='areaCfg']").each(function(){
|
||||
var name=$(this).attr("name");
|
||||
name=name.substring(name.lastIndexOf(".")+1,name.length);
|
||||
@@ -59,11 +59,11 @@ function delAreaIp(obj){
|
||||
}
|
||||
function delAreaIsp(obj){
|
||||
var thisObj=$(obj);
|
||||
thisObj.parents(".container").remove();
|
||||
var len=$("#areaIsp").find(".container:visible").size();
|
||||
thisObj.parents(".container-fluid").remove();
|
||||
var len=$("#areaIsp").find(".container-fluid:visible").size();
|
||||
if(len>0){
|
||||
len--;
|
||||
$("#areaIsp").find(".container:visible").each(function(){
|
||||
$("#areaIsp").find(".container-fluid:visible").each(function(){
|
||||
$(this).find("[name^='areaIsp']").each(function(){
|
||||
var name=$(this).attr("name");
|
||||
name=name.substring(name.lastIndexOf(".")+1,name.length);
|
||||
@@ -77,10 +77,10 @@ function delAreaIsp(obj){
|
||||
</script>
|
||||
<div class="hidden" id="areaIsp">
|
||||
<h4 class="form-section"><spring:message code="area"/> <spring:message code="isp"/><small><span class="glyphicon glyphicon-plus" title="add"></span></small></h4>
|
||||
<div class="container hidden">
|
||||
<div class="container-fluid hidden">
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<span class="glyphicon glyphicon-remove" title="remove" onClick="delAreaIsp(this);"/>
|
||||
<span class="glyphicon glyphicon-remove pull-right" title="remove" onClick="delAreaIsp(this);"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -114,7 +114,7 @@ function delAreaIsp(obj){
|
||||
</div>
|
||||
</div>
|
||||
<c:forEach items="${_areaIsps}" var="areaIsp" varStatus="status">
|
||||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<span class="glyphicon glyphicon-remove" title="remove" onClick="delAreaIsp(this);"/>
|
||||
@@ -159,7 +159,7 @@ function delAreaIsp(obj){
|
||||
</div>
|
||||
<div class="hidden" id="areaIp">
|
||||
<h4 class="form-section"><spring:message code="area"/> ip<small><span class="glyphicon glyphicon-plus" title="add"></span></small></h4>
|
||||
<div class="container hidden">
|
||||
<div class="container-fluid hidden">
|
||||
<div class="row">
|
||||
<input type="hidden" id="_areaCfg.isAreaEffective" value="${_areaCfg.isAreaEffective}">
|
||||
<div class="pull-right">
|
||||
@@ -303,7 +303,7 @@ function delAreaIsp(obj){
|
||||
</div>
|
||||
<input type="hidden" name="areaCfgIds" value="${areaCfgIds}">
|
||||
<c:forEach items="${areaCfgs}" var ="areaCfg" varStatus="status">
|
||||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<input type="hidden" name="areaCfg[${status.index}].isAreaEffective" value="${areaCfg.isAreaEffective}">
|
||||
<div class="pull-right">
|
||||
|
||||
@@ -106,12 +106,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><spring:message code="area_effect_id"></spring:message></label>
|
||||
<div class="hidden areaType col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="区域管控类型"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="areaEffectiveIds" value="${_cfg.areaEffectiveIds}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="areaType" value="1" class="required"><spring:message code="area"/> <spring:message code="isp"/>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="areaType" value="0" class="required"><spring:message code="area"/> ip
|
||||
</label>
|
||||
</div>
|
||||
<div for="areaType"></div>
|
||||
<input class="form-control" type="hidden" name="areaEffectiveIds" value="${_cfg.areaEffectiveIds}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -205,14 +205,14 @@
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="区域管控类型"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="areaType" value="1"><spring:message code="area"/> <spring:message code="isp"/>
|
||||
<input type="radio" name="areaType" value="1" class="required"><spring:message code="area"/> <spring:message code="isp"/>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="areaType" value="0"><spring:message code="area"/> ip
|
||||
<input type="radio" name="areaType" value="0" class="required"><spring:message code="area"/> ip
|
||||
</label>
|
||||
</div>
|
||||
<div for="areaType"></div>
|
||||
<input class="form-control" type="hidden" name="areaEffectiveIds" value="${_cfg.areaEffectiveIds}">
|
||||
<div for="areaEffectiveIds"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%-- <div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><spring:message code="area_effect_id"></spring:message></label>
|
||||
<div class="col-md-6">
|
||||
@@ -112,6 +112,21 @@
|
||||
</div>
|
||||
<div for="areaEffectiveIds"></div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<div class="hidden areaType col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="区域管控类型"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="areaType" value="1" class="required"><spring:message code="area"/> <spring:message code="isp"/>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="areaType" value="0" class="required"><spring:message code="area"/> ip
|
||||
</label>
|
||||
</div>
|
||||
<div for="areaType"></div>
|
||||
<input class="form-control" type="hidden" name="areaEffectiveIds" value="${_cfg.areaEffectiveIds}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:otherwise>
|
||||
|
||||
@@ -5,9 +5,40 @@
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#save").on("click",function(){
|
||||
$("#cfgFrom").attr("action","${ctx}/cfg/complex/saveOrUpdateCfg");
|
||||
$("#save").submit();
|
||||
switchIpType($("select[name$='ipType']"));
|
||||
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();
|
||||
@@ -51,7 +82,7 @@ $(function(){
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="#" method="post" class="form-horizontal">
|
||||
<form id="cfgFrom" action="${ctx}/cfg/complex/saveOrUpdateCfg" method="post" class="form-horizontal">
|
||||
<div class="form-body">
|
||||
<%@include file="/WEB-INF/include/form/complexInfo.jsp" %>
|
||||
<c:if test="${not empty _cfg.cfgId}">
|
||||
@@ -68,6 +99,7 @@ $(function(){
|
||||
<input type="hidden" name="district" value="${_cfg.district}">
|
||||
<c:choose>
|
||||
<c:when test="${action!=5 and action!=8}">
|
||||
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
|
||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
||||
@@ -7,20 +7,7 @@
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
switchIpType($("select[name$='ipType']"));
|
||||
if($("input[name='isAreaEffective']:checked").val()==1){
|
||||
$(".areaType").removeClass("hidden");
|
||||
if($("input[name='areaEffectiveIds']").val()){
|
||||
$(".areaType").find("[value='1']").prop("checked",true);
|
||||
$("#areaIsp").removeClass("hidden");
|
||||
$("#areaIp").addClass("hidden");
|
||||
}else{
|
||||
$(".areaType").find("[value='0']").prop("checked",true);
|
||||
$("#areaIp").removeClass("hidden");
|
||||
$("#areaIsp").addClass("hidden");
|
||||
}
|
||||
}else{
|
||||
$("input[name='areaEffectiveIds']").val("");
|
||||
}
|
||||
areaControlInit();
|
||||
$("input[name='isAreaEffective']").on('change',function(){
|
||||
var val=$(this).val();
|
||||
if(val==1){
|
||||
@@ -51,17 +38,12 @@ $(function(){
|
||||
$("#areaIp").addClass("hidden");
|
||||
}
|
||||
});
|
||||
$("#save").on("click",function(){
|
||||
$("#ipCfgFrom").attr("action","${ctx}/cfg/ip/saveOrUpdateCfg");
|
||||
$("#save").submit();
|
||||
});
|
||||
$("#cancel").on("click",function(){
|
||||
window.history.back();
|
||||
});
|
||||
$("select[name$='ipType']").on("change",function(){
|
||||
switchIpType($(this));
|
||||
});
|
||||
|
||||
$("#ipCfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
@@ -92,7 +74,7 @@ $(function(){
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="ipCfgFrom" action="#" method="post" class="form-horizontal">
|
||||
<form id="ipCfgFrom" action="${ctx}/cfg/ip/saveOrUpdateCfg" method="post" class="form-horizontal">
|
||||
<div class="form-body">
|
||||
<%@include file="/WEB-INF/include/form/ipInfo.jsp" %>
|
||||
<c:if test="${not empty _cfg.cfgId}">
|
||||
|
||||
@@ -5,6 +5,38 @@
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
switchIpType($("select[name$='ipType']"));
|
||||
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");
|
||||
}
|
||||
});
|
||||
$("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");
|
||||
}
|
||||
});
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
@@ -15,10 +47,9 @@ $(function(){
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
$("#save").on("click",function(){
|
||||
$("#cfgFrom").attr("action","${ctx}/cfg/string/saveOrUpdateCfg");
|
||||
$("#save").submit();
|
||||
});
|
||||
$("select[name$='ipType']").on("change",function(){
|
||||
switchIpType($(this));
|
||||
});
|
||||
$("#cancel").on("click",function(){
|
||||
window.history.back();
|
||||
});
|
||||
@@ -51,7 +82,7 @@ $(function(){
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="#" method="post" class="form-horizontal">
|
||||
<form id="cfgFrom" action="${ctx}/cfg/string/saveOrUpdateCfg" method="post" class="form-horizontal">
|
||||
<div class="form-body">
|
||||
<%@include file="/WEB-INF/include/form/stringInfo.jsp" %>
|
||||
<c:if test="${not empty _cfg.cfgId}">
|
||||
|
||||
@@ -65,4 +65,20 @@ var switchIpType=function(obj){
|
||||
$(dstIp).val("::");
|
||||
}
|
||||
}
|
||||
}
|
||||
var areaControlInit=function(){
|
||||
if($("input[name='isAreaEffective']:checked").val()==1){
|
||||
$(".areaType").removeClass("hidden");
|
||||
if($("input[name='areaEffectiveIds']").val()){
|
||||
$(".areaType").find("[value='1']").prop("checked",true);
|
||||
$("#areaIsp").removeClass("hidden");
|
||||
$("#areaIp").addClass("hidden");
|
||||
}else{
|
||||
$(".areaType").find("[value='0']").prop("checked",true);
|
||||
$("#areaIp").removeClass("hidden");
|
||||
$("#areaIsp").addClass("hidden");
|
||||
}
|
||||
}else{
|
||||
$("input[name='areaEffectiveIds']").val("");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user