main.jsp 10.5 KB
<%@page import="com.framework.util.PropertiesLoader"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>保税航材库管理系统</title> 
	<link href="<%=request.getContextPath() %>/resource/library/css/base.css" rel="stylesheet">
	<link href="<%=request.getContextPath() %>/resource/library/css/platform.css" rel="stylesheet">
	<link rel="stylesheet" href="<%=request.getContextPath() %>/resource/library/easyui/uimaker/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/library/easyui/uimaker/icon.css">
	<script type="text/javascript" src="<%=request.getContextPath() %>/resource/library/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/resource/library/easyui/jquery.easyui.min.js"></script>
    <!-- <script type="text/javascript" src="<%=request.getContextPath() %>/resource/library/js/menu.js"></script> -->
    <script type="text/javascript" src="<%=request.getContextPath() %>/resource/library/js/main.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/resource/library/layer-v3.0.3/layer/layer.js"></script>
    <style type="text/css">
    	.tabs-panels{
    		padding: 10px 5px 5px 10px
    	}
    </style>
</head> 
<body>
    <div class="container">
        <div id="pf-hd">
            <div class="pf-logo" style="border-right: none;width: auto;">
			    <%-- <h1 style="font-size:24px;color:white;">保税航材库管理系统 <a style="font-size: 15px;">(当前账册号:${book.bookNo })</a></h1> --%>
                <a href="<%=PropertiesLoader.get("sso_main") %>"><img src="<%=request.getContextPath()%>/resource/library/images/main/main_logo.png" alt="logo" style="height: 70px;"></a>
            </div>
            
            <div class="pf-user">
                <div class="pf-user-photo">
                    <img src="<%=request.getContextPath() %>/resource/library/images/main/user.png" alt="">
                </div>
                <h4 class="pf-user-name ellipsis">Admin</h4>
                <i class="iconfont xiala">&#xe607;</i>

                <div class="pf-user-panel">
                    <ul class="pf-user-opt">
                    	<%-- <li>
                            <a href="javascript:;" onclick="window.location.href='<%=request.getContextPath()%>/book/list'">
                                <i class="iconfont">&#xe69c;</i>
                                <span class="pf-opt-name">切换账册</span>
                            </a>
                        </li> --%>
                         <li class="" onclick="window.location.href='<%=request.getContextPath()%>/book/list'">
                            <a>
                                <i class="iconfont">&#xe69c;</i>
                                <span class="pf-opt-name">切换账册</span>
                            </a>
                        </li>
                        <li class="pf-logout" onclick="window.location.href='<%=request.getContextPath()%>/login'">
                            <a>
                                <i class="iconfont">&#xe60e;</i>
                                <span class="pf-opt-name">退出</span>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <div id="pf-bd">
            <div id="pf-sider">
                <h2 class="pf-model-name">
                   <!--  <span class="iconfont">&#xe64a;</span> -->
                    <span class="pf-name"></span>
                    <span class="toggle-icon"></span>
                </h2>

                <ul class="sider-nav">
                	<c:forEach var="parent" items="${menuList}">
	                	<li class='<c:if test="${parent.menuId==currentMainMenu }">current</c:if>'>
	                        <a href="javascript:;">
	                            <span class="iconfont "></span>
	                            <span class="sider-nav-title">${parent.menuName }</span>
	                            <i class="iconfont">&#xe642;</i>
	                        </a>
	                        <ul class="sider-nav-s">
	                        <c:forEach var="child" items="${parent.childList}">
	                        	 <li class="<c:if test="${child.menuId==currentMenu }">active</c:if>"><a href="<%=request.getContextPath() %>${child.menuUrl}" class="menuUrl" id="menuUrl_${child.menuId }">${child.menuName }</a></li>
	                        </c:forEach>
	                        </ul>
	                     </li>
                	 </c:forEach>
                 </ul> 
            </div>

            <div id="pf-page">
                <div class="easyui-tabs1" style="width:100%;height:100%;">
                  <%if(false){ %>
                  <div title="列表页面" data-options="closable:false" style="padding:10px 5px 5px 10px;">
                    <iframe class="page-iframe" src="" frameborder="no"   border="no" height="100%" width="100%" scrolling="auto"></iframe>
                  </div>
                  
				  <div title="表单页面" data-options="closable:true" style="padding:10px 5px 5px 10px;">
                    <iframe class="page-iframe" src="http://www.baidu.com" frameborder="no"   border="no" height="100%" width="100%" scrolling="auto"></iframe>
                  </div>
                  
				  <div title="详情页面" data-options="closable:true" style="padding:10px 5px 5px 10px;">
                    <iframe class="page-iframe" src="read.html" frameborder="no"   border="no" height="100%" width="100%" scrolling="auto"></iframe>
                  </div>

				  <div title="正式写法" data-options="closable:true" style="padding:10px 5px 5px 10px;" href="providers.html">
                  <%} %>
                  </div>
                </div>
            </div>
        </div>
      
	   <div id="pf-ft">
            <div class="system-name">
              <i class="iconfont">&#xe6fe;</i>
              <span>保税仓系统&nbsp;v1.0</span>
            </div>
            <div class="copyright-name">
              <span>CopyRight&nbsp;2017&nbsp;&nbsp;&nbsp;版权所有:河南省机场集团有限公司</span>
              <i class="iconfont" >&#xe6ff;</i>
            </div>
        </div>
    </div>

    <!--[if IE 7]>
      <script type="text/javascript">
        $(window).resize(function(){
          $('#pf-bd').height($(window).height()-76);
        }).resize();
        
      </script>
    <![endif]-->  

    <script type="text/javascript">
    function changeMenuActive(obj){
    	$('.active').removeClass('active');
    	$(obj).parent().addClass('active');
    }
    $('.easyui-tabs1').tabs({
      tabHeight: 44,
      onSelect:function(title,index){
        var currentTab = $('.easyui-tabs1').tabs("getSelected");
        if(currentTab.find("iframe") && currentTab.find("iframe").size()){
            currentTab.find("iframe").attr("src",currentTab.find("iframe").attr("src"));
        }
      }
    })
    $(window).resize(function(){
          $('.tabs-panels').height($("#pf-page").height()-46);
          $('.panel-body').height($("#pf-page").height()-76)
    }).resize();

    var page = 0,
        pages = ($('.pf-nav').height() / 70) - 1;

    if(pages === 0){
      $('.pf-nav-prev,.pf-nav-next').hide();
    }
    $(document).on('click', '.pf-nav-prev,.pf-nav-next', function(){


      if($(this).hasClass('disabled')) return;
      if($(this).hasClass('pf-nav-next')){
        page++;
        $('.pf-nav').stop().animate({'margin-top': -70*page}, 200);
        if(page == pages){
          $(this).addClass('disabled');
          $('.pf-nav-prev').removeClass('disabled');
        }else{
          $('.pf-nav-prev').removeClass('disabled');
        }
        
      }else{
        page--;
        $('.pf-nav').stop().animate({'margin-top': -70*page}, 200);
        if(page == 0){
          $(this).addClass('disabled');
          $('.pf-nav-next').removeClass('disabled');
        }else{
          $('.pf-nav-next').removeClass('disabled');
        }
        
      }
    })
    
    $(document).ready(function(){
    	$('.menuUrl').click(function(){
    		if($(this).attr('href').indexOf('#')>-1){
    			return false;
    		}
    		if($(this).attr('href')!=''){
    			//$('.page-iframe')[0].src=$(this).attr('href');
    			addTab($(this).html()+"||"+$(this).attr('href'),this);
        		changeMenuActive(this);
    		}
    		return false;
    	});
    	$('#menuUrl_${currentMenu }').click();
    	
    	var par = {};
    	$.post("<%=request.getContextPath()%>/checkDataAlert", par, function(result) {
    		if(result.status==200){
    			if(result.data==1){
    				layer.open({
  	        		  type: 2,
  	        		  title:'有效期警告',
  	        		  area: ['800px', '480px'],
  	        		  shadeClose: true, //点击遮罩关闭
  	        		  content: '<%=request.getContextPath()%>/alertData'
  	        		  });
    			}
    		}
		});
    });
    
    var centerTabs= $('.easyui-tabs1').tabs({
	      tabHeight: 44,
	      onSelect:function(title,index){
		        var currentTab = $('.easyui-tabs1').tabs("getSelected");
		        //if(currentTab.find("iframe") && currentTab.find("iframe").size()){
		            //currentTab.find("iframe").attr("src",currentTab.find("iframe").attr("src"));
		        //}
		        
		        //左侧菜单联动
	      }
  })
  
  $(window).resize(function(){
        $('.tabs-panels').height($("#pf-page").height()-46);
        $('.panel-body').height($("#pf-page").height()-76)
  }).resize();

  //tab 联动
  function addTab(node,obj) {
  	var nodes=node.split("||");
		if(centerTabs.tabs('exists', nodes[0])){
			centerTabs.tabs('select',nodes[0]);
			var currentTab = $('.easyui-tabs1').tabs("getSelected");
			currentTab.find("iframe").attr("src",currentTab.find("iframe").attr("src"));
		}else{
			centerTabs.tabs('add',{
					title:nodes[0],
					closable:true,
					content:"<iframe class='page-iframe' src='"+nodes[1]+"' frameborder='no'   border='no' height='100%' width='100%' scrolling='auto'></iframe>"
			});
		}
  }

    </script>
</body> 
</html>