菜单折叠,tab栏折叠
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
|
||||
import { BasicDataService } from './basic-data-service'
|
||||
import { BasicDataService } from './basic-data-service';
|
||||
import { HttpClientService } from '../services/http-client.service';
|
||||
|
||||
import { map, filter, mergeMap } from 'rxjs/operators';
|
||||
import { pipe } from 'rxjs'
|
||||
import { ToastService } from '../components/toast/toast.service';
|
||||
import { ToastConfig, ToastType } from '../components/toast/toast-model';
|
||||
|
||||
import { filter } from 'rxjs/operators';
|
||||
// import 'rxjs/add/operator/map';
|
||||
// import 'rxjs/add/operator/mergeMap';
|
||||
|
||||
@@ -13,7 +16,7 @@ import { pipe } from 'rxjs'
|
||||
styleUrls: ['./pages.component.scss']
|
||||
})
|
||||
export class PagesComponent implements OnInit {
|
||||
|
||||
public menuClose: boolean = false;
|
||||
menuData = [
|
||||
{
|
||||
"name": "航班动态",
|
||||
@@ -185,9 +188,10 @@ export class PagesComponent implements OnInit {
|
||||
}]
|
||||
constructor(
|
||||
private router: Router,
|
||||
private basicDataService:BasicDataService,
|
||||
private activatedRoute: ActivatedRoute
|
||||
) {
|
||||
private basicDataService: BasicDataService,
|
||||
private httpClient: HttpClientService,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.basicDataService.loadBasicData();
|
||||
}
|
||||
|
||||
@@ -203,6 +207,10 @@ export class PagesComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
toggleMenu() {
|
||||
this.menuClose = !this.menuClose;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
* @param item
|
||||
@@ -225,4 +233,14 @@ export class PagesComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
confirmLogout() {
|
||||
this.httpClient.post('/logout').subscribe(
|
||||
data => {
|
||||
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '退出系统成功!', 3000);
|
||||
this.toastService.toast(toastCfg);
|
||||
this.router.navigate(['/login']);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user