Browse Source

菜单管理

beijing
陈鹏飞 2 years ago
parent
commit
9371a924da
  1. 15
      src/app/pages/pages.module.ts
  2. 9
      src/app/system-management/menu/menu.component.html
  3. 0
      src/app/system-management/menu/menu.component.scss
  4. 0
      src/app/system-management/menu/menu.component.spec.ts
  5. 104
      src/app/system-management/menu/menu.component.ts
  6. 2
      src/app/system-management/system-management.module.ts

15
src/app/pages/pages.module.ts

@ -19,7 +19,7 @@ import { NzButtonModule } from 'ng-zorro-antd/button';
import { PlanComponent } from './plan/plan.component';
import { PagesRoutingModule } from './pages-routing.module';
import { TodayWarningComponent } from './today-warning/today-warning.component';
import { CriminalRecordsComponent } from './criminal-records/criminal-records.component';
import { CriminalRecordsComponent } from './records/criminal-records/criminal-records.component';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { NzIconModule } from 'ng-zorro-antd/icon';
@ -40,7 +40,7 @@ import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm';
import { NzBadgeModule } from 'ng-zorro-antd/badge';
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { TodayWarningAdminComponent } from './today-warning-admin/today-warning-admin.component';
import { CriminalRecordsAdminComponent } from './criminal-records-admin/criminal-records-admin.component';
import { CriminalRecordsAdminComponent } from './records/criminal-records-admin/criminal-records-admin.component';
import { EquipmentInfoComponent } from './equipment-info/equipment-info.component';
import { OilStationInfoComponent } from './oil-station-info/oil-station-info.component';
import { LeftDomainComponent } from './left-domain/left-domain.component';
@ -53,11 +53,10 @@ import { NzNotificationModule } from 'ng-zorro-antd/notification';
import { DispositionComponent } from './disposition/disposition.component';
import { OilUnloadingProcessComponent } from './oil-unloading-process/oil-unloading-process.component';
import { HomePageComponent } from './home-page/home-page.component';
import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/oil-unloading-process-list.component';
import { OilUnloadingProcessListComponent } from './records/oil-unloading-process-list/oil-unloading-process-list.component';
import { ChangePasswordComponent } from './change-password/change-password.component';
import { FacilitySortPipe } from './facility-sort.pipe';
import { WarningStatisticsListComponent } from './warning-statistics-list/warning-statistics-list.component';
import { DisposeequipmentComponent } from './warning-statistics-list/disposeequipment/disposeequipment.component';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
import { NavBarComponent } from './license/nav-bar/nav-bar.component';
import { InformComponent } from './license/inform/inform.component';
@ -70,7 +69,6 @@ import { EditFileCategoryComponent } from './license/file-category/edit-file-cat
import { DetailsFileCategoryComponent } from './license/file-category/details-file-category/details-file-category.component';
import { NzTimelineModule } from 'ng-zorro-antd/timeline';
import { PdfWordLookComponent } from './license/pdf-word-look/pdf-word-look.component';
// import { MisinformationListComponent } from './misinformation-list/misinformation-list.component';
import { OilStationListComponent } from './plan-admin/oil-station-list/oil-station-list.component';
import { UpdateLicenseListComponent } from './plan-admin/update-license-list/update-license-list.component';
import { FileLicenseListComponent } from './plan-admin/file-license-list/file-license-list.component';
@ -85,12 +83,13 @@ import { auditStatusPipe, handleState, licenseViolationType, notificationContent
import { GasBaseInfoComponent } from './audit/gas-base-info/gas-base-info.component';
import { AnnualInspectionComponent } from './audit/annual-inspection/annual-inspection.component';
import { EditAnnualInspectionComponent } from './audit/annual-inspection/edit-annual-inspection/edit-annual-inspection.component';
import { MenuComponent } from '../system-management/menu/menu.component';
import { DisposeequipmentComponent } from './records/warning-statistics-list/disposeequipment/disposeequipment.component';
import { WarningStatisticsListComponent } from './records/warning-statistics-list/warning-statistics-list.component';
@NgModule({
declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent,
TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent,
AddequipmentComponent, EditequipmentComponent, PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, FacilitySortPipe, WarningStatisticsListComponent, DisposeequipmentComponent, NavBarComponent, InformComponent, UpdateCategoryComponent, FileCategoryComponent, HistoriesComponent, EditUpdateCategoryComponent, DetailsUpdateCategoryComponent, EditFileCategoryComponent, DetailsFileCategoryComponent, PdfWordLookComponent, OilStationListComponent, UpdateLicenseListComponent, FileLicenseListComponent, AuditNavComponent, AuditIngComponent, AuditRecordComponent, AuditInformTimeComponent, AuditDisposeComponent, EditInformTimeComponent, AuditDetailsInformTimeComponent, auditStatusPipe, GasBaseInfoComponent, notificationContent, licenseViolationType, handleState, AnnualInspectionComponent, EditAnnualInspectionComponent, MenuComponent],
AddequipmentComponent, EditequipmentComponent, PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, FacilitySortPipe, WarningStatisticsListComponent, DisposeequipmentComponent, NavBarComponent, InformComponent, UpdateCategoryComponent, FileCategoryComponent, HistoriesComponent, EditUpdateCategoryComponent, DetailsUpdateCategoryComponent, EditFileCategoryComponent, DetailsFileCategoryComponent, PdfWordLookComponent, OilStationListComponent, UpdateLicenseListComponent, FileLicenseListComponent, AuditNavComponent, AuditIngComponent, AuditRecordComponent, AuditInformTimeComponent, AuditDisposeComponent, EditInformTimeComponent, AuditDetailsInformTimeComponent, auditStatusPipe, GasBaseInfoComponent, notificationContent, licenseViolationType, handleState, AnnualInspectionComponent, EditAnnualInspectionComponent],
imports: [

9
src/app/pages/system-management/menu/menu.component.html → src/app/system-management/menu/menu.component.html

@ -1,8 +1,9 @@
<div class="orbox" id="orbox">
<div class="topbox">
<div class="lefttop">
<span>菜单列表</span>
<span>组织机构列表</span>
<span><img style="vertical-align: top;" src="../../../assets/images/icon/orgrey.png" alt="">
{{totalCount}}个单位</span>
</div>
<div class="righttop">
<!-- <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
@ -23,8 +24,8 @@
</div>
</div>
<div class="treeTitle">
<span>菜单</span>
<span>是否添加</span>
<span>组织机构</span>
<span>操作</span>
</div>
<nz-tree [nzHideUnMatched]='true' [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes"
[nzExpandAll]="nzExpandAll" [nzExpandedKeys]="defaultExpandedKeys" [nzTreeTemplate]="nzTreeTemplate" nzDraggable

0
src/app/pages/system-management/menu/menu.component.scss → src/app/system-management/menu/menu.component.scss

0
src/app/pages/system-management/menu/menu.component.spec.ts → src/app/system-management/menu/menu.component.spec.ts

104
src/app/pages/system-management/menu/menu.component.ts → src/app/system-management/menu/menu.component.ts

@ -5,7 +5,8 @@ import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
// import { AddorComponent } from './addor/addor.component';
// import { EditorComponent } from './editor/editor.component';
import { NzFormatBeforeDropEvent } from 'ng-zorro-antd/tree';
import { Observable, of } from 'rxjs';
@ -18,20 +19,21 @@ import { delay } from 'rxjs/operators';
export class MenuComponent implements OnInit {
validateForm!: FormGroup;
constructor(private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private modal: NzModalService, private message: NzMessageService, private viewContainerRef: ViewContainerRef) { }
checked=true
ngOnInit(): void {
this.validateForm = this.fb.group({
search: [null]
});
this.getAllOrganization()
}
tianjia(e){
console.log(e);
//搜索框提交
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
}
//获取所有组织机构
searchValue = '';
nzExpandAll = false;
@ -57,7 +59,6 @@ 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);
})
}
@ -69,7 +70,90 @@ export class MenuComponent implements OnInit {
nodes: any[] = []
// addOr(node?: any) {
// console.log(node)
// const modal = this.modal.create({
// nzTitle: node ? '新增组织机构' : '新增一级组织机构',
// nzContent: AddorComponent,
// nzViewContainerRef: this.viewContainerRef,
// nzWidth: 288,
// nzComponentParams: {},
// nzOnOk: async () => {
// console.log('hhhhhhh', instance.validateForm)
// if (instance.validateForm.valid) {
// await new Promise(resolve => {
// let body = {
// parentId: node ? Number(node.key) : null,
// // code: instance.validateForm.value.code,
// displayName: instance.validateForm.value.name,
// isGasStation: instance.validateForm.value.isGasStation
// }
// this.http.post('/api/services/app/Organization/Create', body).subscribe(data => {
// resolve(data)
// this.message.create('success', '创建成功!');
// this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
// this.defaultExpandedKeys.push(item.key)
// })
// this.getAllOrganization()
// return true
// }, err => {
// resolve(err)
// this.message.create('warning', '创建失败');
// return false
// })
// })
// } else {
// this.message.create('warning', '请填写完整!');
// return false
// }
// }
// });
// const instance = modal.getContentComponent();
// }
// editOr(node) {
// // console.log(node)
// const modal = this.modal.create({
// nzTitle: '编辑组织机构',
// nzContent: EditorComponent,
// nzViewContainerRef: this.viewContainerRef,
// nzWidth: 288,
// nzComponentParams: {
// data: node.origin,
// },
// nzOnOk: async () => {
// console.log('hhhhhhh', instance.validateForm)
// if (instance.validateForm.valid) {
// await new Promise(resolve => {
// let body = {
// id: node.origin.id,
// parentId: node.origin.parentId,
// // code: instance.validateForm.value.code,
// displayName: instance.validateForm.value.name,
// isGasStation: instance.validateForm.value.isGasStation
// }
// this.http.put('/api/services/app/Organization/Update', body).subscribe(data => {
// resolve(data)
// this.message.create('success', '编辑成功!');
// this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
// this.defaultExpandedKeys.push(item.key)
// })
// this.getAllOrganization()
// return true
// }, err => {
// resolve(err)
// this.message.create('warning', '编辑失败');
// return false
// })
// })
// } else {
// this.message.create('warning', '请填写完整!');
// return false
// }
// }
// });
// const instance = modal.getContentComponent();
// }
deleteOr(item) {
console.log(item)
if (item.origin.children && item.origin.children.length != 0) {

2
src/app/system-management/system-management.module.ts

@ -42,7 +42,7 @@ import { AddUpdateOfLicenseComponent } from './update-of-license/add-update-of-l
import { EditUpdateOfLicenseComponent } from './update-of-license/edit-update-of-license/edit-update-of-license.component';
import { MenuComponent } from './menu/menu.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],
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],
imports: [
CommonModule,
SystemRoutingModule,

Loading…
Cancel
Save