From 2033b669e0e6567dcfca3783be2e7c4170c0b7c0 Mon Sep 17 00:00:00 2001
From: cpf <1105965053@qq.com>
Date: Wed, 22 Jun 2022 16:15:28 +0800
Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../audit/audit-nav/audit-nav.component.html | 10 +++---
.../audit/audit-nav/audit-nav.component.ts | 32 +++++++++++++++++--
.../records-nav/records-nav.component.ts | 17 +++++++---
3 files changed, 47 insertions(+), 12 deletions(-)
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 @@
- {{item}}
预警规则
@@ -13,10 +13,10 @@
\ 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()
}