diff --git a/src/app/http-interceptors/base-interceptor.ts b/src/app/http-interceptors/base-interceptor.ts index ba06d87..de1f108 100644 --- a/src/app/http-interceptors/base-interceptor.ts +++ b/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) { // 发生客户端或网络错误。相应处理。 diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.html b/src/app/pages/criminal-records-admin/criminal-records-admin.component.html index ffbb19e..ed01b39 100644 --- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.html +++ b/src/app/pages/criminal-records-admin/criminal-records-admin.component.html @@ -62,11 +62,11 @@
- - - - - + + + @@ -97,17 +97,19 @@ - + - + - + - + @@ -131,11 +133,6 @@
- diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss b/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss index 0807ed4..f974949 100644 --- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.scss +++ b/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; } diff --git a/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts b/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts index 35205b6..6abb8c1 100644 --- a/src/app/pages/criminal-records-admin/criminal-records-admin.component.ts +++ b/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 @@ -577,30 +576,81 @@ export class CriminalRecordsAdminComponent implements OnInit { }); this.list = [] this.SkipCount = '0' - console.log('xxxx',this.validateForm.value) + console.log('xxxx', this.validateForm.value) this.getViolateRecordList() } //预警类型接口 - 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) { diff --git a/src/app/pages/criminal-records/criminal-records.component.html b/src/app/pages/criminal-records/criminal-records.component.html index da98093..3f8eeea 100644 --- a/src/app/pages/criminal-records/criminal-records.component.html +++ b/src/app/pages/criminal-records/criminal-records.component.html @@ -58,11 +58,11 @@ - - - - - + + + @@ -75,17 +75,17 @@ - + - + - + - + diff --git a/src/app/pages/criminal-records/criminal-records.component.scss b/src/app/pages/criminal-records/criminal-records.component.scss index f861cc2..af241a7 100644 --- a/src/app/pages/criminal-records/criminal-records.component.scss +++ b/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; } diff --git a/src/app/pages/criminal-records/criminal-records.component.ts b/src/app/pages/criminal-records/criminal-records.component.ts index 0d3262f..1aadbfd 100644 --- a/src/app/pages/criminal-records/criminal-records.component.ts +++ b/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) { diff --git a/src/theme.less b/src/theme.less index 286d270..b73127c 100644 --- a/src/theme.less +++ b/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; + } + } + + } //查询重置按钮