业务配置界面Tag调整,修改支持全选,不选时默认值0的设置调整

This commit is contained in:
wangxin
2018-10-09 13:56:30 +08:00
parent 6fa2926268
commit 69b3626ae2
4 changed files with 39 additions and 18 deletions

View File

@@ -39,9 +39,9 @@
</c:if>
</c:forEach>
<sys:treeselect id="classify" name="classify" value="${empty _cfg.classify?0:_cfg.classify}" labelName="classifyName" extId="0"
labelValue="${classifyValue}"
title="classification" url="/basics/serviceDictInfo/treeData?itType=1&isShowLeaf=true" notAllowSelectRoot="true" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="form-control" checkedPS="" unCheckedPS=""/>
labelValue="${classifyValue}" labelEmptyValue="0"
title="classification" url="/basics/serviceDictInfo/treeData?itType=1&isShowLeaf=true" notAllowSelectRoot="false" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="form-control" checkedPS="ps" unCheckedPS="s"/>
<%-- <select name="classify" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${fls}" var="fl">
@@ -89,9 +89,9 @@
</c:if>
</c:forEach>
<sys:treeselect id="attribute" name="attribute" value="${empty _cfg.attribute?0:_cfg.attribute}" labelName="attributeName" extId="0"
labelValue="${attributeValue}"
title="attribute" url="/basics/serviceDictInfo/treeData?itType=2&isShowLeaf=true" notAllowSelectRoot="true" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="form-control" checkedPS="" unCheckedPS=""/>
labelValue="${attributeValue}" labelEmptyValue="0"
title="attribute" url="/basics/serviceDictInfo/treeData?itType=2&isShowLeaf=true" notAllowSelectRoot="false" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="form-control" checkedPS="ps" unCheckedPS="s"/>
<%-- <select name="attribute" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${xzs}" var="xz">
<c:choose>
@@ -134,9 +134,9 @@
</c:if>
</c:forEach>
<sys:treeselect id="lable" name="lable" value="${empty _cfg.lable?0:_cfg.lable}" labelName="lableName" extId="0"
labelValue="${lableValue}"
title="label" url="/basics/serviceDictInfo/treeData?itType=3&isShowLeaf=true" notAllowSelectRoot="true" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="form-control" checkedPS="" unCheckedPS=""/>
labelValue="${lableValue}" labelEmptyValue="0"
title="label" url="/basics/serviceDictInfo/treeData?itType=3&isShowLeaf=true" notAllowSelectRoot="false" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="form-control" checkedPS="ps" unCheckedPS="s"/>
<%-- <select name="lable" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${lables}" var="lable">
<c:choose>

View File

@@ -28,6 +28,7 @@
<%@ attribute name="unCheckedPS" type="java.lang.String" required="false" description="复选框取消选中时是否关联父子节点ps关联父子p关联父s关联子,都不关联为空"%>
<%@ attribute name="enableAddBtn" type="java.lang.Boolean" required="false" description="节点是否可编辑"%>
<%@ attribute name="enableSearch" type="java.lang.Boolean" required="false" description="是否开启节点搜索功能"%>
<%@ attribute name="labelEmptyValue" type="java.lang.String" required="false" description="标签不能为空的时候当清空选择时补填的值"%>
<div class="input-group">
<input id="${id}Id" name="${name}" class="${cssClass} singleClass" type="hidden" value="${value}" />
<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'} type="text" value="<spring:message code='${empty value?"":labelValue}'/>" data-msg-required="${dataMsgRequired}" placeholder="${(empty value or value eq extId)?labelValue:value}"
@@ -45,7 +46,7 @@
return true;
}
// 正常打开
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&selectIds="+$("#${id}Id").val()+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&title=${title}&enableAddBtn=${enableAddBtn}&enableSearch=${enableSearch}", "<spring:message code='choose'/> <spring:message code='${title}'/>", 320, 420, {
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&selectIds="+$("#${id}Id").val()+"&module=${module}&checked=${checked}&checkedPS=${checkedPS}&unCheckedPS=${unCheckedPS}&extId=${extId}&isAll=${isAll}&title=${title}&enableAddBtn=${enableAddBtn}&enableSearch=${enableSearch}", "<spring:message code='choose'/> <spring:message code='${title}'/>", 320, 420, {
ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"<spring:message code='ok'/>":"ok", "<spring:message code='clear'/>":"clear","<spring:message code='close'/>":true}, submit:function(v, h, f){
if (v == "ok"){
var tree = h.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
@@ -90,6 +91,11 @@
top.$.jBox.tip("<spring:message code='no_node'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}//</c:if>
if("${labelEmptyValue}"&&""!="${labelEmptyValue}"){
if("${extId}"==nodes[i].id){
continue;
}
}
ids.push(nodes[i].id);
//<c:if test="${showParentName}">
if (nodes[i].id != null ){
@@ -109,7 +115,7 @@
names.push(nodes[i].name);
}
});
});
}//</c:if>
//<c:if test="${!showParentName}">
@@ -119,7 +125,9 @@
break; // 如果为非复选框选择,则返回第一个选择
//</c:if>
}
if(ids.length==0&&"${labelEmptyValue}"&&""!="${labelEmptyValue}"){
ids.push("${labelEmptyValue}");
}
$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
$("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到
$("#${id}Name").val(names.join(","));
@@ -127,7 +135,11 @@
$("#${id}Name").attr("placeholder","");
}
}else if (v == "clear"){
$("#${id}Id").val("");
if("${labelEmptyValue}"&&""!="${labelEmptyValue}"){
$("#${id}Id").val("${labelEmptyValue}");
}else{
$("#${id}Id").val("");
}
$("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到
$("#${id}Name").val("");
$("#${id}Name").attr("placeholder","");

View File

@@ -194,9 +194,18 @@ label.errorShow {
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code="superior_config"/>:</label>
<div class="col-md-4">
<c:set var="fatherName"><spring:message code="root_node"/></c:set>
<sys:treeselect id="serviceDictInfo" name="parent.serviceDictId" value="${serviceDictInfo.parent.serviceDictId}" labelName="parent.itemValue" labelValue="${serviceDictInfo.parent.serviceDictId eq '0'?fatherName:fns:getServiceDictInfoById(serviceDictInfo.parent.serviceDictId).itemValue}"
title="${title }" url="/basics/serviceDictInfo/treeData?itType=${itType}" cssClass="required form-control"/>
<c:if test="${itType==1 }">
<c:set var="fatherName"><spring:message code="classification"/></c:set>
</c:if>
<c:if test="${itType==2 }">
<c:set var="fatherName"><spring:message code="attribute"/></c:set>
</c:if>
<c:if test="${itType==3 }">
<c:set var="fatherName"><spring:message code="label"/></c:set>
</c:if>
<sys:treeselect id="serviceDictInfo" name="parent.serviceDictId" value="${serviceDictInfo.parent.serviceDictId}" labelName="parent.itemValue"
labelValue="${serviceDictInfo.parent.serviceDictId eq '0'?fatherName:fns:getServiceDictInfoById(serviceDictInfo.parent.serviceDictId).itemValue}"
title="${title }" url="/basics/serviceDictInfo/treeData?itType=${itType}" cssClass="required form-control"/>
<label class="errorShow" style="display: none;"><spring:message code="isLevelNoSure"/></label>
</div>
</div>

View File

@@ -539,11 +539,11 @@ $(function(){
}
});
$("#classifyId,#attributeId,#lableId").on("change",function(){
/*$("#classifyId,#attributeId,#lableId").on("change",function(){
if($(this).val()==0 || $(this).val()==''){
$(this).val(0);
}
});
});*/
//配置修改时已经展开的域上的加号隐藏
$(".boxSolid:visible").each(function(){
$(this).prev("h4").find(".glyphicon-plus").addClass("hidden");