Browse Source

[完善]预警记录页面查询条件

beijing
邵佳豪 3 years ago
parent
commit
f2b2d1e781
  1. 2
      src/app/http-interceptors/base-interceptor.ts
  2. 25
      src/app/pages/criminal-records-admin/criminal-records-admin.component.html
  3. 10
      src/app/pages/criminal-records-admin/criminal-records-admin.component.scss
  4. 66
      src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
  5. 18
      src/app/pages/criminal-records/criminal-records.component.html
  6. 11
      src/app/pages/criminal-records/criminal-records.component.scss
  7. 63
      src/app/pages/criminal-records/criminal-records.component.ts
  8. 14
      src/theme.less

2
src/app/http-interceptors/base-interceptor.ts

@ -84,7 +84,7 @@ export class BaseInterceptor implements HttpInterceptor {
this.message.create('error', `请核对您的输入信息或格式是否正确!`);
}
if (error.status === 500) {
this.message.create('error', `状态500,服务器错误!`);
this.message.create('error', `状态500,服务器错误!${error.error.message}`);
}
if (error.error instanceof ErrorEvent) {
// 发生客户端或网络错误。相应处理。

25
src/app/pages/criminal-records-admin/criminal-records-admin.component.html

@ -62,11 +62,11 @@
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear id="level" formControlName="level" nzPlaceHolder="请选择预警级别">
<nz-option nzValue="1" nzLabel="Ⅰ级"></nz-option>
<nz-option nzValue="2" nzLabel="Ⅱ级"></nz-option>
<nz-option nzValue="3" nzLabel="Ⅲ级"></nz-option>
<nz-option nzValue="4" nzLabel="Ⅳ级"></nz-option>
<nz-select (ngModelChange)="levelChange($event)" nzAllowClear id="level" formControlName="level"
nzPlaceHolder="请选择预警级别">
<nz-option *ngFor="let item of warningLevels" [nzValue]="item.key"
[nzLabel]="item.key == 1 ? 'Ⅰ级' : item.key == 2 ? 'Ⅱ级' : item.key == 3 ? 'Ⅲ级' : item.key == 4 ? 'Ⅳ级' : null">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
@ -97,17 +97,19 @@
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-item class="searchParamsZ eventInput">
<nz-form-control>
<nz-select nzAllowClear formControlName="event" nzPlaceHolder="请选择预警事件">
<nz-select [nzMaxTagCount]="1" nzMode="multitagsple" nzAllowClear formControlName="event"
nzPlaceHolder="请选择预警事件">
<nz-option *ngFor="let item of warningTypesDetails" [nzValue]="item.id" [nzLabel]="item.eventSystemName">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-item class="searchParamsS eventInput">
<nz-form-control>
<nz-select nzAllowClear id="site" formControlName="site" nzPlaceHolder="请选择区域">
<nz-select [nzMaxTagCount]="1" nzMode="multitagsple" nzAllowClear id="site" formControlName="site"
nzPlaceHolder="请选择区域">
<nz-option nzValue="出入口" nzLabel="出入口"></nz-option>
<nz-option nzValue="加油区" nzLabel="加油区"></nz-option>
<nz-option nzValue="油罐区" nzLabel="油罐区"></nz-option>
@ -131,11 +133,6 @@
<br />
</nz-form-control>
</nz-form-item>
<!-- <nz-form-item>
<nz-form-control class="searchParams">
<label style="color: #91CCFF;" nz-checkbox formControlName="misinformation">是否显示误报预警</label>
</nz-form-control>
</nz-form-item> -->
<nz-form-item class="searchParams" [hidden]="!isMisinformation">
<nz-form-control>
<nz-select nzAllowClear formControlName="misinformation" nzPlaceHolder="是否显示标记">

10
src/app/pages/criminal-records-admin/criminal-records-admin.component.scss

@ -28,6 +28,16 @@
width: 150px;
}
.searchParamsZ {
min-width: 200px;
max-width: 250px;
margin-right: 3px;
}
.searchParamsS{
min-width: 180px;
max-width: 250px;
}
.searchParamsLong {
width: 250px;
}

66
src/app/pages/criminal-records-admin/criminal-records-admin.component.ts

@ -3,10 +3,8 @@ import { Component, ElementRef, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router'
import * as echarts from 'echarts';
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import * as moment from 'moment';
import { NzModalService } from 'ng-zorro-antd/modal';
import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component';
@ -426,7 +424,6 @@ export class CriminalRecordsAdminComponent implements OnInit {
}
this.mybarChart.setOption(option);
}
//获取统计信息
chartsSpin: boolean = false
getAggregations() {
@ -460,8 +457,9 @@ export class CriminalRecordsAdminComponent implements OnInit {
tableSpin: boolean = false
getViolateRecordList() {
let ViolationIds = []
// console.log(this.validateForm.value.event)
if (this.validateForm.value.event) {
ViolationIds.push(this.validateForm.value.event)
ViolationIds = this.validateForm.value.event
}
if (this.validateForm.value.type && !this.validateForm.value.event) {
this.warningTypesDetails.forEach(item => {
@ -479,7 +477,7 @@ export class CriminalRecordsAdminComponent implements OnInit {
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.site,
ViolateAreas: this.validateForm.value.site,
OrganizationUnitId: this.validateForm.value.organization,
IsContainsChildren: 'true',
IsHandled: disposalState,
@ -500,6 +498,7 @@ export class CriminalRecordsAdminComponent implements OnInit {
})
}
isMouseEnter = false
mouseEnter() {
this.isMouseEnter = true
@ -582,25 +581,76 @@ export class CriminalRecordsAdminComponent implements OnInit {
}
//预警类型接口
warningTypes: any //预警接口数据
warningTypesDetails: any
warningTypesDetailsCopy: any
warningTypes: any //预警接口数据
warningTypesCopy: any
warningLevels: any
warningLevelsCopy: any
warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.warningTypesDetails = data.result
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result))
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)) //原始数据备份
this.warningTypes = (data.result as any).groupBy((t) => { return t.violationType });
this.warningTypesCopy = (data.result as any).groupBy((t) => { return t.violationType })
this.warningLevels = (data.result as any).groupBy((t) => { return t.level });
this.warningLevelsCopy = (data.result as any).groupBy((t) => { return t.level })
this.warningLevels.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
this.warningLevelsCopy.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
// console.log(111, this.warningTypesDetails)
// console.log(222, this.warningTypesCopy)
// console.log(333, this.warningLevels)
})
}
typeChange(e) {
if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningLevels = this.warningLevelsCopy
return
}
this.warningTypes.forEach(element => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningLevels = (element as any).groupBy((t) => { return t.level });
}
});
this.validateForm.patchValue({
event: null,
});
}
levelChange(e) {
if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningTypes = this.warningTypesCopy
return
}
this.warningLevels.forEach(element => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningTypes = (element as any).groupBy((t) => { return t.violationType });
}
});
this.validateForm.patchValue({
event: null,
});
}
look(item) {

18
src/app/pages/criminal-records/criminal-records.component.html

@ -58,11 +58,11 @@
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear formControlName="level" nzPlaceHolder="请选择预警级别">
<nz-option nzValue="1" nzLabel="Ⅰ级"></nz-option>
<nz-option nzValue="2" nzLabel="Ⅱ级"></nz-option>
<nz-option nzValue="3" nzLabel="Ⅲ级"></nz-option>
<nz-option nzValue="4" nzLabel="Ⅳ级"></nz-option>
<nz-select (ngModelChange)="levelChange($event)" nzAllowClear id="level" formControlName="level"
nzPlaceHolder="请选择预警级别">
<nz-option *ngFor="let item of warningLevels" [nzValue]="item.key"
[nzLabel]="item.key == 1 ? 'Ⅰ级' : item.key == 2 ? 'Ⅱ级' : item.key == 3 ? 'Ⅲ级' : item.key == 4 ? 'Ⅳ级' : null">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
@ -75,17 +75,17 @@
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-item class="searchParamsZ eventInput">
<nz-form-control>
<nz-select nzAllowClear formControlName="event" nzPlaceHolder="请选择预警事件">
<nz-select [nzMaxTagCount]="1" nzMode="multitagsple" nzAllowClear formControlName="event" nzPlaceHolder="请选择预警事件">
<nz-option *ngFor="let item of warningTypesDetails" [nzValue]="item.id" [nzLabel]="item.eventSystemName">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-item class="searchParamsS eventInput">
<nz-form-control>
<nz-select nzAllowClear formControlName="site" nzPlaceHolder="请选择站内发生区域">
<nz-select [nzMaxTagCount]="1" nzMode="multitagsple" nzAllowClear formControlName="site" nzPlaceHolder="请选择站内发生区域">
<nz-option nzValue="出入口" nzLabel="出入口"></nz-option>
<nz-option nzValue="加油区" nzLabel="加油区"></nz-option>
<nz-option nzValue="油罐区" nzLabel="油罐区"></nz-option>

11
src/app/pages/criminal-records/criminal-records.component.scss

@ -32,6 +32,17 @@
width: 220px;
}
.searchParamsZ {
min-width: 200px;
max-width: 250px;
margin-right: 3px;
}
.searchParamsS {
min-width: 180px;
max-width: 250px;
}
.btn {
// flex: 1;
}

63
src/app/pages/criminal-records/criminal-records.component.ts

@ -439,7 +439,7 @@ export class CriminalRecordsComponent implements OnInit {
getViolateRecordList() {
let ViolationIds = []
if (this.validateForm.value.event) {
ViolationIds.push(this.validateForm.value.event)
ViolationIds = this.validateForm.value.event
}
if (this.validateForm.value.type && !this.validateForm.value.event) {
this.warningTypesDetails.forEach(item => {
@ -457,7 +457,7 @@ export class CriminalRecordsComponent implements OnInit {
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.site,
ViolateAreas: this.validateForm.value.site,
OrganizationUnitId: JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id,
IsContainsChildren: 'true',
ViolateTime: this.validateForm.value.datePicker ? [moment(this.validateForm.value.datePicker[0]).format('yyyy-MM-DD'), moment(this.validateForm.value.datePicker[1]).format('yyyy-MM-DD')] : null,
@ -518,24 +518,79 @@ export class CriminalRecordsComponent implements OnInit {
//预警类型接口
warningTypes: any //预警接口数据
warningTypesDetails: any
warningTypesDetailsCopy: any
warningTypes: any //预警接口数据
warningTypesCopy: any
warningLevels: any
warningLevelsCopy: any
warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.warningTypesDetails = data.result
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result))
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)) //原始数据备份
this.warningTypes = (data.result as any).groupBy((t) => { return t.violationType });
this.warningTypesCopy = (data.result as any).groupBy((t) => { return t.violationType })
this.warningLevels = (data.result as any).groupBy((t) => { return t.level });
this.warningLevelsCopy = (data.result as any).groupBy((t) => { return t.level })
this.warningLevels.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
this.warningLevelsCopy.sort(function (a, b) {
if (a.key < b.key) {
return -1;
} else if (a.key == b.key) {
return 0;
} else {
return 1;
}
});
// console.log(111, this.warningTypesDetails)
// console.log(222, this.warningTypesCopy)
// console.log(333, this.warningLevels)
})
}
typeChange(e) {
if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningLevels = this.warningLevelsCopy
return
}
this.warningTypes.forEach(element => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningLevels = (element as any).groupBy((t) => { return t.level });
}
});
this.validateForm.patchValue({
event: null,
});
}
levelChange(e) {
if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy
this.warningTypes = this.warningTypesCopy
return
}
this.warningLevels.forEach(element => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningTypes = (element as any).groupBy((t) => { return t.violationType });
}
});
this.validateForm.patchValue({
event: null,
});
}
selectedType = '分布'
selectedRankingType = '站点排名'
echartClick(type) {

14
src/theme.less

@ -44,6 +44,20 @@
.ant-pagination-item-active a {
background: #107495;
}
.eventInput {
.ant-select-selection-item {
background: #143c61;
color: #fff;
}
.ant-select-selection-item-remove {
color: #fff;
}
}
}
//查询重置按钮

Loading…
Cancel
Save