|
|
@ -5,13 +5,12 @@ import * as echarts from 'echarts'; |
|
|
|
import { NzModalService } from 'ng-zorro-antd/modal'; |
|
|
|
import { NzModalService } from 'ng-zorro-antd/modal'; |
|
|
|
import * as moment from 'moment'; |
|
|
|
import * as moment from 'moment'; |
|
|
|
import { fromEvent } from 'rxjs'; |
|
|
|
import { fromEvent } from 'rxjs'; |
|
|
|
import { debounceTime } from 'rxjs/operators'; |
|
|
|
import { debounceTime, filter } from 'rxjs/operators'; |
|
|
|
import { Router } from '@angular/router'; |
|
|
|
import { Router } from '@angular/router'; |
|
|
|
import { TreeService } from 'src/app/service/tree.service'; |
|
|
|
import { TreeService } from 'src/app/service/tree.service'; |
|
|
|
import { DisposeequipmentComponent } from './disposeequipment/disposeequipment.component'; |
|
|
|
import { DisposeequipmentComponent } from './disposeequipment/disposeequipment.component'; |
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message'; |
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message'; |
|
|
|
import { GetOutOfLineDetailsComponent } from '../../today-warning/get-out-of-line-details/get-out-of-line-details.component'; |
|
|
|
import { GetOutOfLineDetailsComponent } from '../../today-warning/get-out-of-line-details/get-out-of-line-details.component'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-warning-statistics-list', |
|
|
|
selector: 'app-warning-statistics-list', |
|
|
|
templateUrl: './warning-statistics-list.component.html', |
|
|
|
templateUrl: './warning-statistics-list.component.html', |
|
|
@ -79,6 +78,7 @@ export class WarningStatisticsListComponent implements OnInit { |
|
|
|
let lastD = lw.getDate(); |
|
|
|
let lastD = lw.getDate(); |
|
|
|
this.startdate = JSON.parse(JSON.stringify(lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD)));//三十天之前日期
|
|
|
|
this.startdate = JSON.parse(JSON.stringify(lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD)));//三十天之前日期
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
|
|
|
|
type: null, |
|
|
|
eventSystemName: null, |
|
|
|
eventSystemName: null, |
|
|
|
organization: [null], |
|
|
|
organization: [null], |
|
|
|
licenseType: [null], |
|
|
|
licenseType: [null], |
|
|
@ -127,7 +127,28 @@ export class WarningStatisticsListComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
isListOfData = false |
|
|
|
isListOfData = false |
|
|
|
typeChange(e) { |
|
|
|
typeChange1(e) { |
|
|
|
|
|
|
|
if (e) { |
|
|
|
|
|
|
|
if (e == '证照') { |
|
|
|
|
|
|
|
this.isListOfData = true |
|
|
|
|
|
|
|
this.eventSystemNameOption = [...this.eventSystemNameOptionOfLicense] |
|
|
|
|
|
|
|
} else if (e == '设备') { |
|
|
|
|
|
|
|
this.isListOfData = false |
|
|
|
|
|
|
|
this.validateForm.patchValue({ |
|
|
|
|
|
|
|
licenseType: [] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.eventSystemNameOption = [...this.eventSystemNameOptionOfEquipment] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.isListOfData = false |
|
|
|
|
|
|
|
this.validateForm.patchValue({ |
|
|
|
|
|
|
|
licenseType: [] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.eventSystemNameOption = [...this.eventSystemNameOptionOfEquipment, ...this.eventSystemNameOptionOfLicense] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typeChange2(e) { |
|
|
|
if (e) { |
|
|
|
if (e) { |
|
|
|
let obj |
|
|
|
let obj |
|
|
|
this.eventSystemNameOption.forEach(item => { |
|
|
|
this.eventSystemNameOption.forEach(item => { |
|
|
@ -135,7 +156,7 @@ export class WarningStatisticsListComponent implements OnInit { |
|
|
|
obj = item |
|
|
|
obj = item |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (obj.name == '证照预警') { |
|
|
|
if (obj.name.indexOf('证照') != -1) { |
|
|
|
this.isListOfData = true |
|
|
|
this.isListOfData = true |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.isListOfData = false |
|
|
|
this.isListOfData = false |
|
|
@ -380,7 +401,11 @@ export class WarningStatisticsListComponent implements OnInit { |
|
|
|
defaultOrId: string |
|
|
|
defaultOrId: string |
|
|
|
//获取所有组织机构
|
|
|
|
//获取所有组织机构
|
|
|
|
nodes: any = [] |
|
|
|
nodes: any = [] |
|
|
|
eventSystemNameOption = [] |
|
|
|
eventSystemNameOption = [] //最终展示的预警类型
|
|
|
|
|
|
|
|
eventSystemNameOptionOfEquipment = [] //最终展示的预警类型
|
|
|
|
|
|
|
|
eventSystemNameOptionOfLicense = [] //最终展示的预警类型
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
warningTypes = []//预警类型
|
|
|
|
getAllOrganization() { |
|
|
|
getAllOrganization() { |
|
|
|
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id |
|
|
|
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
@ -404,16 +429,19 @@ export class WarningStatisticsListComponent implements OnInit { |
|
|
|
datePicker: [this.startdate, this.enddate] |
|
|
|
datePicker: [this.startdate, this.enddate] |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => { |
|
|
|
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => { |
|
|
|
console.log('预警事件', data.result) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.result.forEach(element => { |
|
|
|
data.result.forEach(element => { |
|
|
|
if (element.violationType == '设备监测' || element.violationType == '证照资质') { |
|
|
|
if (element.violationType == '设备监测') { |
|
|
|
this.eventSystemNameOption.push( |
|
|
|
this.eventSystemNameOptionOfEquipment.push( |
|
|
|
|
|
|
|
{ id: element.id, name: element.eventSystemName } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (element.violationType == '证照资质') { |
|
|
|
|
|
|
|
this.eventSystemNameOptionOfLicense.push( |
|
|
|
{ id: element.id, name: element.eventSystemName } |
|
|
|
{ id: element.id, name: element.eventSystemName } |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
this.eventSystemNameOption = [...this.eventSystemNameOptionOfEquipment, ...this.eventSystemNameOptionOfLicense] |
|
|
|
this.list = [] |
|
|
|
this.list = [] |
|
|
|
this.SkipCount = '0' |
|
|
|
this.SkipCount = '0' |
|
|
|
this.getLicenseList() |
|
|
|
this.getLicenseList() |
|
|
@ -433,11 +461,12 @@ export class WarningStatisticsListComponent implements OnInit { |
|
|
|
//获得证照预警
|
|
|
|
//获得证照预警
|
|
|
|
getLicenseList() { |
|
|
|
getLicenseList() { |
|
|
|
this.isLoading = true |
|
|
|
this.isLoading = true |
|
|
|
|
|
|
|
this.tableSpin = true |
|
|
|
for (const key in this.validateForm.controls) { |
|
|
|
for (const key in this.validateForm.controls) { |
|
|
|
this.validateForm.controls[key].markAsPristine(); |
|
|
|
this.validateForm.controls[key].markAsPristine(); |
|
|
|
this.validateForm.controls[key].updateValueAndValidity(); |
|
|
|
this.validateForm.controls[key].updateValueAndValidity(); |
|
|
|
} |
|
|
|
} |
|
|
|
this.tableSpin = true |
|
|
|
|
|
|
|
let organizationUnitId |
|
|
|
let organizationUnitId |
|
|
|
if (this.router.url.indexOf('petrolStation') != -1) { |
|
|
|
if (this.router.url.indexOf('petrolStation') != -1) { |
|
|
|
organizationUnitId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id |
|
|
|
organizationUnitId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id |
|
|
@ -448,10 +477,26 @@ export class WarningStatisticsListComponent implements OnInit { |
|
|
|
let ViolationIds = [] |
|
|
|
let ViolationIds = [] |
|
|
|
if (this.validateForm.value.eventSystemName) { |
|
|
|
if (this.validateForm.value.eventSystemName) { |
|
|
|
ViolationIds.push(this.validateForm.value.eventSystemName) |
|
|
|
ViolationIds.push(this.validateForm.value.eventSystemName) |
|
|
|
} else { |
|
|
|
} |
|
|
|
this.eventSystemNameOption.forEach(element => { |
|
|
|
if (this.validateForm.value.type && !this.validateForm.value.eventSystemName) { |
|
|
|
ViolationIds.push(element.id) |
|
|
|
if (this.validateForm.value.type == '证照') { |
|
|
|
}); |
|
|
|
this.eventSystemNameOptionOfLicense.forEach(i => { |
|
|
|
|
|
|
|
ViolationIds.push(i.id) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.validateForm.value.type == '设备') { |
|
|
|
|
|
|
|
this.eventSystemNameOptionOfEquipment.forEach(i => { |
|
|
|
|
|
|
|
ViolationIds.push(i.id) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!this.validateForm.value.type && !this.validateForm.value.eventSystemName) { |
|
|
|
|
|
|
|
this.eventSystemNameOptionOfLicense.forEach(i => { |
|
|
|
|
|
|
|
ViolationIds.push(i.id) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.eventSystemNameOptionOfEquipment.forEach(i => { |
|
|
|
|
|
|
|
ViolationIds.push(i.id) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
ViolationIds: ViolationIds, |
|
|
|
ViolationIds: ViolationIds, |
|
|
@ -539,8 +584,8 @@ export class WarningStatisticsListComponent implements OnInit { |
|
|
|
this.validateForm.controls[key].markAsPristine(); |
|
|
|
this.validateForm.controls[key].markAsPristine(); |
|
|
|
this.validateForm.controls[key].updateValueAndValidity(); |
|
|
|
this.validateForm.controls[key].updateValueAndValidity(); |
|
|
|
} |
|
|
|
} |
|
|
|
// console.log('赋值日期', [this.startdate, this.enddate])
|
|
|
|
|
|
|
|
this.validateForm.patchValue({ |
|
|
|
this.validateForm.patchValue({ |
|
|
|
|
|
|
|
type: null, |
|
|
|
datePicker: [this.startdate, this.enddate], |
|
|
|
datePicker: [this.startdate, this.enddate], |
|
|
|
eventSystemName: null, |
|
|
|
eventSystemName: null, |
|
|
|
licenseType: [], |
|
|
|
licenseType: [], |
|
|
|