<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <img src="/images/logo.png"/>
            <cite>线索管理</cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a>
                    <img src="/images/head.png" class="layui-nav-img">
                    <cite><?= Yii::$app->user->identity->username ?></cite>
                </a>
                <dl class="layui-nav-child">
<!--                    <dd lay-unselect><a  id="index_psw">修改密码</a></dd>-->
<!--                    <hr>-->
                    <dd lay-unselect><a id="logout">退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <!-- 侧边栏 -->
    <div class="layui-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree arrow2" lay-filter="admin-side-nav" lay-shrink="all">
                <?php if (Yii::$app->user->identity->role === 'USER'): ?>
                    <li class="layui-nav-item" >
                        <a lay-href="private">
                            <i class="layui-icon layui-icon-auz"></i>&emsp;
                            <cite>我的线索</cite>
                        </a>
                    </li>
                <?php endif; ?>
                <?php if (Yii::$app->user->identity->role === 'ADMIN'): ?>
                    <li class="layui-nav-item" >
                        <a lay-href="xiansuo">
                            <i class="layui-icon layui-icon-auz"></i>&emsp;
                            <cite>线索管理</cite>
                        </a>
                    </li>
                    <li class="layui-nav-item" >
                        <a lay-href="users">
                            <i class="layui-icon layui-icon-auz"></i>&emsp;
                            <cite>后台账户管理</cite>
                        </a>
                    </li>
                    <li class="layui-nav-item" >
                        <a lay-href="oauthmanage">
                            <i class="layui-icon layui-icon-auz"></i>&emsp;
                            <cite>授权账户管理</cite>
                        </a>
                    </li>
                <?php endif; ?>
            </ul>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body" style="bottom:0;"></div>
</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>
<script>
    layui.use(['layer','index','admin'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var index = layui.index;
        var admin = layui.admin;
        var form = layui.form;
        var notice = layui.notice;


        // 默认加载主页
        index.loadHome({
            menuPath: 'console',
            menuName: '<i class="layui-icon layui-icon-home"></i>',
            // loadSetting: false,
        });

        $('#logout').click(function () {
            location.replace("logout")
        })
    });
</script>