index.js 4.4 KB
Newer Older
Y
Your Name 已提交
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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
(function () {
    /*
     * author:广州银云信息科技有限公司
     * 全局sidebar指令相关js
     */
    angular.module('eolinker')
        .component('eoSidebar', {
            template: '<sidebar-common-component power-object="$ctrl.service.authority.permission.default" shrink-object="$ctrl.shrinkObject" main-object="$ctrl.data.component.sidebarCommonObject.mainObject"></sidebar-common-component>',
            controller: indexController,
            bindings: {
                shrinkObject: '<'
            }
        })

    indexController.$inject = ['$scope', 'Authority_CommonService'];

    function indexController($scope, Authority_CommonService) {

        var vm = this;
        vm.data = {
            component: {
                sidebarCommonObject: {}
            },
            info: {
                current: null,
                menu: [{
                        name: '首页',
                        sref: 'home.panel',
                        icon: 'icon-shouye_o',
                        power: -1,
                        status:'un-spreed'
                    },
                    {
                        name: '网关节点',
                        sref: 'home.cluster',
                        childSref: 'home.cluster.default',
                        icon: 'icon-yingyongAPP_o',
                        power: -1
                    }, {
                        name: '注册方式与负载',
                        sref: 'home.balance',
                        icon: 'icon-renwuzhongxin_o',
                        childSref: 'home.balance.service',
                        childSref: 'home.balance.list.default',
                        power: -1,
                        childList: [{
                                name: '服务注册方式',
                                sref: 'home.balance.service'
                            },
                            {
                                name: '负载配置',
                                sref: 'home.balance.list',
                                childSref:'home.balance.list.default',
                                params:{
                                    cluster:'default'
                                }
                            }
                        ]
                    }, {
                        name: '接口管理',
                        sref: 'home.project',
                        icon: 'icon-lianjie_o',
                        childSref: 'home.project.default',
                        power: -1
                    }, {
                        name: '访问策略',
                        sref: 'home.gpedit',
                        icon: 'icon-yuechi_o',
                        power: -1,
                        childSref: 'home.gpedit.default'
                    }, {
                        name: 'API监控设置',
                        sref: 'home.monitor',
                        icon: 'icon-yuechi_o',
                        power: -1
                    },
                    {
                        name: '扩展插件',
                        sref: 'home.plugin',
                        childSref: 'home.plugin.default',
                        icon: 'icon-cengji_o',
                        power: -1,
                    },
                    {
                        name: '网关设置',
                        sref:'home.setting',
                        icon: 'icon-quanjushezhi_o',
                        power: -1,
                        status:'un-spreed',
                        childList: [
                            {
                                name: '日志设置',
                                sref: 'home.setting.log'
                            }
                        ]
                    }
                    , {
                        name: '配置管理',
                        sref: 'home.publish',
                        icon: 'icon-liangliangduibi_o',
                        power: -1,
                    }
                ]
            }
        }
        vm.service={
            authority:Authority_CommonService
        }
        vm.$onInit = function () {
            vm.shrinkObject.isShrink = false;
            vm.data.component.sidebarCommonObject = {
                mainObject: {
                    baseInfo: {
                        menu: vm.data.info.menu
                    }
                }
            }
        }
    }

})();