diff --git a/src/app/pages/audit/audit-ing/audit-ing.component.html b/src/app/pages/audit/audit-ing/audit-ing.component.html
index 1c99130..7e7aac1 100644
--- a/src/app/pages/audit/audit-ing/audit-ing.component.html
+++ b/src/app/pages/audit/audit-ing/audit-ing.component.html
@@ -8,7 +8,7 @@
审批信息
审批类型 |
- 加油站名称 |
+ 油站名称 |
区域名称 |
公司名称 |
diff --git a/src/app/pages/audit/audit-record/audit-record.component.html b/src/app/pages/audit/audit-record/audit-record.component.html
index 798b3b9..78b4492 100644
--- a/src/app/pages/audit/audit-record/audit-record.component.html
+++ b/src/app/pages/audit/audit-record/audit-record.component.html
@@ -94,7 +94,7 @@
审批类型
审批信息 |
-
公司名称 |
申请人 |
diff --git a/src/app/pages/init3D.guard.ts b/src/app/pages/init3D.guard.ts
index 2cd893b..8f46e71 100644
--- a/src/app/pages/init3D.guard.ts
+++ b/src/app/pages/init3D.guard.ts
@@ -26,7 +26,7 @@ export class init3DGuard implements CanActivate {
if (userdata.userName == 'superadmin' || res.hasBuildingInfo) {
return true
} else {
- this.message.info("当前油站未开通!");
+ // this.message.info("当前油站未开通!");
return false
}
});
diff --git a/src/app/pages/plan-admin/file-license-list/file-license-list.component.html b/src/app/pages/plan-admin/file-license-list/file-license-list.component.html
index d4de7c2..cbb47c7 100644
--- a/src/app/pages/plan-admin/file-license-list/file-license-list.component.html
+++ b/src/app/pages/plan-admin/file-license-list/file-license-list.component.html
@@ -23,7 +23,7 @@
-
+
diff --git a/src/app/pages/plan-admin/oil-station-list/oil-station-list.component.html b/src/app/pages/plan-admin/oil-station-list/oil-station-list.component.html
index 64e407e..9756871 100644
--- a/src/app/pages/plan-admin/oil-station-list/oil-station-list.component.html
+++ b/src/app/pages/plan-admin/oil-station-list/oil-station-list.component.html
@@ -5,7 +5,7 @@
-
+
@@ -32,7 +32,7 @@
-
加油站名称
+ 油站名称
区域名称 |
公司名称 |
diff --git a/src/app/pages/plan-admin/update-license-list/update-license-list.component.html b/src/app/pages/plan-admin/update-license-list/update-license-list.component.html
index a1b4c24..0d4c1a8 100644
--- a/src/app/pages/plan-admin/update-license-list/update-license-list.component.html
+++ b/src/app/pages/plan-admin/update-license-list/update-license-list.component.html
@@ -34,7 +34,7 @@
-
+
diff --git a/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.html b/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.html
index ac3eb28..54cb72c 100644
--- a/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.html
+++ b/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.html
@@ -165,7 +165,7 @@
预警事件 |
公司名称 |
区域名称 |
- 加油站 |
+ 油站名称 |
预警区域 |
摄像头名称 |
预警时间 |
diff --git a/src/app/pages/records/warning-statistics-list/warning-statistics-list.component.html b/src/app/pages/records/warning-statistics-list/warning-statistics-list.component.html
index df4b7ee..784a636 100644
--- a/src/app/pages/records/warning-statistics-list/warning-statistics-list.component.html
+++ b/src/app/pages/records/warning-statistics-list/warning-statistics-list.component.html
@@ -115,7 +115,7 @@
预警内容 |
公司名称 |
区域名称 |
- 所属油站 |
+ 油站名称 |
证照/消防设施名称 |
有效期限 |
操作 |
diff --git a/src/app/pages/today-warning-admin/today-warning-admin.component.html b/src/app/pages/today-warning-admin/today-warning-admin.component.html
index 9a9dfa4..e4f13ce 100644
--- a/src/app/pages/today-warning-admin/today-warning-admin.component.html
+++ b/src/app/pages/today-warning-admin/today-warning-admin.component.html
@@ -128,7 +128,7 @@
区域名称
- 加油站
+ 油站名称
预警区域
diff --git a/src/app/system-management/menu/editmenu/editmenu.component.spec.ts b/src/app/system-management/menu/editmenu/editmenu.component.spec.ts
deleted file mode 100644
index 4f3b8fc..0000000
--- a/src/app/system-management/menu/editmenu/editmenu.component.spec.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { EditmenuComponent } from './editmenu.component';
-
-describe('EditmenuComponent', () => {
- let component: EditmenuComponent;
- let fixture: ComponentFixture;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ EditmenuComponent ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(EditmenuComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/src/app/system-management/menu/menu.component.spec.ts b/src/app/system-management/menu/menu.component.spec.ts
deleted file mode 100644
index beb2d9b..0000000
--- a/src/app/system-management/menu/menu.component.spec.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { MenuComponent } from './menu.component';
-
-describe('MenuComponent', () => {
- let component: MenuComponent;
- let fixture: ComponentFixture;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ MenuComponent ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(MenuComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/src/app/system-management/menu/menu.component.ts b/src/app/system-management/menu/menu.component.ts
index a4b6f4b..90a7e9a 100644
--- a/src/app/system-management/menu/menu.component.ts
+++ b/src/app/system-management/menu/menu.component.ts
@@ -114,7 +114,7 @@ export class MenuComponent implements OnInit {
editOr(node) {
console.log(node)
const modal = this.modal.create({
- nzTitle: '编辑组织机构',
+ nzTitle: '编辑菜单',
nzContent: EditmenuComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
diff --git a/src/app/system-management/organization/organization.component.html b/src/app/system-management/organization/organization.component.html
index 855ab28..6f29182 100644
--- a/src/app/system-management/organization/organization.component.html
+++ b/src/app/system-management/organization/organization.component.html
@@ -6,16 +6,6 @@
{{totalCount}}个单位
-
diff --git a/src/app/system-management/role/addrole/addrole.component.html b/src/app/system-management/role/addrole/addrole.component.html
index bbdb932..a986b7b 100644
--- a/src/app/system-management/role/addrole/addrole.component.html
+++ b/src/app/system-management/role/addrole/addrole.component.html
@@ -19,12 +19,20 @@
-
+
\ No newline at end of file
diff --git a/src/app/system-management/role/addrole/addrole.component.ts b/src/app/system-management/role/addrole/addrole.component.ts
index 4d76d33..f2ff54e 100644
--- a/src/app/system-management/role/addrole/addrole.component.ts
+++ b/src/app/system-management/role/addrole/addrole.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
+import { TreeService } from 'src/app/service/tree.service';
@Component({
selector: 'app-addrole',
templateUrl: './addrole.component.html',
@@ -13,17 +14,38 @@ export class AddroleComponent implements OnInit {
@Input() subtitle?: string;
@Input() nodes?: any;
validateForm!: FormGroup;
- constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
+ constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
ngOnInit(): void {
+ this.nodes.length != 0 ? null : this.getAllMenus()
this.loadMore();
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
power: [null, [Validators.required]],
- menus: [null]
+ // menus: [null]
});
}
+
+ totalCount
+ getAllMenus() {
+ let params = {
+ SkipCount: '0',
+ MaxResultCount: '999'
+ }
+ this.http.get('/api/services/app/Menu/GetAll', {
+ params: params
+ }).subscribe((data: any) => {
+ console.log(666, data)
+ this.totalCount = data.result.totalCount
+ data.result.items.forEach(element => {
+ element.key = element.id
+ element.title = element.name
+ element.selectable = false
+ });
+ this.nodes = [...this.toTree.toTree(data.result.items)]
+ })
+ }
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
}
diff --git a/src/app/system-management/role/editrole/editrole.component.html b/src/app/system-management/role/editrole/editrole.component.html
index 9cda566..b6b040b 100644
--- a/src/app/system-management/role/editrole/editrole.component.html
+++ b/src/app/system-management/role/editrole/editrole.component.html
@@ -16,5 +16,21 @@
+
-
+
\ No newline at end of file
diff --git a/src/app/system-management/role/editrole/editrole.component.ts b/src/app/system-management/role/editrole/editrole.component.ts
index 8213119..a215613 100644
--- a/src/app/system-management/role/editrole/editrole.component.ts
+++ b/src/app/system-management/role/editrole/editrole.component.ts
@@ -2,6 +2,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { HttpClient } from '@angular/common/http';
+import { TreeService } from 'src/app/service/tree.service';
@Component({
selector: 'app-editrole',
templateUrl: './editrole.component.html',
@@ -11,21 +12,42 @@ export class EditroleComponent implements OnInit {
@Input() data?: any;
@Input() optionList?: any;
-
+ @Input() nodes?: any;
validateForm!: FormGroup;
- constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
+ constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
multipleValue: any
ngOnInit(): void {
+ this.nodes.length != 0 ? null : this.getAllMenus()
this.multipleValue = this.data.grantedPermissions
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
- power: [null, [Validators.required]]
+ power: [null, [Validators.required]],
+ // menus: [null]
});
if (this.optionList.length == 0) {
this.loadMore()
}
}
+ totalCount
+ getAllMenus() {
+ let params = {
+ SkipCount: '0',
+ MaxResultCount: '999'
+ }
+ this.http.get('/api/services/app/Menu/GetAll', {
+ params: params
+ }).subscribe((data: any) => {
+ console.log(666, data)
+ this.totalCount = data.result.totalCount
+ data.result.items.forEach(element => {
+ element.key = element.id
+ element.title = element.name
+ element.selectable = false
+ });
+ this.nodes = [...this.toTree.toTree(data.result.items)]
+ })
+ }
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
}
diff --git a/src/app/system-management/role/menus/menus.component.html b/src/app/system-management/role/menus/menus.component.html
new file mode 100644
index 0000000..0688cc2
--- /dev/null
+++ b/src/app/system-management/role/menus/menus.component.html
@@ -0,0 +1,20 @@
+
+
+
\ No newline at end of file
diff --git a/src/app/system-management/role/menus/menus.component.scss b/src/app/system-management/role/menus/menus.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/system-management/role/menus/menus.component.ts b/src/app/system-management/role/menus/menus.component.ts
new file mode 100644
index 0000000..d029e3c
--- /dev/null
+++ b/src/app/system-management/role/menus/menus.component.ts
@@ -0,0 +1,71 @@
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { Component, OnInit, Input, ViewChild } from '@angular/core';
+import { NzModalRef } from 'ng-zorro-antd/modal';
+import { HttpClient } from '@angular/common/http';
+import { TreeService } from 'src/app/service/tree.service';
+import { NzTreeComponent } from 'ng-zorro-antd/tree';
+@Component({
+ selector: 'app-menus',
+ templateUrl: './menus.component.html',
+ styleUrls: ['./menus.component.scss']
+})
+export class MenusComponent implements OnInit {
+ @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
+ @Input() data?: any;
+ @Input() nodes?: any;
+ validateForm!: FormGroup;
+ constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
+
+ ngOnInit(): void {
+ this.nodes.length != 0 ? null : this.getAllMenus()
+ this.getMenus()
+ this.validateForm = this.fb.group({
+ menus: []
+ });
+ }
+
+ getMenus() {
+ let params = {
+ Id: this.data.id,
+ }
+ this.http.get('/api/services/app/Role/Get', {
+ params: params
+ }).subscribe((data: any) => {
+ // console.log(666, data)
+ let arr = []
+ data.result.menus.forEach(element => {
+ arr.push(element.id)
+ });
+ this.validateForm.patchValue({
+ menus: arr
+ });
+ })
+ }
+
+
+ totalCount
+ getAllMenus() {
+ let params = {
+ SkipCount: '0',
+ MaxResultCount: '999'
+ }
+ this.http.get('/api/services/app/Menu/GetAll', {
+ params: params
+ }).subscribe((data: any) => {
+ // console.log(666, data)
+ this.totalCount = data.result.totalCount
+ data.result.items.forEach(element => {
+ element.key = element.id
+ element.title = element.name
+ element.selectable = false
+ });
+ this.nodes = [...this.toTree.toTree(data.result.items)]
+ })
+ }
+
+ destroyModal(): void {
+ this.modal.destroy({ data: 'this the result data' });
+ }
+
+
+}
diff --git a/src/app/system-management/role/role.component.html b/src/app/system-management/role/role.component.html
index b91e611..ef1935f 100644
--- a/src/app/system-management/role/role.component.html
+++ b/src/app/system-management/role/role.component.html
@@ -13,7 +13,7 @@
角色 |
- 权限 |
+ 权限 |
创建/修改时间 |
操作 |
@@ -29,10 +29,11 @@
编辑
+ 分配菜单
删除
|
-
+
\ No newline at end of file
diff --git a/src/app/system-management/role/role.component.ts b/src/app/system-management/role/role.component.ts
index 5e0642a..f9549e7 100644
--- a/src/app/system-management/role/role.component.ts
+++ b/src/app/system-management/role/role.component.ts
@@ -6,6 +6,7 @@ import { HttpClient } from '@angular/common/http';
import { AddroleComponent } from './addrole/addrole.component';
import { EditroleComponent } from './editrole/editrole.component';
import { TreeService } from 'src/app/service/tree.service';
+import { MenusComponent } from './menus/menus.component';
@Component({
selector: 'app-role',
templateUrl: './role.component.html',
@@ -112,7 +113,8 @@ export class RoleComponent implements OnInit {
// nzOkLoading: true,
nzComponentParams: {
data: item,
- optionList: this.optionList
+ optionList: this.optionList,
+ nodes: this.nodes
},
nzMaskClosable: false,
nzOnOk: async () => {
@@ -148,6 +150,56 @@ export class RoleComponent implements OnInit {
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
+ allotMenus(item) {
+ // console.log(item)
+ const modal = this.modal.create({
+ nzTitle: '分配菜单',
+ nzContent: MenusComponent,
+ nzViewContainerRef: this.viewContainerRef,
+ nzWidth: 400,
+ nzComponentParams: {
+ data: item,
+ nodes: this.nodes
+ },
+ nzMaskClosable: false,
+ nzOnOk: async () => {
+ await new Promise(resolve => {
+ console.log('表单信息', instance.validateForm)
+
+ // let arr = []
+ // let treeData = instance.nzTreeComponent.getCheckedNodeList()
+ // console.log('tree', treeData)
+ // treeData.forEach(element => {
+ // arr.push(element.key)
+ // if (element.origin.children && element.origin.children.length != 0) {
+ // element.origin.children.forEach(ele => {
+ // arr.push(ele.key)
+ // })
+ // }
+ // if (element.parentNode) {
+ // arr.push(element.parentNode.key)
+ // }
+ // });
+ let body = instance.validateForm.value.menus
+ this.http.post('/api/services/app/Role/SetRoleMenus', body, {
+ params: {
+ roleId: item.id
+ }
+ }).subscribe(data => {
+ resolve(data)
+ this.message.create('success', '分配成功!');
+ this.getAllRoles()
+ return true
+ })
+ })
+ }
+ });
+ const instance = modal.getContentComponent();
+ // modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
+ // modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
+ }
+
+
optionList = [];
//获取权限列表
loadMore() {
diff --git a/src/app/system-management/system-management.module.ts b/src/app/system-management/system-management.module.ts
index 1f05bd9..c88a497 100644
--- a/src/app/system-management/system-management.module.ts
+++ b/src/app/system-management/system-management.module.ts
@@ -43,8 +43,9 @@ import { EditUpdateOfLicenseComponent } from './update-of-license/edit-update-of
import { MenuComponent } from './menu/menu.component';
import { AddmenuComponent } from './menu/addmenu/addmenu.component';
import { EditmenuComponent } from './menu/editmenu/editmenu.component';
+import { MenusComponent } from './role/menus/menus.component';
@NgModule({
- declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, PushComponent, EditPushItemComponent, FileOfLicenseComponent, UpdateOfLicenseComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent, MenuComponent, AddmenuComponent, EditmenuComponent],
+ declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, PushComponent, EditPushItemComponent, FileOfLicenseComponent, UpdateOfLicenseComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent, MenuComponent, AddmenuComponent, EditmenuComponent, MenusComponent],
imports: [
CommonModule,
SystemRoutingModule,
@@ -66,7 +67,7 @@ import { EditmenuComponent } from './menu/editmenu/editmenu.component';
NzTreeSelectModule,
NzCheckboxModule
],
- entryComponents: [AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, EditPushItemComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent,AddmenuComponent,EditmenuComponent]
+ entryComponents: [AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, EditPushItemComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent, AddmenuComponent, EditmenuComponent, MenusComponent]
})
export class SystemManagementModule { }