123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import { Component, OnInit, Output, Input } from '@angular/core';
- import { EventEmitter } from '@angular/core';
- import { Router } from "@angular/router";
- @Component({
- selector: 'app-select-menu',
- templateUrl: './select-menu.component.html',
- styleUrls: ['./select-menu.component.less']
- })
- export class SelectMenuComponent implements OnInit {
- @Output() cancelMenuModal = new EventEmitter();
- @Input() iShowMenuModal: boolean = false;//模态框
- allHospital: any;//所有院区
- hosLoading: boolean = false;//确定按钮的loading
- configurationCenterMenus: any[] = [];//配置中心菜单
- constructor(
- private router: Router,
- ) { }
- ngOnInit() {
- let menus = JSON.parse(localStorage.getItem("menu"));
- let configurationCenterMenus = [];
- // 事件配置
- let incidentConfig = menus.find(item => item.link == 'incidentConfig');
- incidentConfig && configurationCenterMenus.push(incidentConfig);
- // 三方配置
- let otherConfig = menus.find(item => item.link == 'otherConfig');
- otherConfig && configurationCenterMenus.push(otherConfig);
- // 系统配置
- let systemConfig = menus.find(item => item.link == 'systemConfig');
- systemConfig && configurationCenterMenus.push(systemConfig);
- // 业务页面控制
- let pageConfig = menus.find(item => item.link == 'pageConfig');
- pageConfig && configurationCenterMenus.push(pageConfig);
- this.configurationCenterMenus = configurationCenterMenus;
- }
- clickHandle(item){
- this.router.navigateByUrl(item.link);
- }
- // 隐藏模态框
- hideModal() {
- this.cancelMenuModal.emit(false)
- }
- }
|