• 模块


    (function(window){  
        var module_index = 0;
        //var userMgr = new GeoESB.User();
        var loginUser = new GeoESB.LoginUser(GeoESB.ServiceConfig,"");
        $(document).ready(function(){

       
       


            loginUser.getUserInfo(function(data){
                if(data == null || data ==""){
                    return;
                }
                GeoESB.userInfo = data;

                //获取用户有权限的模块
                getPriModule();
            });

        });
        function getPriModule(){
            var url = _.str.sprintf(NavAssistance.ServiceConfig.CurrUserModule, GeoESB.userInfo.pkid);
            new GeoESB.AjaxCRUD(NavAssistance.ServiceConfig, NavAssistance.RootPath).get(url,function(result){
                var modules = result.data.modules[0];
                for(var i=0;i<modules.children.length;i++){
                    if(NavAssistance.RootPkid == modules.children[i].pkid){  //第一个pkid来自配置文件app-config
                        var modules_arr=modules.children[i].children;//共享平台下面的子模块  数组
                    }
                }


                var sidOrder = modules_arr.sort(
                    function(a, b)
                    {
                        if(a.orderindex < b.orderindex) return -1;
                        if(a.orderindex >= b.orderindex) return 1;
                        return 0;
                    }
                );
                $.each(sidOrder,
                    function(idx, value)
                    {
                        addModule(idx, value);
                    }
                );
            });
        }



        //展示导航模块
        function addModule(idx, module){
            var name = module.name;
            var checked = module.checked;
            var href = module.href+"?t="+Math.random();
            var css = module.css;

            if(null == css){css = "nav_default";}
            var htm = "<li";
            //if(idx >8){htm = "<li><div class='nav_pic_div hide'>";}

            htm+=" id='navId_"+css+"'>";
            htm +=name+"</li>";
            $("#navigation_div ul").append(htm);
            //if(checked == "0"){return;}
            $("#navId_"+css).click(function(){
                // window.open(href);
                window.location.href=href;
            });
        }
    })(window);

  • 相关阅读:
    手写堆排序和归并排序
    海量数据处理
    HDU 1532 --&&-- POJ1273 dinic 算法
    POJ 3159 最短路 SPFA
    POJ 1459 网络流 EK算法
    8.14比赛j题 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87813#overview
    单链表---邻接表
    poj 1273 ---&&--- hdu 1532 最大流模板
    HDU 2603 二分匹配
    UVA 796 连通图求桥
  • 原文地址:https://www.cnblogs.com/fu-fu/p/7364696.html
Copyright © 2020-2023  润新知