|
|
|
@ -9,11 +9,11 @@ import { Router } from '@angular/router';
|
|
|
|
|
export class NavigationComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor(private router: Router) { } |
|
|
|
|
userMenu=[] |
|
|
|
|
menu=[] |
|
|
|
|
tap=[] |
|
|
|
|
menuList1=[] |
|
|
|
|
menuList2=[] |
|
|
|
|
userMenu = [] |
|
|
|
|
menu = [] |
|
|
|
|
tap = [] |
|
|
|
|
menuList1 = [] |
|
|
|
|
menuList2 = [] |
|
|
|
|
menu1 = [ |
|
|
|
|
{ name: '首页', url: '/homepage' }, |
|
|
|
|
{ name: '数字油站', url: '/plan' }, |
|
|
|
@ -22,46 +22,49 @@ export class NavigationComponent implements OnInit {
|
|
|
|
|
{ name: '证照管理', url: '/audit' }, |
|
|
|
|
] |
|
|
|
|
menu3 = [ |
|
|
|
|
{ name: '组织机构管理', url: '/system/organization' ,img:'../../../assets/images/icon/organization.png'}, |
|
|
|
|
{ name: '用户管理', url: '/system/user' ,img:'../../../assets/images/icon/user.png'}, |
|
|
|
|
{ name: '角色管理', url: '/system/role' ,img:'../../../assets/images/icon/role.png'}, |
|
|
|
|
{ name: '分析主机管理', url: '/system/host' ,img:'../../../assets/images/icon/host.png'}, |
|
|
|
|
{ name: '推送管理', url: '/system/push' ,img:'../../../assets/images/icon/push.png'}, |
|
|
|
|
{ name: '经营类证照管理', url: '/system/updateOfLicense' ,img:'../../../assets/images/icon/license.png'}, |
|
|
|
|
{ name: '资产类证照管理', url: '/system/fileOfLicense' ,img:'../../../assets/images/icon/license.png'}, |
|
|
|
|
{ name: '菜单管理', url: '/system/menu' ,img:'../../../assets/images/icon/license.png'}, |
|
|
|
|
{ name: '组织机构管理', url: '/system/organization', img: '../../../assets/images/icon/organization.png' }, |
|
|
|
|
{ name: '用户管理', url: '/system/user', img: '../../../assets/images/icon/user.png' }, |
|
|
|
|
{ name: '角色管理', url: '/system/role', img: '../../../assets/images/icon/role.png' }, |
|
|
|
|
{ name: '分析主机管理', url: '/system/host', img: '../../../assets/images/icon/host.png' }, |
|
|
|
|
{ name: '推送管理', url: '/system/push', img: '../../../assets/images/icon/push.png' }, |
|
|
|
|
{ name: '经营类证照管理', url: '/system/updateOfLicense', img: '../../../assets/images/icon/license.png' }, |
|
|
|
|
{ name: '资产类证照管理', url: '/system/fileOfLicense', img: '../../../assets/images/icon/license.png' }, |
|
|
|
|
{ name: '菜单管理', url: '/system/menu', img: '../../../assets/images/icon/license.png' }, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
name |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
let a= sessionStorage.getItem('userdata') |
|
|
|
|
this.userMenu=JSON.parse(a).menus |
|
|
|
|
let a = sessionStorage.getItem('userdata') |
|
|
|
|
this.userMenu = JSON.parse(a).menus |
|
|
|
|
this.name = JSON.parse(a).name |
|
|
|
|
for (let index = 0; index < this.userMenu.length; index++) { |
|
|
|
|
let a=this.userMenu[index].name |
|
|
|
|
let a = this.userMenu[index].name |
|
|
|
|
this.tap.push(a) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
for (let index = 0; index < this.menu1.length; index++) { |
|
|
|
|
for (let k = 0; k < this.tap.length; k++) { |
|
|
|
|
if (this.tap[k]==this.menu1[index].name) { |
|
|
|
|
if (this.tap[k] == this.menu1[index].name) { |
|
|
|
|
this.menuList1.push(this.menu1[index]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// console.log(this.menuList1);
|
|
|
|
|
} |
|
|
|
|
for (let index = 0; index < this.menu3.length; index++) { |
|
|
|
|
if(JSON.parse(a).userName=="admin"){ |
|
|
|
|
this.menuList2=this.menu3 |
|
|
|
|
}else{ |
|
|
|
|
if (JSON.parse(a).userName == "admin") { |
|
|
|
|
this.menuList2 = this.menu3 |
|
|
|
|
} else { |
|
|
|
|
for (let k = 0; k < this.tap.length; k++) { |
|
|
|
|
if (this.tap[k]==this.menu3[index].name) { |
|
|
|
|
this.menuList2.push(this.menu3[index])
|
|
|
|
|
|
|
|
|
|
if (this.tap[k] == this.menu3[index].name) { |
|
|
|
|
this.menuList2.push(this.menu3[index]) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
signOut() { |
|
|
|
|
this.router.navigate(['/login']) |
|
|
|
|