修复匹配区域,分类在修改时不能正常选择的bug
This commit is contained in:
@@ -573,6 +573,8 @@ public class MultipleCfgController extends BaseController{
|
|||||||
this.setPropertiesToMultipleCfg(resultCfg, resultComplexCfg,"update");
|
this.setPropertiesToMultipleCfg(resultCfg, resultComplexCfg,"update");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List<SysDictInfo> districts=sysDictInfoService.getDistrictDict(tableName);
|
||||||
|
model.addAttribute("districts", districts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", resultCfg);
|
model.addAttribute("_cfg", resultCfg);
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearc
|
|||||||
should+=cfg.getIpCfg().size();
|
should+=cfg.getIpCfg().size();
|
||||||
}
|
}
|
||||||
int result=0;
|
int result=0;
|
||||||
if(cfg==null) return false;
|
|
||||||
if(Constants.AUDIT_YES==cfg.getIsAudit()||Constants.AUDIT_NOT_YES==cfg.getIsAudit()){
|
if(Constants.AUDIT_YES==cfg.getIsAudit()||Constants.AUDIT_NOT_YES==cfg.getIsAudit()){
|
||||||
List<BaseCfg> cfgs=new ArrayList<BaseCfg>();
|
List<BaseCfg> cfgs=new ArrayList<BaseCfg>();
|
||||||
if(sendCfg.getIpCfg()!=null){
|
if(sendCfg.getIpCfg()!=null){
|
||||||
|
|||||||
@@ -31,19 +31,13 @@
|
|||||||
<c:when test="${_cfg.classify==null or _cfg.classify==''}">
|
<c:when test="${_cfg.classify==null or _cfg.classify==''}">
|
||||||
<option value="${fl.serviceDictId}">${fl.itemValue}</option>
|
<option value="${fl.serviceDictId}">${fl.itemValue}</option>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:when test="${fn:contains(_cfg.classify,',')}">
|
<c:otherwise>
|
||||||
<option value="${fl.serviceDictId}"
|
<option value="${fl.serviceDictId}"
|
||||||
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify">
|
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify">
|
||||||
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
|
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
|
||||||
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
|
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
>${fl.itemValue}</option>
|
>${fl.itemValue}</option>
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<option value="${fl.serviceDictId}"
|
|
||||||
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
|
|
||||||
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
|
|
||||||
>${fl.itemValue}</option>
|
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
@@ -87,14 +87,18 @@
|
|||||||
<label class="radio-inline">
|
<label class="radio-inline">
|
||||||
<input type="radio" name="isAreaEffective" value="1"
|
<input type="radio" name="isAreaEffective" value="1"
|
||||||
<c:if test="${_cfg.isAreaEffective==1}">checked</c:if>
|
<c:if test="${_cfg.isAreaEffective==1}">checked</c:if>
|
||||||
|
<c:if test="${action==2}">disabled</c:if>
|
||||||
><spring:message code="yes"/>
|
><spring:message code="yes"/>
|
||||||
</label>
|
</label>
|
||||||
<label class="radio-inline">
|
<label class="radio-inline">
|
||||||
<input type="radio" name="isAreaEffective" value="0"
|
<input type="radio" name="isAreaEffective" value="0"
|
||||||
<c:if test="${_cfg.isAreaEffective==0}">checked</c:if>
|
<c:if test="${_cfg.isAreaEffective==0}">checked</c:if>
|
||||||
|
<c:if test="${action==2}">disabled</c:if>
|
||||||
><spring:message code="no"/>
|
><spring:message code="no"/>
|
||||||
</label>
|
</label>
|
||||||
<%-- <input class="form-control" type="text" name="isAreaEffective" value="${_cfg.isAreaEffective}"> --%>
|
<c:if test="${action==2}">
|
||||||
|
<input class="form-control" type="hidden" name="isAreaEffective" value="${_cfg.isAreaEffective}">
|
||||||
|
</c:if>
|
||||||
</div>
|
</div>
|
||||||
<div for="isAreaEffective"></div>
|
<div for="isAreaEffective"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,25 +53,18 @@
|
|||||||
<label class="control-label col-md-3"><spring:message code="type"/></label>
|
<label class="control-label col-md-3"><spring:message code="type"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="classify" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
|
<select name="classify" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
|
||||||
|
|
||||||
<c:forEach items="${fls}" var="fl">
|
<c:forEach items="${fls}" var="fl">
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${_cfg.classify==null or _cfg.classify==''}">
|
<c:when test="${_cfg.classify==null or _cfg.classify==''}">
|
||||||
<option value="${fl.serviceDictId}">${fl.itemValue}</option>
|
<option value="${fl.serviceDictId}">${fl.itemValue}</option>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:when test="${fn:contains(_cfg.classify,',')}">
|
<c:otherwise>
|
||||||
<option value="${fl.serviceDictId}"
|
<option value="${fl.serviceDictId}"
|
||||||
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify">
|
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify">
|
||||||
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
|
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
|
||||||
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
|
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
>${fl.itemValue}</option>
|
>${fl.itemValue}</option>
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<option value="${fl.serviceDictId}"
|
|
||||||
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
|
|
||||||
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
|
|
||||||
>${fl.itemValue}</option>
|
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
if(!$(".district").val()&&$(".otherValue").val()){
|
||||||
|
$(".district").find("option").each(function(){
|
||||||
|
var text=$(this).text().toLowerCase();
|
||||||
|
if("others"==text){
|
||||||
|
$(this).attr("selected","selected");
|
||||||
|
$(this).parent().siblings(".otherValue").prop("type","text");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
<h3 class="form-section">增强字符串<spring:message code="block_config"/><!-- <small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".complexCfg" title="add"></span></small> --></h3>
|
<h3 class="form-section">增强字符串<spring:message code="block_config"/><!-- <small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".complexCfg" title="add"></span></small> --></h3>
|
||||||
<div class="row complexCfg">
|
<div class="row complexCfg">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -26,7 +39,9 @@
|
|||||||
<select name="complexCfg[${mainTable}].district" class="district selectpicker select2 form-control">
|
<select name="complexCfg[${mainTable}].district" class="district selectpicker select2 form-control">
|
||||||
<option value=""><spring:message code='select'/></option>
|
<option value=""><spring:message code='select'/></option>
|
||||||
<c:forEach items="${districts}" var="district">
|
<c:forEach items="${districts}" var="district">
|
||||||
<option value="${district.itemValue}">${district.itemValue}</option>
|
<option value="${district.itemValue}"
|
||||||
|
<c:if test="${_cfg.complexCfg[mainTable].district eq district.itemValue}">selected</c:if>
|
||||||
|
>${district.itemValue}</option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</c:when>
|
</c:when>
|
||||||
@@ -34,7 +49,9 @@
|
|||||||
<select name="complexCfg[${otherTable.tableName}].district" class="district selectpicker select2 form-control">
|
<select name="complexCfg[${otherTable.tableName}].district" class="district selectpicker select2 form-control">
|
||||||
<option value=""><spring:message code='select'/></option>
|
<option value=""><spring:message code='select'/></option>
|
||||||
<c:forEach items="${districts}" var="district">
|
<c:forEach items="${districts}" var="district">
|
||||||
<option value="${district.itemValue}">${district.itemValue}</option>
|
<option value="${district.itemValue}"
|
||||||
|
<c:if test="${_cfg.complexCfg[otherTable.tableName].district eq district.itemValue}">selected</c:if>
|
||||||
|
>${district.itemValue}</option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</c:when>
|
</c:when>
|
||||||
|
|||||||
@@ -153,11 +153,18 @@ $(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(".district").on("change",function(){
|
$(".district").on("change",function(){
|
||||||
var val=$(this).val().toLowerCase();
|
var text=$(this).find("option:selected").text().toLowerCase();
|
||||||
if("others"==val){
|
var other=$(this).parent("div").siblings(".otherValue");
|
||||||
$(this).parent("div").siblings(".otherValue").prop("type","text");
|
if("others"==text){
|
||||||
|
other.prop("type","text");
|
||||||
|
$(this).find("option").each(function(){
|
||||||
|
if(other.val()==$(this).text()){
|
||||||
|
other.val("");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}else{
|
}else{
|
||||||
$(this).parent("div").siblings(".otherValue").prop("type","hidden").attr("value","");
|
other.prop("type","hidden");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(".otherValue").on("change",function(){
|
$(".otherValue").on("change",function(){
|
||||||
|
|||||||
Reference in New Issue
Block a user