123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>首页</title>
- <meta name="description" content="">
- <meta name="keywords" content="">
- <!--include header base-->
- <meta name="author" content="Roobo:F2E">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
- <!-- Set render engine for 360 browser -->
- <meta name="renderer" content="webkit">
- <!--<link rel="icon" type="image/png" href="img/favicon/favicon.png">-->
- <!-- Add to homescreen for Chrome on Android -->
- <meta name="mobile-web-app-capable" content="yes">
- <!--<link rel="icon" type="image/png" sizes="192x192" href="img/favicon/android-icon-192x192.png">-->
- <!-- Add to homescreen for Safari on iOS -->
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <!--<link rel="apple-touch-icon-precomposed" href="img/favicon/favicon-57x57.png">-->
- <!-- Tile icon for Win8 (144x144 + tile color) -->
- <meta name="msapplication-TileImage" content="favicon.png">
- <meta name="msapplication-TileColor" content="#ffffff">
- <!------------------------------------------------------------------->
- <link rel="stylesheet" type="text/css" href="css/left-nav.css">
- <script type="text/javascript" src="js/lib/jquery-1.9.1/jquery.js" ></script>
- <script src="js/lib/jquery-1.9.1/jquery.min.js"></script>
- <script src="js/config/base_config.js"></script>
- <script src="js/lib/ajaxRedirect.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- localStorage.setItem("fname","");
- localStorage.setItem("name","");
- $("#menu_div").html("");
- loadMenuItem("menu_div",0,1,"");
- $.ajax({
- url: baseConfig.URL.menuList + "",
- type: "get",
- data:{rtype:"get",mtype:1,fid:-1,mrstatus:0},
- cache: false,
- success:function (res) {
- console.log(res);
- allFunction== new Array();
- $.each(res.list,function (index,item) {
- var f={
- id:item.id
- ,classname:item.classname+"."+item.methodname
- ,name:item.name
- };
- allFunction.push(f);
- });
- console.log(allFunction);
- },
- complete:function (XHR, TS) {
- },
- error:function (XMLHttpRequest, textStatus, errorThrown) {
- }
- });
- });
- var allFunction= new Array();
- var show_level=4; //显示层级
- //加载菜单栏 level
- function loadMenuItem(obj,fid,level,fname){
- if(level>show_level){
- return;
- }
- $.ajax({
- url: baseConfig.URL.menuList + "",
- type: "get",
- data:{fid:fid,rtype:"get",mtype:0},
- cache: false,
- success:function (res) {
- console.log(res);
- var nexLevel=level+1;
- $.each(res.list,function (index,item) {
- if(level==1){
- if (index != 0) {
- $("#" + obj).append('<div><div class="nav-left-01" >'
- + '<a href="#" onclick="clickLevel(this,' + "'" + item.name + "'" + ',' + "'" + item.address + "'" + ')"><img src="' + item.imgurl + '" onerror="this.src=' + "'" + 'img/icon01_n.png' + "'" + '">'
- + '<p>' + item.name + '</p>' +
- '<img class="icon-right" src="img/min.png">'
- + '</a></div>'
- + '<ul class="classification" id="menu_div_' + item.id + '"></ul></div>');
- } else $("#" + obj).append("<div class=\"left-top\"><img src=\"img/home.png\"><p onclick='firstpage()' style='cursor: pointer'>首页</p></div>")
- .append('<div><div class="nav-left-01">'
- + '<a href="#" onclick="clickLevel(this,' + "'" + item.name + "'" + ',' + "'" + item.address + "'" + ')"><img src="' + item.imgurl + '" onerror="this.src=' + "'" + 'img/icon01_n.png' + "'" + '">'
- + '<p>' + item.name + '</p>'
- + '<img class="icon-right" src="img/min.png">'
- + '</a></div>'
- + '<ul class="classification" id="menu_div_' + item.id + '"></ul></div>');
- }else {
- $("#"+obj).append('<li><a href="#" onclick="clickLevelSub(this,'+"'"+item.name+"'"+','+"'"+item.address+"'"+','+"'"+fname+"'"+')">'+item.name+'</a></li>');
- }
- loadMenuItem('menu_div_'+item.id,item.id,nexLevel,item.name);
- });
- },
- complete:function (XHR, TS) {
- },
- });
- }
- function clickLevel(obj,name,url){
- $.each($("#menu_div").find("div").find("div").find("a").find("img"),function (index,imgobj) {
- var imgurl=$(imgobj).attr("src");
- imgurl=imgurl.replace("_s.","_n.");
- $(imgobj).attr("src",imgurl);
- });
- $("#menu_div").find("div").find("div").removeClass("slt01");
- $("#menu_div").find("div").find("ul").find("li").removeClass("slt011");
- $(obj).parent().addClass("slt01");
- $(obj).parent().addClass("slt01");
- showOrHidden(obj);
- // $("#navTitle").html(name);
- // $("#navSubTitle").html('');
- localStorage.setItem("fname",'');
- localStorage.setItem("name",name);
- localStorage.setItem("url1", "");
- localStorage.setItem("url2", "");
- goto(url);
- }
- function clickLevelSub(obj,name,url,fname){
- $.each($("#menu_div").find("div").find("div").find("a").find("img"),function (index,imgobj) {
- var imgurl=$(imgobj).attr("src");
- imgurl=imgurl.replace("_s.","_n.");
- $(imgobj).attr("src",imgurl);
- });
- $("#menu_div").find("div").find("div").removeClass("slt01");
- $("#menu_div").find("div").find("ul").find("li").removeClass("slt011");
- $(obj).parent().addClass("slt011");
- // $("#navTitle").html(fname);
- // $("#navSubTitle").html(name);
- localStorage.setItem("fname",fname);
- localStorage.setItem("name",name);
- if(name == "报名管理"){
- localStorage.setItem("url1", url);
- localStorage.setItem("url2", url);
- } else {
- localStorage.setItem("url1", "");
- localStorage.setItem("url2", "");
- }
- goto(url);
- }
- //显示或隐藏
- function showOrHidden(obj){
- if($(obj).parent().parent().children("ul").is(":hidden")){
- $(obj).children("img").eq(1).attr("src","img/min.png");
- }else{
- $(obj).children("img").eq(1).attr("src","img/add1.png");
- }
- $(obj).parent().parent().children("ul").toggle();
- }
- // 跳转
- function goto(url){
- if(url==""||url=="#") return;
- window.parent.document.getElementById('contentH').src='content.html?url='+url;
- }
- function firstpage() {
- $(window.parent.document).contents().find("#contentH")[0].contentWindow.tofirst();
- }
- </script>
- </head>
- <body>
- <div class="left">
- <div id="menu_div">
- <!--左边导航 一级菜单用div写的,二级菜单用ul写的,
- 选中的菜单,文字颜色改变,添加class="slt01"图标颜色改变,替换为_s图标 -->
- <div class="left-top" >
- <img src="img/home.png">
- <p>首页adasdas</p>
- </div>
- <div class="nav-left-01">
- <a href="">
- <img src="img/os.png">
- <p>系统管理</p>
- <img class="icon-right" src="img/add1.png"><!--二级菜单展开时隐藏display:none-->
- <img class="icon-right" src="img/min.png" style="display: none"><!--二级菜单展开时显示display:block-->
- </a>
- </div>
- <ul class="classification">
- <li><a href=""> 用户管理 </a></li>
- <li><a href=""> 角色管理 </a></li>
- </ul>
- </div>
- </div>
- </body>
- </html>
|