<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    {{--<title>{{ $setting['admintitle'] ?? '后台管理' }}</title>--}}
    <title>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <link rel="shortcut icon" href="/favicon.png" type="image/x-icon">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="/css/admin/font.css">
    <link rel="stylesheet" href="/css/admin/weadmin.css">
    {{--<link rel="stylesheet" href="/qrcode/static/css/style.css">--}}
    <script src="/js/jquery.min.js"></script>
    <script src="/js/admin/js.cookie.js"></script>
    <script src="/layui/layui.js" charset="utf-8"></script>
    <script src="/js/admin/datepicker.min.js"></script>
    <script src="/js/admin/datepicker.zh-CN.js"></script>
    {{-- Laravel Mix - CSS File --}}
{{--    <link rel="stylesheet" href="{{ mix('css/admin/public.css') }}">--}}
    <link rel="stylesheet" href="/css/admin/public.css">
    <style>
        #welcomeTab i {
            display: none;
        }

        .layui-btn-normal {
            background-color: #52c41a;
        }

        .layui-btn-danger {
            background-color: #f5222d;
        }

        .layui-btn-default {
            border: 1px solid #C9C9C9;
            background-color: #fff;
            color: #555;
        }

        .layui-btn-default:hover {
            border-color: #2d6dcc;
            color: #2d6dcc;
        }

        .layui-layer-close {
            background-color: #fff;
        }

        .layui-btn-disabled, .layui-btn-disabled:active, .layui-btn-disabled:hover {
            border: 1px solid #e6e6e6;
            background-color: #FBFBFB;
            color: #C9C9C9;
            cursor: not-allowed;
            opacity: 1;
        }

        #top .layui-nav .layui-btn {
            background-color: #03152A;
        }

        .layui-nav-bar {
            background-color: #3B91FF;
        }

        #nav li:hover > a {
            color: #fff;
        }
    </style>
</head>
<body>
<!-- 顶部开始 -->
<div id="top" class="container" style="background-color: #03152A;">
    <div class="logo">
{{--        <a href="./index.html"><img src="/favicon.png" alt="">{{ $setting['admintitle'] ?? '后台管理' }}</a>--}}
        <a href="./index.html"><img src="/favicon.png" alt="">后台管理</a>
    </div>
    <div class="left_open">
        <!-- <i title="展开左侧栏" class="iconfont">&#xe699;</i> -->
        <i title="展开左侧栏" class="layui-icon layui-icon-shrink-right"></i>

    </div>
    <ul class="layui-nav right" lay-filter="">
        <li class="layui-nav-item">
            <button onclick="viewClear()" class="layui-btn">清除缓存</button>
        </li>
        <li class="layui-nav-item" style="display: none;">
            {{--<button onclick="TopTabMenu('详细资料','/admin/welcome/userinfo?staff_num={{ $user->staff_num }}','userInfo')"--}}
                    {{--class="layui-btn">我的消息--}}
            {{--</button>--}}
            <button onclick="TopTabMenu('详细资料','/admin/welcome/userinfo?staff_num=','userInfo')"
                    class="layui-btn">我的消息
            </button>
        </li>
        <li class="layui-nav-item">
            <input type="hidden" id="userStaffNum" value="{{ $user->staff_num }}">
            <a href="javascript:;">{{ $user->name }}</a>
            <dl class="layui-nav-child">
                <!-- 二级菜单 -->
                {{--@if($user->staff_num != 'admin')--}}
                    {{--@if(checkBtn('/admin/welcome/userinfo', $permissionsList))--}}
                        {{--<dd>--}}
                            {{--<a href="javascript:TopTabMenu('详细资料','/admin/welcome/userinfo?staff_num={{ $user->staff_num }}','userInfo');">详细资料</a>--}}
                        {{--</dd>--}}
                    {{--@endif--}}
                    {{--@if(checkBtn('/admin/dashboard/myfiles/list', $permissionsList))--}}
                        {{--<dd>--}}
                            {{--<a href="javascript:TopTabMenu('我的文档','/admin/dashboard/myfiles/list','myFiles');">我的文档</a>--}}
                        {{--</dd>--}}
                    {{--@endif--}}
                    {{--@if(checkBtn('/admin/dashboard/sign/update', $permissionsList))--}}
                        {{--<dd>--}}
                            {{--<a href="javascript:signUpdate();">我的签名</a>--}}
                        {{--</dd>--}}
                    {{--@endif--}}
                {{--@endif--}}
                <dd>
                    <a href="javascript:resetPassword();">修改密码</a>
                </dd>
                <dd>
                    <a class="loginout" href="/admin/logout">退出</a>
                </dd>
            </dl>
        </li>
    </ul>

</div>
<!-- 顶部结束 -->
<!-- 中部开始 -->
<!-- 左侧菜单开始 -->
<div class="left-nav">
    <div id="side-nav">
        <ul id="nav">
            @include('admin::component.side_menu', ['menus' => $menus, 'tier' => 1])
        </ul>
    </div>
</div>
<!-- <div class="x-slide_left"></div> -->
<!-- 左侧菜单结束 -->
<!-- 右侧主体开始 -->
<div class="page-content">
    <div class="layui-tab tab" lay-filter="wenav_tab" id="WeTabTip" lay-allowclose="true">
        <ul class="layui-tab-title" id="tabName">
            <li id="welcomeTab">首页</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe
                        src=@if(request()->has('category')) '/admin/welcome?category={{request()->input("category")}}' @else
                    '/admin/welcome' @endif
                frameborder="0" scrolling="yes" class="weIframe"></iframe>
            </div>
        </div>
    </div>
</div>
<div class="page-content-bg"></div>
<!-- 右侧主体结束 -->
<!-- 中部结束 -->
<!-- 底部开始 -->
<div class="footer">
    <div class="copyright">Copyright ©2018 WeAdmin v1.0 All Rights Reserved</div>
</div>
<!-- 底部结束 -->
<script type="text/javascript">
    Cookies.remove('isIframe');
    //			layui扩展模块的两种加载方式-示例
    //		    layui.extend({
    //			  admin: '{/}../../static/js/admin' // {/}的意思即代表采用自有路径，即不跟随 base 路径
    //			});
    //			//使用拓展模块
    //			layui.use('admin', function(){
    //			  var admin = layui.admin;
    //			});
    $.ajaxSetup({
        cache: false,
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        },
        xhrFields: {
            withCredentials: true
        },
        beforeSend: function () {  // 请求发送前通用程序
            gload = layer.load(3, {shade: 0.3});
        },
        complete: function (res) {  // 请求发送结束后通用程序
            layer.close(gload);
            //登陆过期，则跳转到登录页面
            if (res.status == 401) {
                layer.alert('登陆超时了，您将跳转到登陆页!', function () {
                    location.href = '/admin/login';
                });
            }
        }
    });
    layui.config({
        base: '/js/admin/'
        , version: '101100'
    }).use('admin');
    layui.use(['jquery', 'admin'], function () {
        var $ = layui.jquery;
        $(function () {
            var login = JSON.parse(localStorage.getItem("login"));
            if (login) {
                if (login = 0) {
                    window.location.href = '/admin/login';
                    return false;
                } else {
                    return false;
                }
            } else {
                window.location.href = '/admin/login';
                return false;
            }
        });


    });

    function resetPassword() {
        $.get('/admin/welcome/resetpassword', {id: {{ $user->id }} }, function (res) {
            layer.open({
                type: 1,
                area: '700px',
                title: false,
                content: res
            });
        });
    }

    function signUpdate() {
        $.get('/admin/dashboard/sign', function (res) {
            layer.open({
                type: 1,
                area: '700px',
                title: false,
                content: res
            });
        });
    }

    function viewClear() {
        $.get('/admin/file/view/clear', function (res) {
            if (res.code === 0) {
                layer.msg('完成！', {anim: 0}, function () {
                    location.reload();
                });
            }
        });
    }

    function getUserStaffNum() {
        return $('#userStaffNum').val();
    }

</script>
{{-- Laravel Mix - JS File --}}
{{--<script src="{{ mix('js/admin/public.js') }}"></script>--}}
<script src="/js/admin/public.js"></script>
</body>

<!--Tab菜单右键弹出菜单-->
<ul class="rightMenu" id="rightMenu">
    <li data-type="fresh">刷新</li>
    <li data-type="current">关闭当前</li>
    <li data-type="other">关闭其它</li>
    <li data-type="all">关闭所有</li>
</ul>
</html>
