app主题网站增加关联关系

This commit is contained in:
zhanghongqing
2018-08-29 22:46:49 +08:00
parent dd59389e0a
commit 5335703255
11 changed files with 483 additions and 151 deletions

View File

@@ -41,8 +41,99 @@ $(function(){
},
errorContainer: "#messageBox",
});
});
</script>
//页面加载时触发初始化操作
var file = $("#domain").val();
if(!file){
$("#userDomain").hide();//隐藏输入框
$("#response").val("domain");
$("#domain").selectpicker("show");//隐藏选择框
}else{
$("#domain").selectpicker("hide");//隐藏选择框
$("#response").val("userDomain");
$("#userDomain").show();//隐藏输入框
}
alert($("#userDomain").val())
$("#response").on("change",function(){
var $this = $(this);
var inputId = $this.val();
$("#userDomain").val("");//清空
$("#domain").selectpicker("val","");
if("userDomain" == inputId){
$("#userDomain").show();//显示输入框
$("#domain").selectpicker("hide");//隐藏选择框
}else{
$("#userDomain").hide();//隐藏输入框
$("#domain").selectpicker("show");//显示选择框
}
});
//
if('${_cfg.domain}'){
ajaxDomain($("#websiteServiceId").val(),$("#topicId").val());
}
//选择主题跟服务 查询域名
$("#topicId").on("change",function(){
var websiteServiceId = $("#websiteServiceId").val();
if(websiteServiceId!=null&&websiteServiceId!=''){
ajaxDomain(websiteServiceId,$("#topicId").val());
}
});
$("#websiteServiceId").on("change",function(){
var topicId =$("#topicId").val();
if(topicId!=null&&topicId!=''){
ajaxDomain($("#websiteServiceId").val(),topicId);
}
});
});
function ajaxDomain(webId,topicId){
var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.indexOf("/nis")+4);
console.log(webId+":"+topicId)
$.ajax({
type:'get',
url:'${ctx}/app/WebsiteDomainTopicList',
data:{"websiteServiceId":webId,"topicId":topicId},
dataType:'json',
async:true,
success:function(data,textStatus){//处理返回结果
if(textStatus=="success"){
var html='<select name="domain" data-live-search="true" class="selectpicker form-control">'
+'<option value=""><spring:message code="select"/></option>';
if(data.length>0){
for(i=0;i<data.length;i++){
html+='<option value="'+data[i].domain+'"';
if('${_cfg.domain}'==data[i].domain){
html+=" selected";
}
html+='>'+data[i].domain+'</option>';
}
html+='</select>';
$("#domain").html(html);
$("[name='domain']").selectpicker("refresh");
$("[name='domain']").selectpicker("render");
}else{
html+='</select>';
$("#domain").html(html);
$("[name='domain']").selectpicker("refresh");
$("[name='domain']").selectpicker("render");
}
}
},
complete:function(XMLHttpRequest,status){//超时设置
if(status=="timeout"){
var html='<select name="domain" data-live-search="true" class="selectpicker form-control">'
+'<option value=""><spring:message code="select"/></option></select>';
$("#domain").html(html);
$("[name='domain']").selectpicker("refresh");
$("[name='domain']").selectpicker("render");
}
}
});
}
</script>
</head>
<body>
@@ -70,39 +161,26 @@ $(function(){
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%>
<input type="hidden" id="domainId" name="domainId" value="">
<div class="form-body">
<!-- desc and action -->
<div class="row">
<%-- <div class="col-md-6">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=1" extId=""
cssClass="form-control required"/>
</div>
<div for="parent.specServiceName"></div>
</div>
</div> --%>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">
<spring:message code="app_topic_domain_cfg" /></label>
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="topic" /></label>
<div class="col-md-6">
<%-- <c:if test="${empty _cfg.topic}"> --%>
<form:select path="_cfg.topic" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<c:forEach items="${fns:getCodeList('serviceCode')}" var="dict">
<form:option value="${dict.code}"><spring:message code="${dict.item}"/></form:option>
<form:select path="_cfg.topicId" class="selectpicker form-control required" data-live-search="true" data-live-search-placeholder="search">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('TOPIC') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"/></form:option>
</c:forEach>
</form:select>
<%-- </c:if> --%>
</div>
<div for="topic"></div>
<div for="topicId"></div>
</div>
</div>
<div class="col-md-6">
@@ -148,13 +226,16 @@ $(function(){
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="domain" /></label>
<spring:message code="website_server" /></label>
<div class="col-md-6">
<input class="form-control required domainCheck" type="text"
name="domain"
value="${_cfg.domain}">
<form:select path="_cfg.websiteServiceId" class="selectpicker form-control required" data-live-search="true" data-live-search-placeholder="search">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('WEBSITE_SERVER') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"/></form:option>
</c:forEach>
</form:select>
</div>
<div for="domain"></div>
<div for="websiteServiceId"></div>
</div>
</div>
<div class="col-md-6" hidden="true">
@@ -176,55 +257,73 @@ $(function(){
</c:forEach>
</div>
</div>
</div>
<c:forEach items="${regionList}" var="region">
<!-- 是否区分大小写 ========== -->
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="expression_type" /></label>
<div class="col-md-6">
<c:if test="${!empty region.configExprType}">
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq exprType}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprType }"
class="required"
<c:if test="${_cfg.exprType eq exprType || (empty _cfg.exprType && exprType eq 0)}">
checked
</c:if>
>
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configExprType}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq 0}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprTypeC.itemCode }"
class="required" checked >
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:if>
</div>
<div for="exprType"></div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<c:if test="${!empty region.configHex}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="1" class="required"
><spring:message code="case_senstive"/>
</label>
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
<c:if test="${empty region.configHex}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
checked
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
</div>
</c:if>
</c:forEach>
<!-- 是否区分大小写end ========== -->
</div>
<div class="row">
<!-- 域名 -->
<div class="col-md-6">
<div class="form-group">
<div class="col-md-5"><label class="col-md-4"></label><font style="papadding-left: 10px" color="red">*</font>
<select id="response" class="selectpicker select2 input-small pull-right">
<option value="domain"><spring:message code="domain"></spring:message></option>
<option value="userDomain"><spring:message code="please_input"></spring:message></option>
</select>
</div>
<div class="col-md-4">
<input id="userDomain" name="userDomain" class="form-control required domainCheck" type="text" value="">
<select id="domain" name="domain" data-live-search="true" class="selectpicker form-control required domainCheck">
<option value=""><spring:message code="select"/></option>
</select>
<div for="domain"></div>
</div>
</div>
</div>
<!-- -->
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="match_method" /></label>
@@ -264,6 +363,58 @@ $(function(){
<div for="matchMethod"></div>
</div>
</div>
</c:if>
</c:forEach>
</div>
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
<div class="row">
<div class="col-md-6 ">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="expression_type" /></label>
<div class="col-md-6">
<c:if test="${!empty region.configExprType}">
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq exprType}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprType }"
class="required"
<c:if test="${_cfg.exprType eq exprType || (empty _cfg.exprType && exprType eq 0)}">
checked
</c:if>
>
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configExprType}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq 0}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprTypeC.itemCode }"
class="required" checked >
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:if>
</div>
<div for="exprType"></div>
</div>
</div>
</div>
<div class="row">
<c:if test="${!empty region.configHex}">
@@ -283,22 +434,6 @@ $(function(){
<div for="isHex"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="1" class="required"
><spring:message code="case_senstive"/>
</label>
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
<c:if test="${empty region.configHex}">
<div class="col-md-6">
@@ -313,19 +448,6 @@ $(function(){
<div for="isHex"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
checked
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
</div>
<div class="row hidden">

View File

@@ -269,7 +269,8 @@
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th style="display: none;"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="app_topic_domain_cfg"/></th>
<th><spring:message code="topic"/></th>
<th><spring:message code="website_server"/></th>
<th><spring:message code="domain"/></th>
<th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th>
@@ -300,7 +301,20 @@
</td>
<td>${cfg.compileId }</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.appName }</td>
<td>
<c:forEach items="${fns:getDictList('TOPIC') }" var="dict">
<c:if test="${dict.itemCode eq cfg.topicId }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('WEBSITE_SERVER') }" var="dict">
<c:if test="${dict.itemCode eq cfg.websiteServiceId }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>${cfg.domain }</td>
<td>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">