<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ page import="com.emr.entity.Power_User" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<html >
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv=X-UA-Compatible IE=EmulateIE7>
    <title>病案数码影像信息管理系统</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <%@ include file="/WEB-INF/jspf/common.jspf" %>
    <!--[if lt IE 9]>
    <style>
        .container-fluid {
            height: 1000px;
        }
    </style>
    <![endif]-->
    <style>
        .navbar-custom-menu {
            padding-right: 20px;
        }

        .hidden-xs {
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .logo {
            height: 59px !important;
        }
        .container-fluid {
            margin: 0;
            padding: 0;
        }
        .indexSelected {
            background-color: #42515F;
        }
        #indexTreeMenu:hover{
            overflow-y: auto;
            overflow-x: hidden;
        }
        #indexTreeMenu::-webkit-scrollbar{
            display: none;
        }
    </style>
    <%
        String POWER_URLHEAD = (String) request.getParameter("POWER_URLHEAD");
        String POWER_JSP = (String) request.getParameter("POWER_JSP");
        String token = (String) request.getSession().getAttribute("token");
        Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
        Set<String> menus = user.getMenus();
        Integer approvePower = 0;
        for(String menu : menus){
            if(StringUtils.isNoneBlank(menu) && "/approve/updateApprove".equals(menu)){
                approvePower = 1;
                break;
            }
        }
//        String token = (String)request.getParameter("token");
        String WEBSOCKET_URLHEAD = (String) request.getParameter("WEBSOCKET_URLHEAD");
        String STR_SPLIT = (String) request.getParameter("STR_SPLIT");
    %>
    <script type="text/javascript">
        var path = "${path}"
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini" onkeydown="disabledPrint()">
<input type="hidden" id="token" value="<%=token%>"/>
<input type="hidden" id="roleId" value="${CURRENT_USER.roleId}"/>
<!--webSocket所需-->
<input type="hidden" id="userId" value="${CURRENT_USER.userId}"/>
<input type="hidden" id="userName" value="${CURRENT_USER.userName}"/>
<input type="hidden" id="POWER_URLHEAD" value="<%=POWER_URLHEAD%>">
<input type="hidden" id="POWER_JSP" value="<%=POWER_JSP%>">
<input type="hidden" id="webSocketUrl" value="<%=WEBSOCKET_URLHEAD%>">
<input type="hidden" id="strSplit" value="<%=STR_SPLIT%>">
<!--是否审批权限-->
<input type="hidden" id="approvePower" value="<%=approvePower%>">
<!--审批列表的链接地址-->
<input type="hidden" id="approveUrl">
<div class="wrapper">
    <header class="main-header">
        <!--logo-->
        <div class=" logo">
            <%--<div class="pull-left image" style="align-content: baseline;">
                <img src="${path}/static/bootstrap-3.3.7/dist/img/credit/paypal.png"
                     style="height:70%;width: 70%;margin-top:0.25rem;"
                     class="user-image" alt="User Image">
            </div>--%>
            <div class="pull-left info" style="width: 100%">
                <p>病案数码影像信息管理系统</p>
            </div>
        </div>
        <nav class="navbar navbar-static-top">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li class="user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="noticeManage1(-1)">
                            <span class="label label-warning" id="noticeCount">0</span>
                            <i class="fa fa-envelope-o" style="font-size: 25px;"></i>
                        </a>
                    </li>
                    <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">
                            <c:choose>
                                <c:when test="${CURRENT_USER.remark == '' || CURRENT_USER.remark == null || CURRENT_USER.remark == 'null'}">
                                    <c:choose>
                                        <c:when test="${CURRENT_USER.userPosition != null && CURRENT_USER.userPosition != '' && CURRENT_USER.userPosition != 'null'}">
                                            <p class="hidden-xs"
                                               title="${CURRENT_USER.userPosition}">${CURRENT_USER.userPosition}</p>
                                        </c:when>
                                        <c:otherwise>
                                            <p class="hidden-xs"
                                               title="${CURRENT_USER.userName}">${CURRENT_USER.userName}</p>
                                        </c:otherwise>
                                    </c:choose>
                                </c:when>
                                <c:otherwise>
                                    <c:choose>
                                        <c:when test="${CURRENT_USER.userPosition != null && CURRENT_USER.userPosition != '' && CURRENT_USER.userPosition != 'null'}">
                                            <p class="hidden-xs"
                                               title="${CURRENT_USER.userPosition}(${CURRENT_USER.remark})">${CURRENT_USER.userPosition}(${CURRENT_USER.remark})</p>
                                        </c:when>
                                        <c:otherwise>
                                            <p class="hidden-xs"
                                               title="${CURRENT_USER.userName}(${CURRENT_USER.remark})">${CURRENT_USER.userName}(${CURRENT_USER.remark})</p>
                                        </c:otherwise>
                                    </c:choose>
                                </c:otherwise>
                            </c:choose>
                        </a>
                    </li>
                    <li>
                        <div class="margin">
                            <div class="btn-group">
                                <button type="button" class="btn btn-default">操作</button>
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                                        aria-expanded="false" style="height:34px">
                                    <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_JSP %>/gatewayPage">返回主页</a></li>
                                    <li class="divider"></li>
                                    <li><a href="<%= POWER_JSP %>/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><a href="${path}/commom/test" target="iFrame1"><i class="fa fa-circle-o"></i>测试页</a></li>--%>
                <%--  <li><a href="${path}/commom/showRecord?patientId=3d2c5fb596764cdb89b247b138de8a0b" target="iFrame1"><i class="fa fa-circle-o"></i>病案浏览测试页</a></li>--%>
                <%-- <li><a href="${path}/commom/showRecord?patientId=00000A70E4584D048F866BB75112EBBC" target="iFrame1"><i class="fa fa-circle-o"></i>病案浏览测试页</a></li>--%>
                <%--
                                <li><a href="${path}/commom/showRecord?patientId=0f6e6941028c44b8b8ea070f27480416" target="iFrame1"><i class="fa fa-circle-o"></i>病案浏览测试页</a></li>
                --%>
                <%--<li><a href="${path}/commom/showRecord?patientId=2AE9566F20AB430DB6DD6F6A88F1DCDA" target="iFrame1"><i class="fa fa-circle-o"></i>病案浏览测试页</a></li>--%>
                <%--<li><a href="${path}/commom/showRecord?patientId=00001EEDE74747709805E88A410496AE" target="iFrame1"><i class="fa fa-circle-o"></i>病案浏览测试页</a></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">
                        <li><a href="${path}/template/templateList" target="iFrame1"><i class="fa fa-circle-o"></i>自定义模板</a></li>
                        <li><a href="${path}/template/templateSelectList" target="iFrame1"><i class="fa fa-circle-o"></i>自定义模板选择</a></li>
                        <li><a href="${path}/template/customSearchList" target="iFrame1"><i class="fa fa-circle-o"></i>自定义查询</a></li>
                        <li><a href="${path}/printing/printManage" target="iFrame1"><i class="fa fa-circle-o"></i>打印用途管理</a></li>
                        <li><a href="${path}/commom/commomList" target="iFrame1"><i class="fa fa-circle-o"></i>常用查询</a></li>
                        <li><a href="${path}/commom/showRecord?patientId=2AE9566F20AB430DB6DD6F6A88F1DCDA" target="iFrame1"><i class="fa fa-circle-o"></i>病案浏览测试页</a></li>
                    </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">
                        <li><a href="${path}/distribution/userDistributionManage" target="iFrame1"><i class="fa fa-circle-o"></i>用户分配调阅</a></li>
                        <li><a href="${path}/distribution/roleDistributionManage" target="iFrame1"><i class="fa fa-circle-o"></i>角色分配调阅</a></li>
                    </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">
                        <li><a href="${path}/collect/collectManage" target="iFrame1"><i class="fa fa-circle-o"></i>个人收藏</a></li>
                        <li><a href="${path}/annotationTemplate/annotationTemplateList" target="iFrame1"><i class="fa fa-circle-o"></i>原因及批注模板</a></li>
                        <li><a href="${path}/approve/approveList" target="iFrame1"><i class="fa fa-circle-o"></i>申请列表</a></li>
                        <li><a href="${path}/approve/approveManageList" target="iFrame1"><i class="fa fa-circle-o"></i>借阅审批管理</a></li>
                    </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">
                        <li><a href="${path}/dictionary/dictionaryList" target="iFrame1"><i class="fa fa-circle-o"></i>字典列表</a></li>
                        <li><a href="${path}/otherManage/backupDatabase" target="iFrame1"><i class="fa fa-circle-o"></i>备份数据库</a></li>
                    </ul>
                </li>--%>
            </ul>
        </section>
    </aside>

    <div class="content-wrapper">
        <section class="content">
            <!-- 内容 -->
            <div class="page-content-wrapper">
                <div class="page-content">
                    <div class="container-fluid">
                        <iframe class="row-fluid" style="width:100%;"
                                id="iFrame1" name="iFrame1" scrolling="yes" frameborder="0"></iframe>
                    </div>
                </div>
            </div>

        </section>
    </div>
    <!-- 底部版权-->
    <%--<footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 20200211
        </div>
        <strong>Copyright &copy; 2019-2090 厦门嘉时软件.</strong> All rights
        reserved.
    </footer>--%>
</div>
<script type="text/javascript" src="${path}/static/js/menu.js?time=2019-12-15"></script>
<%@ include file="/WEB-INF/jspf/webSocket.jspf" %>
<script>
    $(document).ready(function () {
        const headerHeight = $(".main-header").height() || 0;
        const footerHeight = ($(".main-footer").height() || 0) + 31;
        const windowHeight = $(window).height();
        $("#iFrame1").css("height", windowHeight - headerHeight - footerHeight - 37);
        $("#indexTreeMenu").css("height",windowHeight - headerHeight);
    })
</script>
</body>
</html>
