增强字符串配置,如果district字段内容为others,用户可手动输入匹配区域。
This commit is contained in:
@@ -78,6 +78,12 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
public String getDistrictShowName() {
|
||||
return districtShowName;
|
||||
}
|
||||
public void setDistrictShowName(String districtShowName) {
|
||||
this.districtShowName = districtShowName;
|
||||
}
|
||||
/**
|
||||
* exprType
|
||||
* 继承此类的类会覆盖该方法写自己的缺省值
|
||||
|
||||
@@ -149,12 +149,18 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
if(entity.getHttpReqHdrList()!=null){
|
||||
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
websiteCfgDao.saveHttpReqHdrCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getHttpResHdrList()!=null){
|
||||
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
websiteCfgDao.saveHttpResHdrCfg(cfg);
|
||||
}
|
||||
}
|
||||
@@ -213,12 +219,18 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
if(entity.getHttpReqHdrList()!=null){
|
||||
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
websiteCfgDao.saveHttpReqHdrCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getHttpResHdrList()!=null){
|
||||
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
websiteCfgDao.saveHttpResHdrCfg(cfg);
|
||||
}
|
||||
}
|
||||
@@ -683,6 +695,9 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
for(ComplexkeywordCfg cfg:entity.getDomainList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
websiteCfgDao.saveDnsDomainCfg(cfg);
|
||||
}
|
||||
}
|
||||
@@ -722,6 +737,9 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
for(ComplexkeywordCfg cfg:entity.getDomainList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
websiteCfgDao.saveDnsDomainCfg(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<c:forEach items="${regionList}" var="regionDistrict">
|
||||
<c:if
|
||||
@@ -33,18 +29,19 @@ $(function(){
|
||||
<spring:message code="district" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="${cfgName}.district"
|
||||
class="selectpicker show-tick form-control required">
|
||||
class="selectpicker show-tick form-control required district" onchange="changeDistrict($(this))">
|
||||
<c:forEach items="${regionList}" var="regionDistrict">
|
||||
<c:if
|
||||
test="${_cfg.functionId eq regionDistrict.functionId and regionValue eq regionDistrict.configRegionValue}">
|
||||
<c:forEach items="${fn:split(regionDistrict.configDistrict,',')}"
|
||||
var="_district">
|
||||
<option value="${_district }"
|
||||
<c:if test="${complexCfg.district==_district || complexCfg.district==null}">selected</c:if>>${_district }</option>
|
||||
<c:if test="${complexCfg.district==_district}">selected</c:if>>${_district }</option>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input type="hidden" name="${cfgName}.districtShowName" placeholder="<spring:message code='please_input'/> <spring:message code='custom_region'/>" class="otherValue form-control" value="${complexCfg.district}"/>
|
||||
</div>
|
||||
<div for="${cfgName}.district"></div>
|
||||
</div>
|
||||
@@ -135,3 +132,10 @@ $(function(){
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
<script type="text/javascript">
|
||||
function changeDistrict(obj){
|
||||
if("others"==obj.val()){
|
||||
obj.parent().siblings(".otherValue").prop("type","text");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -71,6 +71,15 @@
|
||||
/* $("span[title='add']").on("click", function() {
|
||||
$(".ipPort0").removeClass("hidden");
|
||||
}); */
|
||||
$(".district").each(function(){
|
||||
if($(this).siblings(".otherValue").val()!=''){
|
||||
if($(this).val()!=$(this).siblings(".otherValue").val()){
|
||||
$(this).find("option[value=others]").attr("selected","selected");
|
||||
$(this).siblings(".otherValue").prop("type","text");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -93,6 +93,16 @@
|
||||
$(".ipPort0").removeClass("hidden");
|
||||
}); */
|
||||
|
||||
$(".district").each(function(){
|
||||
if($(this).siblings(".otherValue").val()!=''){
|
||||
if($(this).val()!=$(this).siblings(".otherValue").val()){
|
||||
$(this).find("option[value=others]").attr("selected","selected");
|
||||
$(this).siblings(".otherValue").prop("type","text");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//业务窗口打开
|
||||
|
||||
Reference in New Issue
Block a user