10 changed files with 30 additions and 152 deletions
@ -1,26 +0,0 @@
|
||||
<div class="box"> |
||||
<div class="boxleft"> |
||||
<img style="width: 200px;" src="../../../assets/images/logo2.png" alt=""> |
||||
</div> |
||||
<!-- 登录信息按钮 --> |
||||
<div class="boxright"> |
||||
<span class="time"> |
||||
{{time}} |
||||
</span> |
||||
|
||||
<span style="margin: 0 18px;">|</span> |
||||
|
||||
<span style="margin-right: 8px;"> {{surname}} </span> |
||||
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'> |
||||
<img src="../../../assets/images/head.png" alt=""> |
||||
</a> |
||||
<nz-dropdown-menu #menu="nzDropdownMenu"> |
||||
<ul nz-menu nzSelectable> |
||||
<li *ngIf="isGasStation == 'true'" nz-menu-item (click)="navChange('/oliStationInfo')">基本信息</li> |
||||
<li *ngIf="isGasStation == 'true'" nz-menu-item (click)="navChange('/equipmentInfo')">器材信息</li> |
||||
<li *ngIf="userName == 'admin'" nz-menu-item (click)="navChange('/system/organization')">系统管理</li> |
||||
<li nz-menu-item (click)="signOut()">退出系统</li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</div> |
||||
</div> |
@ -1,27 +0,0 @@
|
||||
.box { |
||||
width: 100%; |
||||
height: 56px; |
||||
background: linear-gradient(#01142f, #0d2b4f); |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
color: #fff; |
||||
box-sizing: border-box; |
||||
padding: 0 20px; |
||||
color: #8aacce; |
||||
} |
||||
|
||||
.boxright { |
||||
display: flex; |
||||
align-items: center; |
||||
span { |
||||
font-size: 16px; |
||||
color: #FFFFFF; |
||||
opacity: 0.6; |
||||
} |
||||
|
||||
img { |
||||
width: 36px; |
||||
height: 36px; |
||||
} |
||||
} |
@ -1,86 +0,0 @@
|
||||
import { Component, OnInit, Output, EventEmitter } from '@angular/core'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import { Router, ActivatedRoute } from '@angular/router' |
||||
import { CacheTokenService } from '../../service/cache-token.service' //引入服务
|
||||
import { NzMessageService } from 'ng-zorro-antd/message'; |
||||
|
||||
|
||||
@Component({ |
||||
selector: 'app-tabbar', |
||||
templateUrl: './tabbar.component.html', |
||||
styleUrls: ['./tabbar.component.scss'] |
||||
}) |
||||
export class TabbarComponent implements OnInit { |
||||
|
||||
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, |
||||
private message: NzMessageService) { } |
||||
surname: string |
||||
userName: string |
||||
isGasStation: string |
||||
ngOnInit() { |
||||
setInterval(() => { |
||||
this.getTime() |
||||
}, 1000); |
||||
this.isGasStation = JSON.parse(sessionStorage.getItem('isGasStation')) |
||||
if (this.isGasStation == 'true') { |
||||
this.surname = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).name |
||||
this.userName = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).userName |
||||
} else { |
||||
this.surname = JSON.parse(sessionStorage.getItem('userdata')).name |
||||
this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
//获得时间
|
||||
time: string |
||||
getTime() { |
||||
let myDate = new Date(); |
||||
let y = myDate.getFullYear(); |
||||
let M = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
|
||||
let d = myDate.getDate(); //获取当前日(1-31)
|
||||
let h = myDate.getHours(); //获取当前小时数(0-23)
|
||||
let m = myDate.getMinutes(); //获取当前分钟数(0-59)
|
||||
let s = myDate.getSeconds(); //获取当前秒数(0-59)
|
||||
|
||||
//检查是否小于10
|
||||
M = check(M); |
||||
d = check(d); |
||||
h = check(h); |
||||
m = check(m); |
||||
s = check(s); |
||||
let timestr = y + "-" + M + "-" + d + " " + h + ":" + m + ":" + s; |
||||
this.time = timestr; |
||||
//时间数字小于10,则在之前加个“0”补位。
|
||||
function check(i) { |
||||
let num = (i < 10) ? ("0" + i) : i; |
||||
return num; |
||||
} |
||||
} |
||||
|
||||
//退出系统
|
||||
signOut() { |
||||
this.message.create('success', `退出成功`); |
||||
this.token.delete() |
||||
sessionStorage.clear() |
||||
// window.localStorage.clear()
|
||||
|
||||
localStorage.removeItem("isautologin") |
||||
this.router.navigate(['/login']) |
||||
} |
||||
|
||||
navChange(router) { |
||||
this.router.navigate([router]) |
||||
} |
||||
|
||||
|
||||
//修改密码
|
||||
changpsw() { |
||||
// let dialogRef = this.dialog.open(ChangepasswordComponent, { width: '348.000051px' });
|
||||
// dialogRef.afterClosed().subscribe();
|
||||
} |
||||
|
||||
|
||||
|
||||
} |
Loading…
Reference in new issue