From aa303625312bfb1219083eb3ebaaa0f497fcc681 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Tue, 21 Jun 2022 16:41:36 +0800 Subject: [PATCH 1/3] =?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 --- src/app/system-management/menu/menu.component.html | 2 +- src/app/system-management/menu/menu.component.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/system-management/menu/menu.component.html b/src/app/system-management/menu/menu.component.html index ec58c4a..2250c30 100644 --- a/src/app/system-management/menu/menu.component.html +++ b/src/app/system-management/menu/menu.component.html @@ -27,7 +27,7 @@ 组织机构 操作 - diff --git a/src/app/system-management/menu/menu.component.ts b/src/app/system-management/menu/menu.component.ts index 24f4cbb..830ae34 100644 --- a/src/app/system-management/menu/menu.component.ts +++ b/src/app/system-management/menu/menu.component.ts @@ -41,6 +41,7 @@ export class MenuComponent implements OnInit { allOrList: any getAllOrganization() { + let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id let params = { OrganizationUnitId: OrganizationUnitId, @@ -59,6 +60,10 @@ export class MenuComponent implements OnInit { this.nodes = [...this.toTree.toTree(data.result.items)] this.defaultExpandedKeys = [this.nodes[0].id] this.defaultExpandedKeys = [...this.defaultExpandedKeys] + console.log(...this.nodes,444); + console.log(this.defaultExpandedKeys,45); + + }) } @@ -68,7 +73,7 @@ export class MenuComponent implements OnInit { defaultExpandedKeys = []; nodes: any[] = [] - + datas:any[]=[{id:0,title:"首页",children:[]},{id:1,title:"数字油站",children:[]},{id:2,title:"今日预警",children:[]},{id:3,title:"预警记录",children:[{title:'预警类型统计',isGasStation:true},{title:'卸油统计',isGasStation:true},{title:'证照预警统计',isGasStation:true}]},{id:4,title:"证照管理",children:[{title:'经营类证照',isGasStation:true},{title:'资产类证照',isGasStation:true},{title:'待办',isGasStation:true},{title:'审批记录',isGasStation:true}]}] addOr(node?: any) { console.log(node) From df0350f4fd9d4f25659936cbc77c91c3ec87c80b Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Tue, 21 Jun 2022 17:28:55 +0800 Subject: [PATCH 2/3] =?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 --- .../menu/addmenu/addmenu.component.html | 4 +-- .../menu/editmenu/editmenu.component.html | 4 +-- .../menu/menu.component.html | 2 +- .../system-management/menu/menu.component.ts | 25 ++++++++++--------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/app/system-management/menu/addmenu/addmenu.component.html b/src/app/system-management/menu/addmenu/addmenu.component.html index efaa6ba..980fb32 100644 --- a/src/app/system-management/menu/addmenu/addmenu.component.html +++ b/src/app/system-management/menu/addmenu/addmenu.component.html @@ -14,10 +14,10 @@ --> - + \ No newline at end of file diff --git a/src/app/system-management/menu/editmenu/editmenu.component.html b/src/app/system-management/menu/editmenu/editmenu.component.html index 77891a4..277bdcf 100644 --- a/src/app/system-management/menu/editmenu/editmenu.component.html +++ b/src/app/system-management/menu/editmenu/editmenu.component.html @@ -14,11 +14,11 @@ --> - + \ No newline at end of file diff --git a/src/app/system-management/menu/menu.component.html b/src/app/system-management/menu/menu.component.html index 2250c30..ec58c4a 100644 --- a/src/app/system-management/menu/menu.component.html +++ b/src/app/system-management/menu/menu.component.html @@ -27,7 +27,7 @@ 组织机构 操作 - diff --git a/src/app/system-management/menu/menu.component.ts b/src/app/system-management/menu/menu.component.ts index 830ae34..f674b0f 100644 --- a/src/app/system-management/menu/menu.component.ts +++ b/src/app/system-management/menu/menu.component.ts @@ -47,21 +47,22 @@ export class MenuComponent implements OnInit { OrganizationUnitId: OrganizationUnitId, IsContainsChildren: "true" } - this.http.get('/api/services/app/Organization/GetAll', { + this.http.get('/api/services/app/Menu/GetAll', { params: params }).subscribe((data: any) => { + this.totalCount = data.result.totalCount data.result.items.forEach(element => { element.key = element.id - element.title = element.displayName + element.title = element.name element.selectable = false }); this.allOrList = data.result.items this.nodes = [...this.toTree.toTree(data.result.items)] this.defaultExpandedKeys = [this.nodes[0].id] this.defaultExpandedKeys = [...this.defaultExpandedKeys] - console.log(...this.nodes,444); - console.log(this.defaultExpandedKeys,45); + // console.log(...this.nodes,444); + // console.log(this.defaultExpandedKeys,45); }) @@ -90,10 +91,10 @@ export class MenuComponent implements OnInit { let body = { parentId: node ? Number(node.key) : null, // code: instance.validateForm.value.code, - displayName: instance.validateForm.value.name, - isGasStation: instance.validateForm.value.isGasStation + name: instance.validateForm.value.name, + // isGasStation: instance.validateForm.value.isGasStation } - this.http.post('/api/services/app/Organization/Create', body).subscribe(data => { + this.http.post('/api/services/app/Menu/Create', body).subscribe(data => { resolve(data) this.message.create('success', '创建成功!'); this.nzTreeComponent.getExpandedNodeList().forEach((item) => { @@ -117,7 +118,7 @@ export class MenuComponent implements OnInit { } editOr(node) { - // console.log(node) + console.log(node) const modal = this.modal.create({ nzTitle: '编辑组织机构', nzContent: EditmenuComponent, @@ -134,10 +135,10 @@ export class MenuComponent implements OnInit { id: node.origin.id, parentId: node.origin.parentId, // code: instance.validateForm.value.code, - displayName: instance.validateForm.value.name, - isGasStation: instance.validateForm.value.isGasStation + name: instance.validateForm.value.name, + // isGasStation: instance.validateForm.value.isGasStation } - this.http.put('/api/services/app/Organization/Update', body).subscribe(data => { + this.http.put('/api/services/app/Menu/Update', body).subscribe(data => { resolve(data) this.message.create('success', '编辑成功!'); this.nzTreeComponent.getExpandedNodeList().forEach((item) => { @@ -169,7 +170,7 @@ export class MenuComponent implements OnInit { nzOkText: '确定', nzOkType: 'danger', nzOnOk: () => { - this.http.delete('/api/services/app/Organization/Delete', { + this.http.delete('/api/services/app/Menu/Delete', { params: { Id: item.origin.id } From 8c792fa0a9072f369e22c3e1fa0b1a3ea70a150d Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 22 Jun 2022 10:43:47 +0800 Subject: [PATCH 3/3] =?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 --- .../records-nav/records-nav.component.html | 2 +- .../records-nav/records-nav.component.ts | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/app/pages/records/records-nav/records-nav.component.html b/src/app/pages/records/records-nav/records-nav.component.html index 3c4e44d..63faa4d 100644 --- a/src/app/pages/records/records-nav/records-nav.component.html +++ b/src/app/pages/records/records-nav/records-nav.component.html @@ -4,7 +4,7 @@
- {{item}}
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 e36d826..8eb1544 100644 --- a/src/app/pages/records/records-nav/records-nav.component.ts +++ b/src/app/pages/records/records-nav/records-nav.component.ts @@ -13,10 +13,29 @@ export class RecordsNavComponent implements OnInit { isEcharts = true menuList = ['预警类型统计', '卸油统计', '证照预警统计'] - + userMenu = [] + menu=[] selectedMenu ngOnInit(): void { - + let a= sessionStorage.getItem('userdata') + this.userMenu=JSON.parse(a).menus + console.log( this.userMenu); + + 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]) + console.log( this.menu); + } + + } + + } + } this.selectedMenu = this.menuList[0] this.routerChange()