邵佳豪 3 years ago
parent
commit
3ddc6401bd
  1. 10
      src/app/pages/pages.module.ts
  2. 17
      src/app/pages/today-warning-admin/today-warning-admin.component.html
  3. 3
      src/app/pages/today-warning-admin/today-warning-admin.component.scss
  4. 28
      src/app/pages/today-warning-admin/today-warning-admin.component.ts
  5. 5
      src/app/pages/today-warning/today-warning.component.html
  6. 16
      src/app/pages/today-warning/today-warning.component.ts

10
src/app/pages/pages.module.ts

@ -38,11 +38,17 @@ import { OilStationInfoComponent } from './oil-station-info/oil-station-info.com
import { LeftDomainComponent } from './left-domain/left-domain.component'; import { LeftDomainComponent } from './left-domain/left-domain.component';
import { AddequipmentComponent } from './equipment-info/addequipment/addequipment.component'; import { AddequipmentComponent } from './equipment-info/addequipment/addequipment.component';
import { EditequipmentComponent } from './equipment-info/editequipment/editequipment.component'; import { EditequipmentComponent } from './equipment-info/editequipment/editequipment.component';
import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
import { PlanAdminComponent } from './plan-admin/plan-admin.component'; import { PlanAdminComponent } from './plan-admin/plan-admin.component';
@NgModule({ @NgModule({
declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent, TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent, AddequipmentComponent, EditequipmentComponent, PlanAdminComponent], declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent,
TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent,
AddequipmentComponent, EditequipmentComponent,PlanAdminComponent],
imports: [ imports: [
PagesRoutingModule, PagesRoutingModule,
CommonModule, CommonModule,
@ -70,7 +76,9 @@ import { PlanAdminComponent } from './plan-admin/plan-admin.component';
NzMessageModule, NzMessageModule,
NzSpinModule, NzSpinModule,
NzTreeModule, NzTreeModule,
NzTreeSelectModule,
NzCollapseModule NzCollapseModule
], ],
entryComponents: [AddequipmentComponent, EditequipmentComponent], entryComponents: [AddequipmentComponent, EditequipmentComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA] schemas: [CUSTOM_ELEMENTS_SCHEMA]

17
src/app/pages/today-warning-admin/today-warning-admin.component.html

@ -10,6 +10,7 @@
<nz-option nzValue="1" nzLabel="一级"></nz-option> <nz-option nzValue="1" nzLabel="一级"></nz-option>
<nz-option nzValue="2" nzLabel="二级"></nz-option> <nz-option nzValue="2" nzLabel="二级"></nz-option>
<nz-option nzValue="3" nzLabel="三级"></nz-option> <nz-option nzValue="3" nzLabel="三级"></nz-option>
<nz-option nzValue="4" nzLabel="四级"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@ -17,20 +18,19 @@
<nz-form-item class="searchParams"> <nz-form-item class="searchParams">
<nz-form-control> <nz-form-control>
<nz-select id="type" formControlName="type" nzPlaceHolder="请选择预警类型"> <nz-select id="type" formControlName="type" nzPlaceHolder="请选择预警类型">
<nz-option nzValue="1" nzLabel="一级"></nz-option> <nz-option *ngFor="let item of yujingTypes" [nzValue]="item.id" [nzLabel]="item.violationName"></nz-option>
<nz-option nzValue="2" nzLabel="二级"></nz-option>
<nz-option nzValue="3" nzLabel="三级"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item class="searchParams"> <nz-form-item class="searchParams">
<nz-form-control> <nz-form-control>
<nz-select id="company" formControlName="company" nzPlaceHolder="请选择所属机构"> <!-- <nz-select id="company" formControlName="company" nzPlaceHolder="请选择所属机构">
<nz-option nzValue="1" nzLabel="一级"></nz-option>
<nz-option nzValue="2" nzLabel="二级"></nz-option> </nz-select> -->
<nz-option nzValue="3" nzLabel="三级"></nz-option> <nz-tree-select id="company" formControlName="company" [nzNodes]="nodes" nzPlaceHolder="请选择所属机构">
</nz-select> </nz-tree-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<!-- <nz-form-item class="searchParams"> <!-- <nz-form-item class="searchParams">
@ -150,4 +150,5 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

3
src/app/pages/today-warning-admin/today-warning-admin.component.scss

@ -38,6 +38,9 @@
color: rgba(145, 204, 255, 0.95); color: rgba(145, 204, 255, 0.95);
; ;
} }
nz-tree-select{
color: rgba(145, 204, 255, 0.95);
}
nz-date-picker { nz-date-picker {
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);

28
src/app/pages/today-warning-admin/today-warning-admin.component.ts

@ -1,6 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router' import { Router } from '@angular/router';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
@Component({ @Component({
selector: 'app-today-warning-admin', selector: 'app-today-warning-admin',
templateUrl: './today-warning-admin.component.html', templateUrl: './today-warning-admin.component.html',
@ -9,7 +11,7 @@ import { Router } from '@angular/router'
export class TodayWarningAdminComponent implements OnInit { export class TodayWarningAdminComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private fb: FormBuilder, private router: Router) { } constructor(private http: HttpClient,private fb: FormBuilder, private router: Router, private toTree: TreeService) { }
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
@ -20,6 +22,28 @@ export class TodayWarningAdminComponent implements OnInit {
site: [null], site: [null],
datePicker: [null] datePicker: [null]
}); });
this.yujingType()
this.getAllOrganization()
}
//预警类型接口
yujingTypes:any //预警接口数据
yujingType(){
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.yujingTypes=data.result
}
)
}
//获取所有组织机构
nodes:any = []
getAllOrganization() {
this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => {
data.result.items.forEach(element => {
element.key = element.code
element.title = element.displayName
});
this.nodes = [...this.toTree.toTree(data.result.items)]
console.log(this.nodes)
})
} }
submitForm(): void { submitForm(): void {

5
src/app/pages/today-warning/today-warning.component.html

@ -10,6 +10,7 @@
<nz-option nzValue="1" nzLabel="一级"></nz-option> <nz-option nzValue="1" nzLabel="一级"></nz-option>
<nz-option nzValue="2" nzLabel="二级"></nz-option> <nz-option nzValue="2" nzLabel="二级"></nz-option>
<nz-option nzValue="3" nzLabel="三级"></nz-option> <nz-option nzValue="3" nzLabel="三级"></nz-option>
<nz-option nzValue="4" nzLabel="四级"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@ -17,9 +18,7 @@
<nz-form-item class="searchParams"> <nz-form-item class="searchParams">
<nz-form-control> <nz-form-control>
<nz-select id="type" formControlName="type" nzPlaceHolder="请选择预警类型"> <nz-select id="type" formControlName="type" nzPlaceHolder="请选择预警类型">
<nz-option nzValue="1" nzLabel="一级"></nz-option> <nz-option *ngFor="let item of yujingTypes" [nzValue]="item.id" [nzLabel]="item.violationName"></nz-option>
<nz-option nzValue="2" nzLabel="二级"></nz-option>
<nz-option nzValue="3" nzLabel="三级"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

16
src/app/pages/today-warning/today-warning.component.ts

@ -1,5 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
@Component({ @Component({
selector: 'app-today-warning', selector: 'app-today-warning',
templateUrl: './today-warning.component.html', templateUrl: './today-warning.component.html',
@ -7,7 +9,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
}) })
export class TodayWarningComponent implements OnInit { export class TodayWarningComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private fb: FormBuilder) { } constructor(private http: HttpClient,private fb: FormBuilder, private toTree: TreeService) { }
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
@ -16,8 +18,20 @@ export class TodayWarningComponent implements OnInit {
site: [null], site: [null],
datePicker: [null] datePicker: [null]
}); });
this.yujingType()
//this.getAllOrganization()
} }
//预警类型接口
yujingTypes:any //预警接口数据
yujingType(){
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.yujingTypes=data.result
}
)
}
submitForm(): void { submitForm(): void {
for (const i in this.validateForm.controls) { for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].markAsDirty();

Loading…
Cancel
Save