hjg
2023-11-18 bb48edb3d9faaaeab0088151c86fc24137acdb08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var basic=""
jQuery(document).ready(function($) {
    lfetmenus()
});
 
//退出登录
function logout(){
    $.ajax({
        url: "/homepage/logout.htm",
        async: false,
        success:function(result){
            location.href = "/login.jsf";
        }
    });
}
 
function lfetmenus(){
    var path=window.document.location.pathname;
    jQuery.post(basic+'/admin/menucon/ftmenu.htm', {title:'lftmenus'}, function(data, textStatus, xhr) {
        if(data==null)
            return;
        var navlist=$('ul.nav-list');
        navlist.empty();
        var li_parent=null;
        var ul_child=null;
        var li_child=null;
        var li_parent_lft=0;
        var li_parent_rgt=0;
        jQuery.each(data, function(index, val) {
          var lft=val.lft;
          var rgt=val.rgt;
          if(lft<li_parent_rgt)
          {
              if(val.trget!=null&&val.trget!='')
                  li_child=jQuery('<li> <a href="'+val.url+'"> <i class="icon-double-angle-right"></i> '+val.title+' </a> </li>').appendTo(ul_child); 
              else
                  li_child=jQuery('<li> <a href="'+val.url+'" target="'+val.trget+'"> <i class="icon-double-angle-right"></i> '+val.title+' </a> </li>').appendTo(ul_child); 
          }else{
              li_parent=jQuery('<li></li>').appendTo(navlist);
              ul_child=null;
              var a=jQuery('<a href="javascript:void(0);" class="dropdown-toggle"></a>').appendTo(li_parent);
              var i=jQuery('<i class="'+val.icon+'"></i>').appendTo(a);
              var span=jQuery('<span class="menu-text">'+val.title+'</span>').appendTo(a);
              var b=jQuery('<b class="arrow icon-angle-down"></b>').appendTo(a);
              li_parent_lft=lft;
              li_parent_rgt=rgt;
              if(rgt-lft>1)
              {
                  ul_child=jQuery('<ul class="submenu"></ul>').appendTo(li_parent);
              }else{
                  a.removeClass('dropdown-toggle');
                  if(val.url!=null&&val.url!='')
                  {
                      a.attr('href',val.url);
                  }
              }
          }
          if(val.url!=null&&val.url.indexOf(path)>=0)
          {
              li_parent.addClass('active');
              li_parent.addClass('open');
              if(li_child!=null)
                  li_child.addClass('active');
          }
        });
    },'json');
}
 
function isItems(items) {
    return ($.isArray(items) && items.length > 0) ? true : false;
}