dddd

<divclass="accordion"fillSpace="sideBar">

<c:iftest="${!emptylist}">

<c:forEachvar="element"items="${list}">

<divclass="accordionHeader">

<h2><span>Folder</span><bean:writename="element"property="privilegeName"/></h2>

</div>

<divclass="accordionContent">

<c:iftest="${!emptyelement.rsysAccPrivilegeVOList}">

<ulclass="treetreeFolder">

<c:setvar="voLevel"value="${element.rsysAccPrivilegeVOList[0].level}"/>

<c:forEachvar="subTree"items="${element.rsysAccPrivilegeVOList}">

<c:setvar="levelDif"value="${subTree.level-voLevel}"/>

<c:iftest="${levelDifeq0}">

<c:iftest="${indexne0}">

</li>

</c:if>

<li><a<c:iftest="${subTree.urlnenull}">href="${subTree.url}"target="navTab"</c:if>>${subTree.privilegeName}</a>

</c:if>

<c:iftest="${levelDif>0}">

<ul>

<li><a<c:iftest="${subTree.urlnenull}">href="${subTree.url}"target="navTab"</c:if>>${subTree.privilegeName}</a>

</c:if>

<c:iftest="${levelDif<0}">

<c:forEachbegin="1"end="${-levelDif}"step="1">

<c:outvalue="</li></ul>"escapeXml="false"/>

</c:forEach>

</li>

<li><a<c:iftest="${subTree.urlnenull}">href="${subTree.url}"target="navTab"</c:if>>${subTree.privilegeName}</a>

</c:if>

<c:setvar="voLevel"value="${subTree.level}"/>

</c:forEach>

</ul>

</c:if>

</div>

</c:forEach>

</c:if>

</div>

----------------------------

privateStringgetSubTree(List<RsysAccPrivilegeVO>privilegeList){

StringBuffersbTreeStr=newStringBuffer();

if(privilegeList!=null&&privilegeList.size()>0){

for(inti=0;i<privilegeList.size();i++){

RsysAccPrivilegeVOvo=privilegeList.get(i);

sbTreeStr.append("<divclass=\"accordionHeader\">");

sbTreeStr.append("<h2><span>Folder</span>"+vo.getPrivilegeName()+"</h2>");

sbTreeStr.append("</div>");

sbTreeStr.append("<divclass=\"accordionContent\">");

List<RsysAccPrivilegeVO>subTree=vo.getRsysAccPrivilegeVOList();

if(subTree!=null&&subTree.size()>0){

sbTreeStr.append("<ulclass=\"treetreeFolder\">");

LongvoLevel=subTree.get(0).getLevel();//默认级别

for(intj=0;j<subTree.size();j++){

RsysAccPrivilegeVOsubVO=subTree.get(j);

LonglevelDif=subVO.getLevel()-voLevel;

if(levelDif==0){

if(j!=0){

sbTreeStr.append("</li>");

}

if(StringUtil.isEmpty(subVO.getUrl())){

sbTreeStr.append("<li><a>"+subVO.getPrivilegeName()+"</a>");

}else{

sbTreeStr.append("<li><ahref="+subVO.getUrl()+"target=\"navTab\">"+subVO.getPrivilegeName()+"</a>");

}

}

if(levelDif>0){

sbTreeStr.append("<ul>");

if(StringUtil.isEmpty(subVO.getUrl())){

sbTreeStr.append("<li><a>"+subVO.getPrivilegeName()+"</a>");

}else{

sbTreeStr.append("<li><ahref="+subVO.getUrl()+"target=\"navTab\">"+subVO.getPrivilegeName()+"</a>");

}

}

if(levelDif<0){

for(Longk=levelDif;k<0;k++){

sbTreeStr.append("</li>");

sbTreeStr.append("</ul>");

}

sbTreeStr.append("</li>");

if(StringUtil.isEmpty(subVO.getUrl())){

sbTreeStr.append("<li><a>"+subVO.getPrivilegeName()+"</a>");

}else{

sbTreeStr.append("<li><ahref="+subVO.getUrl()+"target=\"navTab\">"+subVO.getPrivilegeName()+"</a>");

}

}

voLevel=subVO.getLevel();

}

}

sbTreeStr.append("</ul>");

sbTreeStr.append("</div>");

}

}

returnsbTreeStr.toString();

}

相关推荐