You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.0 KiB
47 lines
1.0 KiB
3 years ago
|
import { HttpClient } from '@angular/common/http';
|
||
|
import { Component, OnInit } from '@angular/core';
|
||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||
|
@Component({
|
||
|
selector: 'app-push',
|
||
|
templateUrl: './push.component.html',
|
||
|
styleUrls: ['./push.component.scss']
|
||
|
})
|
||
|
|
||
|
export class PushComponent implements OnInit {
|
||
|
|
||
|
validateForm!: FormGroup;
|
||
|
constructor(private fb: FormBuilder, private http: HttpClient) { }
|
||
|
|
||
|
ngOnInit(): void {
|
||
|
this.validateForm = this.fb.group({
|
||
|
search: [null]
|
||
|
});
|
||
|
this.getViolation()
|
||
|
}
|
||
|
|
||
|
|
||
|
//获取预警类型
|
||
|
list:any
|
||
|
getViolation() {
|
||
|
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data:any) => {
|
||
|
this.list = data.result
|
||
|
console.log('预警类型', data)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
|
||
|
edititem(item){
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
//搜索框提交
|
||
|
submitForm(): void {
|
||
|
for (const i in this.validateForm.controls) {
|
||
|
this.validateForm.controls[i].markAsDirty();
|
||
|
this.validateForm.controls[i].updateValueAndValidity();
|
||
|
}
|
||
|
}
|
||
|
}
|