|
|
|
@ -13,22 +13,29 @@ export class RecordsNavComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
isEcharts = true |
|
|
|
|
menuList = ['预警类型统计', '卸油统计', '证照预警统计'] |
|
|
|
|
tap=[] |
|
|
|
|
userMenu = [] |
|
|
|
|
menu=[] |
|
|
|
|
selectedMenu |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
let a= sessionStorage.getItem('userdata') |
|
|
|
|
this.userMenu=JSON.parse(a).menus |
|
|
|
|
console.log( this.userMenu); |
|
|
|
|
console.log(this.userMenu); |
|
|
|
|
for (let index = 0; index < this.userMenu.length; index++) { |
|
|
|
|
let a=this.userMenu[index].name |
|
|
|
|
this.tap.push(a) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
console.log(this.tap); |
|
|
|
|
|
|
|
|
|
if (this.userMenu.length==0) { |
|
|
|
|
this.menu=this.menuList |
|
|
|
|
}else{ |
|
|
|
|
for (let index = 0; index < this.menuList.length; index++) { |
|
|
|
|
|
|
|
|
|
for (let k = 0; k < this.userMenu.length; k++) { |
|
|
|
|
if (this.userMenu[k]==this.menuList[index]) { |
|
|
|
|
this.menu.push(this.userMenu[k])
|
|
|
|
|
for (let k = 0; k < this.tap.length; k++) { |
|
|
|
|
if (this.tap[k]==this.menuList[index]) { |
|
|
|
|
this.menu.push(this.tap[k])
|
|
|
|
|
console.log( this.menu); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -36,7 +43,7 @@ export class RecordsNavComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.selectedMenu = this.menuList[0] |
|
|
|
|
this.selectedMenu = this.menu[0] |
|
|
|
|
this.routerChange() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|