<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <!-- 样式 -->
        <link rel="stylesheet" th:href="@{'/css/admin.css'}" media="all">
        <link rel="stylesheet" th:href="@{'/css/index.css'}" media="all">
        <script>
            if (self !== top){
                window.top.location.replace(self.location);
            }
        </script>
    </head>

    <body class="layui-layout-body">
        <div id="LAY_app">
            <div class="layui-layout layui-layout-admin">
                <!-- 顶部导航 -->
                <div class="layui-header">
                    <!-- 头部区域 -->
                    <ul class="layui-nav layui-layout-left">
                        <li class="layui-nav-item layadmin-flexible" >
                            <a href="#" layadmin-event="flexible" title="侧边伸缩">
                                <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
                            </a>
                        </li>
                        <li class="layui-nav-item" >
                            <a href="#" layadmin-event="refresh" title="刷新">
                                <i class="layui-icon layui-icon-refresh-3"></i>
                            </a>
                        </li>
                        <!-- 遍历1级菜单 -->
                        <li class="layui-nav-item top_menu_item"
                            th:each="menu,menuStat:${onLineUser.menuList}"
                            th:classappend="${ menuStat.index eq 0 ? 'layui-this' : ''}"
                            th:attr="data-id=${menu.id}">
                            <a th:href="${'' eq menu.path ? 'javascript: void(0);' : menu.path}" th:title="${menu.name}">
                                <!-- 图标 -->
                                <i class="layui-icon" th:classappend="${menu.icon}"></i>
                                <!-- 菜单名称 -->
                                <span th:text="${menu.name}"></span>
                            </a>
                        </li>
                    </ul>
                    <!-- 用户信息 -->
                    <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
                        <!-- 消息提醒 -->
                        <!--
                        <li class="layui-nav-item" >
                            <a lay-href="#" layadmin-event="message">
                                <i class="layui-icon layui-icon-notice"></i>
                                &lt;!&ndash; 如果有新消息，则显示小圆点 &ndash;&gt;
                                <span class="layui-badge-dot"></span>
                            </a>
                        </li>
                        -->
                        <li class="layui-nav-item" >
                            <a href="#">
                                <cite th:text="${onLineUser.getLoginName()}"></cite>
                            </a>
                            <dl class="layui-nav-child">
<!--                                <dd><a href="javascript: void(0);" class="account_setup">账户设置</a></dd>-->
                                <dd layadmin-event="logout">
                                    <a th:href="@{'/permissions/authentication/logout'}">退出</a>
                                </dd>
                            </dl>
                        </li>
                    </ul>
                </div>
                <!-- 侧边菜单 -->
                <div class="layui-side layui-side-menu">
                    <div class="layui-side-scroll">
                        <!-- LOGO -->
                        <div class="layui-logo">
                            <span th:text="#{platform.title}"></span>
                        </div>
                        <!-- 2级菜单列表 -->
                        <ul th:attr="data-top-menu-id=${onLineUser.menuList.get(0).id}"
                            class="layui-nav layui-nav-tree"
                            id="LAY-system-side-menu"
                            lay-filter="layadmin-system-side-menu">
                            <!-- 渲染默认菜单：1级菜单下，对应的子菜单列表 -->
                            <li class="layui-nav-item layui-nav-itemed"
                                th:each="menu:${onLineUser.menuList.get(0).subList}"
                                th:if="${menu.type != 2}"
                                th:attr="data-name=${menu.token}">
                                <!-- 路径为空 -->
                                <a lay-direction="2" href="javascript: void(0);"
                                   th:if="${null == menu.path}"
                                   th:attr="lay-tips=${menu.name}">
                                    <i class="layui-icon" th:classappend="${menu.icon}"></i>
                                    <cite th:text="${menu.name}"></cite>
                                </a>
                                <!-- 路径不为空 -->
                                <a lay-direction="2" href="javascript: void(0);"
                                   th:if="${null != menu.path}"
                                   th:attr="lay-tips=${menu.name},lay-href=${menu.path}">
                                    <i class="layui-icon" th:classappend="${menu.icon}"></i>
                                    <cite th:text="${menu.name}"></cite>
                                </a>
                                <!-- 3级菜单列表 -->
                                <dl class="layui-nav-child"
                                    th:if="${null != menu.subList && menu.subList.size() > 0 && menu.type != 1}">
                                    <dd th:each="subMenu:${menu.subList}"
                                        th:attr="data-name=${subMenu.name}">
                                        <!-- 路径为空 -->
                                        <a href="javascript: void(0);"
                                           th:if="${null == subMenu.path}"
                                           th:text="${subMenu.name}">
                                        </a>
                                        <!-- 路径不为空 -->
                                        <a href="javascript: void(0);"
                                           th:if="${null != subMenu.path}"
                                           th:attr="lay-href=${subMenu.path}"
                                           th:text="${subMenu.name}">
                                        </a>
                                    </dd>
                                </dl>
                            </li>
                        </ul>
                    </div>
                </div>

                <!-- 页面标签 -->
                <div class="layadmin-pagetabs" id="LAY_app_tabs">
                    <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
                    <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
                    <div class="layui-icon layadmin-tabs-control layui-icon-down">
                        <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
                            <li class="layui-nav-item">
                                <a href="#"></a>
                                <dl class="layui-nav-child layui-anim-fadein">
                                    <dd layadmin-event="closeThisTabs"><a href="#">关闭当前标签页</a></dd>
                                    <dd layadmin-event="closeOtherTabs"><a href="#">关闭其它标签页</a></dd>
                                    <dd layadmin-event="closeAllTabs"><a href="#">关闭全部标签页</a></dd>
                                </dl>
                            </li>
                        </ul>
                    </div>
                    <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
                        <!-- 已打开的全部页面标签 -->
                        <ul class="layui-tab-title" id="LAY_app_tabsheader">
                            <!-- 主页 -->
                            <li lay-id="/home/index" lay-attr="/home/index" class="layui-this">
                                <i class="layui-icon layui-icon-home"></i>
                            </li>
                        </ul>
                    </div>
                </div>

                <!-- 主体内容 -->
                <div class="layui-body" id="LAY_app_body">
                    <div class="layadmin-tabsbody-item layui-show">
                        <iframe src="/home/index" frameborder="0" class="layadmin-iframe"></iframe>
                    </div>
                </div>

                <!-- 辅助元素，一般用于移动设备下遮罩 -->
                <div class="layadmin-body-shade" layadmin-event="shade"></div>

                <!--&lt;!&ndash; 页脚 &ndash;&gt;-->
                <!--<div class="layui-footer footer footer-demo">-->
                    <!--<div class="layui-main">-->
                        <!--<p>Copyright © JMT, All Rights Reserved.</p>-->
                    <!--</div>-->
                <!--</div>-->

            </div>
        </div>

    </body>


    <!-- 菜单 -->
    <script id="left_menu_template" type="text/html">
        {{#  layui.each(d.list, function(index,menu){ }}
        <li data-name="{{ menu.token }}" class="layui-nav-item layui-nav-itemed">
            {{# if(menu.path){ }}
            <a lay-href="{{ menu.path }}" href="javascript: void(0);" lay-tips="{{ menu.name }}" lay-direction="2">
                <i class="layui-icon {{ menu.icon }}"></i>
                <cite>{{ menu.name }}</cite>
            </a>
            {{# } else { }}
            <a href="javascript: void(0);" lay-tips="{{ menu.name }}" lay-direction="2">
                <i class="layui-icon {{ menu.icon }}"></i>
                <cite>{{ menu.name }}</cite>
            </a>
            {{# } }}
            {{#  if(menu.subList instanceof Array && menu.subList.length > 0 && menu.type != 1){ }}
            <dl class="layui-nav-child">
                {{#  layui.each(menu.subList, function(subIndex, subMenu){ }}
                <dd data-name="{{ subMenu.token }}">
                    {{# if(subMenu.path){ }}
                    <a lay-href="{{ subMenu.path }}" href="javascript: void(0);">{{ subMenu.name }}</a>
                    {{# } else { }}
                    <a href="javascript: void(0);">{{ subMenu.name }}</a>
                    {{# } }}
                </dd>
                {{#  }); }}
            </dl>
            {{#  } }}
        </li>
        {{#  }); }}
    </script>

    <!-- javascript -->
    <script th:src="@{'/layui/layui.js'}"></script>
    <script>
        layui.config({
            //  静态资源所在路径
            base: '/'
        });
    </script>

    <script th:src="@{'/lib/index.js'}"></script>
    <script th:src="@{'/js/index.js'}"></script>

</html>
