import {Component, OnInit, EventEmitter} from '@angular/core'; import {DialogRef, ModalComponent, CloseGuard} from 'ngx-modialog'; import {BSModalContext} from 'ngx-modialog/plugins/bootstrap'; import UtilService from "@common/services/util/index"; import SiteRouterService from "@common/modules/manage/services/siteRouter"; declare var $: any; export class RouteSelectTreeContext extends BSModalContext { constructor(private args: any = {}) { super(); /* * 点击背景是否隐藏模态框 * @value true 不隐藏 * @value false 隐藏 * */ this.isBlocking = false; /* * 模态框位置 * @value modal-top 居顶 * */ this.dialogClass = 'modal-dialog modal-top routeSelectTree'; } } @Component({ selector: 'routeSelectTree', templateUrl: './template.html', styleUrls: ['./style.less'] }) export default class RouteSelectTree implements OnInit, ModalComponent { data: any = {}; otherData: any = {}; context: any = {}; list: any = []; constructor(public dialog: DialogRef, private siteRouterService: SiteRouterService, private utilService: UtilService) { this.context = dialog.context; } ngOnInit(): void { this.list = this.siteRouterService.siteMainNav; this.data.redirect = this.context.args.value; } submit() { this.context.args.callback(this.data.redirect); this.dialog.close(); } }