特定服务增加业务类别

基础协议,app策略以及app特征点击选择时展示业务类别的树
This commit is contained in:
wangxin
2018-08-22 19:48:20 +08:00
parent 03f78fc535
commit abca1b273c
9 changed files with 249 additions and 46 deletions

View File

@@ -55,30 +55,43 @@
}else{
nodes = tree.getSelectedNodes();
}
for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
//wx提示c:if标签前加了//注释,c:if标签的判断条件仍会生效
for(var i=0; i<nodes.length; i++) {
//<c:if test="${checked && notAllowSelectParent}">
if (nodes[i].isParent && "${checkedPS}"!=''){
continue; // 如果为复选框选择,并且父子节点有关联,则过滤掉父节点
}//</c:if><c:if test="${notAllowSelectRoot}">
}//</c:if>
//<c:if test="${notAllowSelectRoot}">
if (nodes[i].level == 0){
top.$.jBox.tip("<spring:message code='no_root'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}//</c:if><c:if test="${notAllowSelectParent}">
}//</c:if>
//<c:if test="${notAllowSelectParent}">
if (nodes[i].isParent){
top.$.jBox.tip("<spring:message code='no_parent'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}//</c:if><c:if test="${not empty module && selectScopeModule}">
}
//wx: 带有business属性的节点特殊处理
if(nodes[i].businessType&&nodes[i].businessType==-1){
top.$.jBox.tip("<spring:message code='no_parent'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}
//</c:if>
//<c:if test="${not empty module && selectScopeModule}">
if (nodes[i].module == ""){
top.$.jBox.tip("<spring:message code='no_public_model'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}else if (nodes[i].module != "${module}"){
top.$.jBox.tip("<spring:message code='no_outside_column'/><spring:message code='reselect'/>");
return false;
}//</c:if><c:if test="${selectDepartment}">
}//</c:if>
//<c:if test="${selectDepartment}">
if (nodes[i].name=="<spring:message code='send_org'/>" || nodes[i].name=="<spring:message code='department'/>" ||nodes[i].name=="<spring:message code='sendind_org'/>"){
top.$.jBox.tip("<spring:message code='no_node'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}//</c:if>
ids.push(nodes[i].id);//<c:if test="${showParentName}">
ids.push(nodes[i].id);
//<c:if test="${showParentName}">
if (nodes[i].id != null ){
$.ajax({
type:"post",
@@ -98,23 +111,16 @@
});
}//</c:if><c:if test="${!showParentName}">
}//</c:if>
//<c:if test="${!showParentName}">
names.push(nodes[i].name);
//if(nodes[i].type){
// types.push(nodes[i].type);
//}
//</c:if><c:if test="${!checked}">
break; // 如果为非复选框选择,则返回第一个选择 </c:if>
//</c:if>
//<c:if test="${!checked}">
break; // 如果为非复选框选择,则返回第一个选择
//</c:if>
}
if((nodes.length==1)&&(nodes[0].level == 0)&&('true'=='${notAllowSelectRoot}')){
top.$.jBox.tip("<spring:message code='no_root'/>"+nodes[0].name+"<spring:message code='reselect'/>");
return false;
}
$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
//if(types.length>0){
// $("#${id}Id").attr('cfgtype',types.join(","));
//}
$("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到
$("#${id}Name").val(names.join(","));
if(!$("#${id}Name").val()&&'${value}'){//如果值不存在但是value却有值将placeholder清空
@@ -122,7 +128,6 @@
}
}else if (v == "clear"){
$("#${id}Id").val("");
//$("#${id}Id").removeAttr('cfgtype');
$("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到
$("#${id}Name").val("");
$("#${id}Name").attr("placeholder","");

View File

@@ -131,7 +131,7 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName"
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=${app}" extId=""
cssClass="form-control input-small"/>

View File

@@ -81,6 +81,14 @@
$(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
}else{
var cfgType=$(this).attr("cfgType");
if("${specificServiceCfg.parent.specServiceId}"&& "${specificServiceCfg.parent.specServiceId}"!="0"){
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}else{
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}
}
});
$(".protocol_code").html('<font color="red">*</font><spring:message code="app_code"/>:');
@@ -92,6 +100,15 @@
$(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
}else{
var cfgType=$(this).attr("cfgType");
if("${specificServiceCfg.parent.specServiceId}"&& "${specificServiceCfg.parent.specServiceId}"!="0"){
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}else{
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}
}
});
if($("[name='cfgType']").val()==1){
@@ -113,13 +130,25 @@
$("[name=cfgType]").val(cfgType);
$(".cfgType").each(function(){
if($(this).attr("cfgType")==cfgType){
$(this).removeClass("hidden");
$("#specificServiceCfg"+cfgType+"Id").attr("name","parent.specServiceId");
$("#specificServiceCfg"+cfgType+"Name").attr("name","parent.specServiceName");
$("#businessType"+cfgType).attr("name","businessType");
if($(this).hasClass("businessType")){
var parentId=$("#specificServiceCfg"+cfgType+"Id").val();
if(parentId!=0){
$(this).addClass("hidden");
}else{
$(this).removeClass("hidden");
}
}else{
$(this).removeClass("hidden");
}
}else{
$(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
}
});
if(cfgType==1){
@@ -136,6 +165,15 @@
$(".protocol_desc").html('<spring:message code="protocol_desc"/>:');
}
});
$("#specificServiceCfg1Id,#specificServiceCfg2Id,#specificServiceCfg3Id").on("change",function(){
var cfgType=$(this).parents(".cfgType").attr("cfgType");
if($(this).val()==0){
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}else{
$("#businessType"+cfgType).selectpicker("val","");
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}
});
});
</script>
</head>
@@ -197,6 +235,49 @@
</div>
<div for="parent.specServiceName"></div>
</div>
<div class="form-group cfgType businessType
<c:if test='${specificServiceCfg.parent.specServiceId ne null or specificServiceCfg.parent.specServiceId ne 0}'>hidden</c:if>" cfgType="${dict.itemCode}">
<c:if test="${dict.itemCode==1}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="app_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType1" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<c:if test="${dict.itemCode==3}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="basic_protocol_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType3" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<c:if test="${dict.itemCode==2}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="tunnel_behavior_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType2" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType or (specificServiceCfg.parent.specServiceId eq null or specificServiceCfg.parent.specServiceId eq 0)}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<div for="businessType"></div>
</div>
</c:forEach>
<div class="form-group">
<label class="col-md-3 control-label protocol_code"><font color="red">*</font><spring:message code="protocol_code"/>:</label>
@@ -219,6 +300,7 @@
</div>
<div for="groupId"></div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="is_leaf"/>:</label>
<div class="col-md-4">
@@ -248,7 +330,7 @@
<div class="row">
<div class="col-md-offset-3 col-md-9">
<shiro:hasPermission name="specific:service:edit"><button type="submit" class="btn btn-circle blue"><spring:message code="submit"/></button></shiro:hasPermission>
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"/></button>
<button type="button" class="btn btn-circle grey-salsa btn-outline" id="cancel" ><spring:message code="cancel"/></button>
</div>
</div>
</div>

View File

@@ -213,32 +213,44 @@
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="operate_time"/></label>
<input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${specificServiceCfg.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${specificServiceCfg.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="business_type"/></label>
<form:select path="businessType" class="selectpicker select2 input-middle" >
<form:option value=""><spring:message code='business_type'/></form:option>
<c:if test="${specificServiceCfg.cfgType==1}">
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==2}">
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==3}">
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
</form:select>
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
@@ -258,6 +270,7 @@
<tr>
<th><input type="checkbox" class="ckboxs" id="selAll" onclick="selectAll()"></th>
<!-- <th>序号</th> -->
<th><spring:message code="business_type"/></th>
<th><spring:message code="protocol_code"/></th>
<th><spring:message code="protocol_name"/></th>
<th><spring:message code="protocol_desc"/></th>
@@ -272,6 +285,29 @@
<tr id="${specificServiceCfg.specServiceId}" pId="${specificServiceCfg.parent.specServiceId ne 0?specificServiceCfg.parent.specServiceId:0}">
<td><input type="checkbox" class="ckbox" name="check" value="${specificServiceCfg.specServiceId}"></td>
<%-- <td>${specificServiceCfg.showSequence}</td> --%>
<td title="${specificServiceCfg.businessType}">
<c:if test="${specificServiceCfg.cfgType==1}">
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==2}">
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==3}">
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
</td>
<td nowrap><i class="icon-icon-tablet"></i><%--<a href="${ctx}/specific/specificServiceCfg/form?specServiceId=${specificServiceCfg.specServiceId}&doAction=0">--%>${specificServiceCfg.specServiceCode}<%--</a>--%></td>
<td title="${specificServiceCfg.specServiceName}">${specificServiceCfg.specServiceName}</td>
<td title="${specificServiceCfg.specServiceDesc}">${fns:abbr(specificServiceCfg.specServiceDesc,15)}</td>