<#--使用宏递归输出菜单-->
<#macro showMenu menuList, key>
    <#list menuList as m>
        <#if m.type == 1>
            <li>
                <a href="javascript:;" data-url="${m.url}" data-module="${key}" data-target="${m.target?default("")}" data-id="${m.MId}" title="<@ctx.i18n text = "${m.name}" />">
                    <#if m.icon??><i class="${m.icon}" data-icon="${m.icon}"></i></#if>
                    <span><@ctx.i18n text = "${m.name}" /></span>
                    <#if m.MNew><span class="pull-right-container"><small data-index="_new" class="label pull-right bg-red"><@ctx.i18n text = "新" /></small></span></#if>
                </a>
            </li>
        </#if>
        <#if m.type == 0>
            <li class="treeview">
                <a href="javascript:;" title="<@ctx.i18n text = "${m.name}" />">
                    <#if m.icon??><i class="${m.icon}"></i></#if>
                    <span><@ctx.i18n text = "${m.name}" /></span>
                    <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                </a>
                <ul class="treeview-menu">
                    <#if m.children?? && (m.children?size>0)>
                        <@showMenu m.children, key />
                    </#if>
                </ul>
            </li>
        </#if>
    </#list>
</#macro>
<div id="leftMenu" class="tab-content">
 <#if menuList?? && (menuList?size > 0) >
    <#list menuList?keys as key>
    <ul class="tab-pane sidebar-menu" data-widget="tree" id="leftMenu-${key}">
        <li class="header"></li>
        <#if menuList[key]?? && (menuList[key]?size > 0) >
            <#list menuList[key] as menu>
            <li class="treeview">
                <#if menu.type == 0>
                    <a href="javascript:;" title="<@ctx.i18n text = " ${menu.name}"/>">
                    <#if menu.icon??><i class="${menu.icon}"></i></#if>
                     <span><@ctx.i18n text = "${menu.name}" /></span>
                     <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                     </a>
                </#if>
                <ul class="treeview-menu">
                    <#if menu.children?? && (menu.children?size>0)>
                    <@showMenu menu.children, key />
                    </#if>
                </ul>
             </li>
             </#list>
        </#if>
    </ul>
   </#list>
</#if>
</div>
