﻿﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<html style="overflow-y:hidden">
<head>
    <title>首页-广东医科大学附属医院</title>
    <meta charset="utf-8">
    <!-- 解决部分兼容性问题，如果安装了GCF，则使用GCF来渲染页面，如果未安装GCF，则使用最高版本的IE内核进行渲染。 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">    <!-- 页面按原比例显示 -->
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <%--<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">--%>
    <%@ include file="/WEB-INF/jspf/common.jspf" %>
    <script type="text/javascript" src="${path}/static/js/menu.js"></script>
</head>
<style>
    .navbar-custom-menu > li >span {
        overflow: hidden;
        text-overflow: ellipsis;
        -o-text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 180px;
        height: 24px;
        display: block;
    }
    .blue {
        /*background: #c5dbec;最后一个参数设置透明度，前面三个是RGB颜色值*/
        background-color: rgba(255, 255, 255, 0.15);
        color: white;
    }
</style>

<script type="text/javascript">
    $(function () {
        //     $.ajaxSetup({
        //         contentType: "application/x-www-form-urlencoded;charset=utf-8",
        //         complete: function (XMLHttpRequest, textStatus) {
        //         },
        //         statusCode: {
        //             404: function () {
        //                 toastr.warning('数据获取/输入失败，没有此服务。404');
        //             },
        //             504: function () {
        //                 toastr.warning('数据获取/输入失败，服务器没有响应。504');
        //             },
        //             500: function () {
        //                 toastr.warning('服务器有误。500');
        //             }
        //         }
        //     });

        if (${menuList == null}) {
            // setTimeout(function () {
            $('#exampleModal').modal({
                backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                show: true//弹出对话框
            });
            //}, 14400000);
        }else{
            setTimeout(function () {
                $('#exampleModal').modal({
                    backdrop: 'static',//backdrop 为 static 时，点击模态对话框的外部区域不会将其关闭。
                    keyboard: false,//keyboard 为 false 时，按下 Esc 键不会关闭 Modal。
                    show: true//弹出对话框
                });
            }, 14400000);
            ajaxJsonFun();
        }
        function ajaxJsonFun() {
            //拥有的功能
            var str = "";
            //所属科室
            var depts = "";
            var deptNameArr=[];
            // 创建定时器，需要绑定事件，指定时间(ms)
            if (${menuList != null}) {
                var menuList = <%=session.getAttribute("menuList")%>;//${menuList == null} ? window.location.href = "login.jsp" :${menuList};
                if (menuList != "") {
                    if (menuList.code == 100) {
                        var list = menuList.extend.list;
                        if (list != null) {
                            var sysUL;
                            for (var i = 0; i < list.length; i++) {
                                if (list[0].deptId == list[i].deptId) {
                                    if (list[i].methodParent != 0 && (list[i].menuUrl == "#" || list[i].menuUrl == "" || list[i].menuUrl == null)) {
                                        var mulLi = newLiFun();
                                        var mulA = newAFun(list[i].menuName, list[i].menuIcon);
                                        mulLi.append(mulA);
                                        var menuAUL = newUlFun();
                                        //sysUL = liFun(list[i].menuName,list[i].menuIcon);
                                        /*菜单*/
                                        for (var j = 0; j < list.length; j++) {
                                            if (list[i].menuId == list[j].methodParent) {
                                                if (list[0].deptId == list[j].deptId) {
                                                    str = "";
                                                    depts = "";
                                                    /*功能值*/
                                                    for (var x = 0; x < list.length; x++) {
                                                        // console.log(list[x].methodType);
                                                        if (depts.indexOf(list[x].deptCode) == -1) {
                                                            if (depts != "") {//该步即不会第一位有逗号，也防止最后一位拼接逗号!
                                                                depts += ",";
                                                            }
                                                            depts += list[x].deptCode;
                                                        }
                                                        if (deptNameArr.indexOf(list[x].deptName) == -1) {
                                                            if(list[x].deptName!= undefined)
                                                                deptNameArr.push(list[x].deptName);
                                                        }
                                                        //console.log(list[x].methodParent + "=====" + list[j].menuId);
                                                        if (list[x].method != null && list[x].method != "" && list[x].methodParent == list[j].menuId) {
                                                            //console.log(list[x].methodParent+"====="+ list[j].menuId);
                                                            str += list[x].methodType + ",";
                                                        }
                                                    }
                                                    if (depts.indexOf("undefined") != -1) {
                                                        depts = "";
                                                    }
                                                    if (str.indexOf("undefined") != -1) {
                                                        str = "";
                                                    }

                                                    var menuALi = newAliFun(list[j].menuName, list[j].menuIcon, "/emr_medical_record" + list[j].menuUrl + "?num=" + str + "&depts=" + depts);

                                                    menuAUL.append(menuALi);
                                                    mulLi.append(menuAUL);
                                                }
                                            }
                                        }
                                        $('#indexTreeMenu').append(mulLi);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if(deptNameArr.length>0){
                $("#roleAndDept").attr("title", "${userSession}(" + deptNameArr.toString() + ")");
                $("#roleAndDept").html("${userSession}(" + deptNameArr.toString() + ")");
            }else{
                $("#roleAndDept").attr("title", "${userSession}");
                $("#roleAndDept").html("${userSession}")
            }


        };


        $("#stateBtn").click(function () {
            $('#exampleModal').modal('hide');  //手动关闭
        });

        $("ul.treeview-menu  li").on({
            click: function () {
                $("ul.treeview-menu  li").removeClass("blue");
                $(this).addClass("blue");
            }
        });
    });


</script>
<body class="skin-blue" data-spy="scroll" data-target="#scrollspy" style="margin-top:-20px;">
<div class="wrapper">
    <header class="main-header">
        <!-- Logo -->
        <a class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <%--<span class="logo-mini"><b>A</b>LT</span>--%>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>嘉时归档</b></span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li class="user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="${path}/static/bootstrap-3.3.7/dist/img/user2-160x160.jpg" class="user-image"
                                 alt="User Image">
                            <span class="hidden-xs" id="roleAndDept" title="">${userSession}</span>
                        </a>
                    </li>
                    <li>
                        <div class="margin">
                            <div class="btn-group">
                                <button type="button" class="btn btn-default" style="height:3rem;font-size: 14px;">主题</button>
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                                        aria-expanded="false" style="height:3rem">
                                    <span class="caret"></span>
                                    <span class="sr-only">Toggle Dropdown</span>
                                </button>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="#">帮助</a></li>
                                    <li><a href="#">联系我们</a></li>
                                    <li><a href="${POWER_URLHEAD}/gatewayPage">返回首页</a></li>
                                    <li class="divider"></li>
                                    <li><a href="${POWER_URLHEAD}/logout?token=${token}">退出登陆</a></li>
                                </ul>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <aside class="main-sidebar">
        <section class="sidebar">
            <!-- 菜单列表-->
            <ul id="indexTreeMenu" class="sidebar-menu" data-widget="tree">
                <%--<li class="active treeview">--%>
                <%--<a href="#">--%>
                <%--<i class="fa fa-dashboard"></i> <span>病案归档管理</span>--%>
                <%--<span class="pull-right-container">--%>
                <%--<i class="fa fa-angle-left pull-right"></i>--%>
                <%--</span>--%>
                <%--</a>--%>
                <%--<ul class="treeview-menu">--%>
                <%--<li><a href="${path}/inHosp/inHospitals" target="iFrame1"><i class="fa fa-circle-o"></i>在院浏览</a>   </li>--%>
                <%--<li><a href="${path}/beHosp/beHosps" target="iFrame1"><i class="fa fa-circle-o"></i>出院浏览</a></li>--%>
                <%--<li><a href="${path}/unfile/unfileMedicals" target="iFrame1"><i class="fa fa-circle-o"></i>未归档病历列表</a></li>--%>
                <%--<li><a href="${path}/fault/faults" target="iFrame1" ><i class="fa fa-circle-o"></i>缺陷列表</a></li>--%>
                <%--<li><a href="${path}/medicalRecall/recall" target="iFrame1"><i class="fa fa-circle-o"></i>病案召回</a></li>--%>
                <%--<li><a href="${path}/recallDate/recallDates" target="iFrame1"><i class="fa fa-circle-o"></i>病案召回日期</a></li>--%>
                <%--<li><a href="${path}/lastVerify/lastVerifys" target="iFrame1"><i class="fa fa-circle-o"></i>病案室审核(终审)</a></li>--%>
                <%--&lt;%&ndash;<li><a href="${path}/recallDate/recalltes" target="iFrame1"><i class="fa fa-circle-o"></i>病案归档统计</a></li>&ndash;%&gt;--%>
                <%--</ul>--%>
                <%--</li>--%>
                <%--<li class="active treeview">--%>
                <%--<a href="#">--%>
                <%--<i class="fa fa-dashboard"></i> <span>统计管理</span>--%>
                <%--<span class="pull-right-container">--%>
                <%--<i class="fa fa-angle-left pull-right"></i>--%>
                <%--</span>--%>
                <%--</a>--%>
                <%--<ul class="treeview-menu">--%>
                <%--&lt;%&ndash;<li><a href="${path}/pdfCtr/pdfDir" target="_blank"><i class="fa fa-circle-o"></i>缺陷PDF列表</a></li>&ndash;%&gt;--%>
                <%--<li><a href="${path}/vCount2/vCounts" target="iFrame1"><i class="fa fa-circle-o"></i>主管医生统计</a></li>--%>
                <%--</ul>--%>
                <%--</li>--%>
            </ul>
        </section>
    </aside>

    <div class="content-wrapper">
        <iframe style="height:calc(100vh - 80px);width:100%; overflow-x:hidden;overflow-y:hidden" id="iFrame1" name="iFrame1" frameborder="0"></iframe>
    </div>
    <!-- <footer class="main-footer">
         <div class="pull-right hidden-xs">
             <b>Version</b> 2.3.12
         </div>
         <strong>Copyright &copy; 2019-2020 嘉时软件.</strong> All rights
         reserved.
     </footer>-->
    <div class="control-sidebar-bg"></div>

</div><!-- ./wrapper -->

<%--确认框--%>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content ">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel">确认</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <input type="hidden" id="idT" name="idT" value=""/>
                        <label class="control-label">用户长时间未操作，请重新登录!</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <%--<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>--%>
                <button type="button" class="btn btn-primary btn-sm" id="stateBtn">确认</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>
