diff --git a/src/app/pages/audit/audit-nav/audit-nav.component.html b/src/app/pages/audit/audit-nav/audit-nav.component.html index f339bf3..58a8928 100644 --- a/src/app/pages/audit/audit-nav/audit-nav.component.html +++ b/src/app/pages/audit/audit-nav/audit-nav.component.html @@ -4,7 +4,7 @@
- - - - + + + +
\ No newline at end of file diff --git a/src/app/pages/audit/audit-nav/audit-nav.component.ts b/src/app/pages/audit/audit-nav/audit-nav.component.ts index fdee4fe..fc9f39e 100644 --- a/src/app/pages/audit/audit-nav/audit-nav.component.ts +++ b/src/app/pages/audit/audit-nav/audit-nav.component.ts @@ -9,9 +9,11 @@ export class AuditNavComponent implements OnInit { constructor() { } - + tap=[] + userMenu = [] + menu=[] navList = ['经营类证照', '资产类证照','待办', '审批记录'] - selectedItem = '经营类证照' + selectedItem selectNav(item) { this.selectedItem = item } @@ -19,6 +21,32 @@ export class AuditNavComponent implements OnInit { isLevel ngOnInit(): void { + let a= sessionStorage.getItem('userdata') + this.userMenu=JSON.parse(a).menus + 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.navList + }else{ + for (let index = 0; index < this.navList.length; index++) { + + for (let k = 0; k < this.tap.length; k++) { + if (this.tap[k]==this.navList[index]) { + this.menu.push(this.tap[k]) + console.log( this.menu); + } + + } + + } + } + this.selectedItem = this.menu[0] this.isLevel = JSON.parse(sessionStorage.getItem('userdata')).organization.level } diff --git a/src/app/pages/records/records-nav/records-nav.component.ts b/src/app/pages/records/records-nav/records-nav.component.ts index 8eb1544..ba04503 100644 --- a/src/app/pages/records/records-nav/records-nav.component.ts +++ b/src/app/pages/records/records-nav/records-nav.component.ts @@ -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() }