Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
duandongmei
2018-07-02 15:55:50 +08:00
4 changed files with 69 additions and 23 deletions

View File

@@ -21,6 +21,8 @@ public class TagController extends BaseController {
model.addAttribute("url", request.getParameter("url")); // 树结构数据URL
model.addAttribute("extId", request.getParameter("extId")); // 排除的编号ID
model.addAttribute("checked", request.getParameter("checked")); // 是否可复选
model.addAttribute("checkedPS", request.getParameter("checkedPS")); // 复选框选中时是否关联父子节点ps关联父子p关联父s关联子,都不关联为空
model.addAttribute("unCheckedPS", request.getParameter("unCheckedPS")); // 复选框取消选中时是否关联父子节点ps关联父子p关联父s关联子,都不关联为空
model.addAttribute("selectIds", request.getParameter("selectIds")); // 指定默认选中的ID
model.addAttribute("isAll", request.getParameter("isAll")); // 是否读取全部数据,不进行权限过滤
model.addAttribute("module", request.getParameter("module")); // 过滤栏目模型仅针对CMS的Category树

View File

@@ -28,7 +28,20 @@
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="type"/></label>
<div class="col-md-6">
<select name="classify" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:set var="classifyValue" value=""></c:set>
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify" varStatus="status">
<c:if test="${status.index+1 eq 1}">
<c:set var="classifyValue" value="${fns:getServiceDictInfoById(_classify).itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="classifyValue" value="${classifyValue},${fns:getServiceDictInfoById(_classify).itemValue}"></c:set>
</c:if>
</c:forEach>
<sys:treeselect id="classify" name="classify" value="${_cfg.classify}" labelName="classifyName" extId="0"
labelValue="${classifyValue}"
title="type" url="/basics/serviceDictInfo/treeData?itType=1" notAllowSelectRoot="true" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="required form-control" checkedPS="" unCheckedPS=""/>
<%-- <select name="classify" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${fls}" var="fl">
<c:choose>
@@ -44,16 +57,16 @@
${fl.itemValue}
</option>
</c:if>
<%-- <option value="${fl.serviceDictId}"
<option value="${fl.serviceDictId}"
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify">
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
</c:forEach>
>${fl.itemValue}</option> --%>
>${fl.itemValue}</option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</select> --%>
</div>
</div>
</div>
@@ -65,7 +78,20 @@
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="attribute"/></label>
<div class="col-md-6">
<select name="attribute" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:set var="attributeValue" value=""></c:set>
<c:forEach items="${fn:split(_cfg.attribute,',')}" var="_attribute" varStatus="status">
<c:if test="${status.index+1 eq 1}">
<c:set var="attributeValue" value="${fns:getServiceDictInfoById(_attribute).itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="attributeValue" value="${attributeValue},${fns:getServiceDictInfoById(_attribute).itemValue}"></c:set>
</c:if>
</c:forEach>
<sys:treeselect id="attribute" name="attribute" value="${_cfg.attribute}" labelName="attributeName" extId="0"
labelValue="${attributeValue}"
title="attribute" url="/basics/serviceDictInfo/treeData?itType=2" notAllowSelectRoot="true" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="required form-control" checkedPS="" unCheckedPS=""/>
<%-- <select name="attribute" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${xzs}" var="xz">
<c:choose>
<c:when test="${_cfg.attribute==null or _cfg.attribute==''}">
@@ -80,16 +106,16 @@
${xz.itemValue}
</option>
</c:if>
<%-- <c:forEach items="${fn:split(_cfg.attribute,',')}" var="_attribute">
<c:forEach items="${fn:split(_cfg.attribute,',')}" var="_attribute">
<option value="${xz.serviceDictId}"
<c:if test="${xz.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fn:trim(xz.serviceDictId) eq _attribute}">selected</c:if>
>${xz.itemValue}</option>
</c:forEach> --%>
</c:forEach>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</select> --%>
</div>
</div>
</div>
@@ -97,7 +123,20 @@
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="label"/></label>
<div class="col-md-6">
<select name="lable" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:set var="lableValue" value=""></c:set>
<c:forEach items="${fn:split(_cfg.lable,',')}" var="_lable" varStatus="status">
<c:if test="${status.index+1 eq 1}">
<c:set var="lableValue" value="${fns:getServiceDictInfoById(_lable).itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="lableValue" value="${lableValue},${fns:getServiceDictInfoById(_lable).itemValue}"></c:set>
</c:if>
</c:forEach>
<sys:treeselect id="lable" name="lable" value="${_cfg.lable}" labelName="lableName" extId="0"
labelValue="${lableValue}"
title="label" url="/basics/serviceDictInfo/treeData?itType=3" notAllowSelectRoot="true" allowClear="true" notAllowSelectParent="false"
checked="true" cssClass="required form-control" checkedPS="" unCheckedPS=""/>
<%-- <select name="lable" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${lables}" var="lable">
<c:choose>
<c:when test="${_cfg.lable==null or _cfg.lable==''}">
@@ -112,17 +151,17 @@
${lable.itemValue}
</option>
</c:if>
<%-- <c:forEach items="${fn:split(_cfg.lable,',')}" var="_lable">
<c:forEach items="${fn:split(_cfg.lable,',')}" var="_lable">
<option value="${lable.serviceDictId}"
<c:if test="${lable.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fn:trim(lable.serviceDictId) eq _lable}">selected</c:if>
>${lable.itemValue}</option>
</c:forEach> --%>
</c:forEach>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</select> --%>
</div>
</div>
</div>

View File

@@ -24,6 +24,8 @@
<%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
<%@ attribute name="selectDepartment" type="java.lang.String" required="false" description="不允许选择部门,自办部门,转办部门"%>
<%@ attribute name="showParentName" type="java.lang.String" required="false" description="显示父类名称"%>
<%@ attribute name="checkedPS" type="java.lang.String" required="false" description="复选框选中时是否关联父子节点ps关联父子p关联父s关联子,都不关联为空"%>
<%@ attribute name="unCheckedPS" type="java.lang.String" required="false" description="复选框取消选中时是否关联父子节点ps关联父子p关联父s关联子,都不关联为空"%>
<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="${labelValue}" data-msg-required="${dataMsgRequired}" placeholder="${value}"
@@ -43,7 +45,7 @@
return true;
}
// 正常打开
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}", "<spring:message code='choose'/>${title}", 320, 420, {
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&selectIds="+$("#${id}Id").val()+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}", "<spring:message code='choose'/><spring:message code='${title}'/>", 320, 420, {
ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"ok":"ok", ${allowClear?"\"clear\":\"clear\", ":""}"close":true}, submit:function(v, h, f){
if (v=="ok"){
var tree = h.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
@@ -54,8 +56,8 @@
nodes = tree.getSelectedNodes();
}
for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
if (nodes[i].isParent){
continue; // 如果为复选框选择,则过滤掉父节点
if (nodes[i].isParent && "${checkedPS}"!=''){
continue; // 如果为复选框选择,并且父子节点有关联,则过滤掉父节点
}//</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'/>");

View File

@@ -8,7 +8,7 @@
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-ztree/3.5.12/js/jquery.ztree.all-3.5.min.js" type="text/javascript"></script>
<script type="text/javascript">
var key, lastValue = "", nodeList = [], type = getQueryString("type", "${url}");
var tree, setting = {view:{selectedMulti:false,dblClickExpand:false},check:{enable:"${checked}",nocheckInherit:true},
var tree, setting = {view:{selectedMulti:false,dblClickExpand:false},check:{enable:"${checked}",chkboxType: { "Y" : "${checkedPS}", "N" : "${unCheckedPS}" },nocheckInherit:true},
async:{enable:(type==6),url:"${ctx}/sys/user/treeData",autoParam:["id=officeId"]},
data:{simpleData:{enable:true}},callback:{
@@ -57,11 +57,10 @@
var map = zNodes[i];
if(map.id==0&&map.pId==0&&map.name=="root_node"){
map.name="<spring:message code='root_node' />";
}
}
}
tree = $.fn.zTree.init($("#tree"), setting, zNodes);
// 默认展开一级节点
var nodes = tree.getNodesByParam("level", 0);
for(var i=0; i<nodes.length; i++) {
@@ -85,12 +84,16 @@
var ids = "${selectIds}".split(",");
for(var i=0; i<ids.length; i++) {
var node = tree.getNodeByParam("id", (type==3?"u_":"")+ids[i]);
if("${checked}" == "true"){
try{tree.checkNode(node, true, true);}catch(e){}
tree.selectNode(node, false);
}else{
tree.selectNode(node, true);
//如果节点id与排除id相同不被选中
if(node.id!=${extId}){
if("${checked}" == "true"){
try{tree.checkNode(node, true, true);}catch(e){}
tree.selectNode(node, false);
}else{
tree.selectNode(node, true);
}
}
}
}
function focusKey(e) {