From 35d3a8a67c35272fe215c8c1ec7f886122853b21 Mon Sep 17 00:00:00 2001 From: Sjh <55341701@qq.com> Date: Thu, 23 Jan 2025 09:59:26 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E8=AF=81=E7=85=A7=E8=B5=84?= =?UTF-8?q?=E8=B4=A8=E9=A2=84=E8=AD=A6=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proxy.config.json | 4 +- .../criminal-records-admin.component.ts | 7 + .../criminal-records.component.ts | 1140 ++++++++++------- .../singlelogin/singlelogin.component.ts | 1 + .../today-warning-admin.component.ts | 7 + .../today-warning/today-warning.component.ts | 7 + 6 files changed, 687 insertions(+), 479 deletions(-) diff --git a/proxy.config.json b/proxy.config.json index 1ab96ca..8b26b6c 100644 --- a/proxy.config.json +++ b/proxy.config.json @@ -1,6 +1,6 @@ { "/api": { - "target": "http://121.36.37.70:8906/", + "target": "https://znaq.sinochemoilmarketing.com/", "测试1": "http://121.36.37.70:8906/", "测试2": "https://znaq.sinochemoilmarketing.com/", "测试3": "https://gas.anxincloud.cn/", @@ -9,7 +9,7 @@ "changeOrigin": true }, "/signalr": { - "target": "http://121.36.37.70:8906/", + "target": "https://znaq.sinochemoilmarketing.com/", "secure": false, "ws": true, "logLevel": "debug" diff --git a/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts b/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts index 55c645e..e641cf3 100644 --- a/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts +++ b/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts @@ -662,6 +662,13 @@ export class CriminalRecordsAdminComponent implements OnInit { params: params, }) .subscribe((data: any) => { + data.result.items = data.result.items.filter((item) => { + return ( + item.violation.violationType != "证照资质" || + (item.violation.violationType == "证照资质" && + item.gasStation.companyName.includes("延长")) + ); + }); this.list = this.list.concat(data.result.items); this.list = [...this.list]; this.totalCount = data.result.totalCount; diff --git a/src/app/pages/records/criminal-records/criminal-records.component.ts b/src/app/pages/records/criminal-records/criminal-records.component.ts index ae1003a..cbd56fc 100644 --- a/src/app/pages/records/criminal-records/criminal-records.component.ts +++ b/src/app/pages/records/criminal-records/criminal-records.component.ts @@ -1,109 +1,134 @@ -import { HttpClient } from '@angular/common/http'; -import { Component, OnInit, ViewContainerRef, ElementRef } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import * as echarts from 'echarts'; -import { NzModalService } from 'ng-zorro-antd/modal'; -import { GetOutOfLineDetailsComponent } from '../../today-warning/get-out-of-line-details/get-out-of-line-details.component'; -import * as moment from 'moment'; -import { fromEvent } from 'rxjs'; -import { debounceTime } from 'rxjs/operators'; -import { Router } from '@angular/router'; -import { DispositionComponent } from '../../disposition/disposition.component'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { DisposeequipmentComponent } from '../warning-statistics-list/disposeequipment/disposeequipment.component'; -import { IsShowEchartsService } from 'src/app/service/isShowEcharts.service'; +import { HttpClient } from "@angular/common/http"; +import { Component, OnInit, ViewContainerRef, ElementRef } from "@angular/core"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import * as echarts from "echarts"; +import { NzModalService } from "ng-zorro-antd/modal"; +import { GetOutOfLineDetailsComponent } from "../../today-warning/get-out-of-line-details/get-out-of-line-details.component"; +import * as moment from "moment"; +import { fromEvent } from "rxjs"; +import { debounceTime } from "rxjs/operators"; +import { Router } from "@angular/router"; +import { DispositionComponent } from "../../disposition/disposition.component"; +import { NzMessageService } from "ng-zorro-antd/message"; +import { DisposeequipmentComponent } from "../warning-statistics-list/disposeequipment/disposeequipment.component"; +import { IsShowEchartsService } from "src/app/service/isShowEcharts.service"; @Component({ - selector: 'app-criminal-records', - templateUrl: './criminal-records.component.html', - styleUrls: ['./criminal-records.component.scss'] + selector: "app-criminal-records", + templateUrl: "./criminal-records.component.html", + styleUrls: ["./criminal-records.component.scss"], }) export class CriminalRecordsComponent implements OnInit { validateForm!: FormGroup; - constructor(private http: HttpClient, private fb: FormBuilder, private router: Router, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private element: ElementRef, private message: NzMessageService, private isShowEcharts: IsShowEchartsService) { } + constructor( + private http: HttpClient, + private fb: FormBuilder, + private router: Router, + private modal: NzModalService, + private viewContainerRef: ViewContainerRef, + private element: ElementRef, + private message: NzMessageService, + private isShowEcharts: IsShowEchartsService + ) {} - myChart: any //左侧饼图 + myChart: any; //左侧饼图 option = { - color: ['#91CCFF', '#46DFFF', '#36A2FF', '#FF6181', '#B4C3FF', '#FF9963', '#5A9CFF', '#4BFFD4', '#46DFFF', '#91CCFF'], + color: [ + "#91CCFF", + "#46DFFF", + "#36A2FF", + "#FF6181", + "#B4C3FF", + "#FF9963", + "#5A9CFF", + "#4BFFD4", + "#46DFFF", + "#91CCFF", + ], tooltip: { - trigger: 'item'//触发类型 + trigger: "item", //触发类型 }, series: [ { // name: 'Access From', - type: 'pie', - radius: ['58%', '75%'],//内半径外,外半径 - left: '0', - top: '9%', - avoidLabelOverlap: false,//防止标签重叠策略 - label: {//每一个标签外网延伸的引导说明 + type: "pie", + radius: ["58%", "75%"], //内半径外,外半径 + left: "0", + top: "9%", + avoidLabelOverlap: false, //防止标签重叠策略 + label: { + //每一个标签外网延伸的引导说明 show: false, - position: 'outside' + position: "outside", }, - labelLine: {//引导线 + labelLine: { + //引导线 show: true, - showAbove: true + showAbove: true, }, - emphasis: {//中间高亮区域 + emphasis: { + //中间高亮区域 label: { show: false, - fontSize: '40', - fontWeight: 'bold' - } + fontSize: "40", + fontWeight: "bold", + }, }, - data: [ - ], - tooltip: {//鼠标移入提示 - position: 'right', + data: [], + tooltip: { + //鼠标移入提示 + position: "right", padding: [14, 19], - backgroundColor: 'rgba(28, 129, 218, 0.4)', + backgroundColor: "rgba(28, 129, 218, 0.4)", textStyle: { - color: '#fff', - fontSize: 12 + color: "#fff", + fontSize: 12, }, - formatter: "{b} : {c} ({d}%)" - } - } - ] + formatter: "{b} : {c} ({d}%)", + }, + }, + ], }; - - mybarChart: any //柱状图 + mybarChart: any; //柱状图 baroption = { xAxis: { - type: 'category', + type: "category", data: [], axisLine: { show: false, lineStyle: { - color: '#91CCFF' - } + color: "#91CCFF", + }, }, - axisTick: {//刻度线 - show: false + axisTick: { + //刻度线 + show: false, }, - inverse: true - + inverse: true, }, yAxis: { - type: 'value', + type: "value", nameTextStyle: { - color: '#C4E2FC' + color: "#C4E2FC", }, - splitLine: {//分割线 + splitLine: { + //分割线 lineStyle: { - color: ['#0f4374'], - width: 2 - } + color: ["#0f4374"], + width: 2, + }, }, - axisTick: {//刻度线 - show: false + axisTick: { + //刻度线 + show: false, }, - axisLine: {//轴线 + axisLine: { + //轴线 show: false, lineStyle: { - color: '#C4E2FC' - } - } + color: "#C4E2FC", + }, + }, }, tooltip: { // trigger: 'axis' @@ -111,85 +136,91 @@ export class CriminalRecordsComponent implements OnInit { series: [ { data: [], - type: 'bar', + type: "bar", itemStyle: { color: { - type: 'linear', + type: "linear", x: 0, y: 0, x2: 0, y2: 1, - colorStops: [{ - offset: 0, color: '#23F0FF' // 0% 处的颜色 - }, { - offset: 1, color: 'rgba(35, 153, 255, 0.1)' // 100% 处的颜色 - }], - global: false // 缺省为 false - } + colorStops: [ + { + offset: 0, + color: "#23F0FF", // 0% 处的颜色 + }, + { + offset: 1, + color: "rgba(35, 153, 255, 0.1)", // 100% 处的颜色 + }, + ], + global: false, // 缺省为 false + }, }, - barWidth: '25%' + barWidth: "25%", }, { data: [], - type: 'line', - symbol: 'circle', + type: "line", + symbol: "circle", symbolSize: 8, label: { - show: true + show: true, }, itemStyle: { - color: '#fff', - shadowColor: '#fff', - shadowBlur: 10 + color: "#fff", + shadowColor: "#fff", + shadowBlur: 10, }, lineStyle: { - color: '#FFCC8A', - width: 1 - } - } + color: "#FFCC8A", + width: 1, + }, + }, ], grid: { - left: '42px', - right: '30px', - bottom: '38px', - top: '80px' - } + left: "42px", + right: "30px", + bottom: "38px", + top: "80px", + }, }; baroption2 = { xAxis: { - type: 'value', - show: false + type: "value", + show: false, }, tooltip: { // trigger: 'axis' }, yAxis: { - type: 'category', + type: "category", data: [], axisLine: { show: false, lineStyle: { - color: '#91CCFF', - } + color: "#91CCFF", + }, }, - axisTick: {//刻度线 - show: false + axisTick: { + //刻度线 + show: false, }, axisLabel: { formatter: function (value, index) { - let newParamsName = ''; + let newParamsName = ""; const paramsNameNumber = value.length; const provideNumber = 10; const rowNumber = Math.ceil(paramsNameNumber / provideNumber); if (paramsNameNumber > provideNumber) { for (let p = 0; p < rowNumber; p++) { - let tempStr = ''; + let tempStr = ""; const start = p * provideNumber; const end = start + provideNumber; if (p == rowNumber - 1) { tempStr = value.substring(start, paramsNameNumber); } else { - tempStr = value.substring(start, end) + '\n'; + tempStr = value.substring(start, end) + "\n"; } newParamsName += tempStr; } @@ -197,156 +228,196 @@ export class CriminalRecordsComponent implements OnInit { newParamsName = value; } // 格式化成月/日,只在第一个刻度显示年份 - return '{s|·}' + `{a|${newParamsName}}`; + return "{s|·}" + `{a|${newParamsName}}`; }, rich: { a: { - color: '#C4E2FC', + color: "#C4E2FC", padding: [0, 0, 0, 8], }, s: { - color: '#fff', + color: "#fff", borderWidth: 1, - borderColor: '#23D9FF', - backgroundColor: '#fff', + borderColor: "#23D9FF", + backgroundColor: "#fff", width: 4, height: 4, shadowBlur: 3, - shadowColor: "#fff" - } - } + shadowColor: "#fff", + }, + }, }, - inverse: true + inverse: true, }, - series: - { + series: { label: { // 柱图头部显示值 show: true, position: "right", color: "#fff", fontSize: 12, - formatter: '{c}', - offset: [6, 0] + formatter: "{c}", + offset: [6, 0], }, data: [], - type: 'bar', + type: "bar", itemStyle: { color: { - type: 'linear', + type: "linear", x: 0, y: 0, x2: 1, y2: 0, - colorStops: [{ - offset: 0, color: '#063d72' // 0% 处的颜色 - }, { - offset: 1, color: '#FF9963' // 100% 处的颜色 - }], - global: false // 缺省为 false - } + colorStops: [ + { + offset: 0, + color: "#063d72", // 0% 处的颜色 + }, + { + offset: 1, + color: "#FF9963", // 100% 处的颜色 + }, + ], + global: false, // 缺省为 false + }, }, - barWidth: '36%', - - } - , + barWidth: "36%", + }, grid: { - left: '150px', - right: '80px', - bottom: '3px', - top: '36px' - } - } + left: "150px", + right: "80px", + bottom: "3px", + top: "36px", + }, + }; getThirtyDays() { //获取当前日期 let myDate = new Date(); var nowY = myDate.getFullYear(); var nowM = myDate.getMonth() + 1; var nowD = myDate.getDate(); - var enddateStr = nowY + "-" + (nowM < 10 ? "0" + nowM : nowM) + "-" + (nowD < 10 ? "0" + nowD : nowD);//当前日期 + var enddateStr = + nowY + + "-" + + (nowM < 10 ? "0" + nowM : nowM) + + "-" + + (nowD < 10 ? "0" + nowD : nowD); //当前日期 var enddate = new Date(enddateStr); - //获取三十天前日期 - var lw = new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30);//最后一个数字30可改,30天的意思 + var lw = new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30); //最后一个数字30可改,30天的意思 var lastY = lw.getFullYear(); var lastM = lw.getMonth() + 1; var lastD = lw.getDate(); - var startdateStr = lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD);//三十天之前日期 + var startdateStr = + lastY + + "-" + + (lastM < 10 ? "0" + lastM : lastM) + + "-" + + (lastD < 10 ? "0" + lastD : lastD); //三十天之前日期 var startDate = new Date(startdateStr); - const dateList = [] + const dateList = []; while (true) { - startDate.setDate(startDate.getDate() + 1) + startDate.setDate(startDate.getDate() + 1); if (startDate.getTime() <= enddate.getTime()) { if (startDate.getDate() < 10) { // startDate.getFullYear() 获取年,此处没加上年份 - dateList.push((startDate.getMonth() + 1) + '.0' + startDate.getDate()) + dateList.push(startDate.getMonth() + 1 + ".0" + startDate.getDate()); } else { - dateList.push((startDate.getMonth() + 1) + '.' + startDate.getDate()) + dateList.push(startDate.getMonth() + 1 + "." + startDate.getDate()); } } else { - break + break; } } return dateList; } - isEcharts: boolean = true + isEcharts: boolean = true; isEchartsShow() { - this.isEcharts = !this.isEcharts + this.isEcharts = !this.isEcharts; setTimeout(() => { - let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px' + let tableHeader = + this.element.nativeElement.querySelector( + `.ant-table-header` + ).clientHeight; + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - + tableHeader - + 10 + + "px"; }, 0); } - startdate - enddate + startdate; + enddate; - isMisinformation: boolean = false//误报按钮的显隐 - button = false - tableScrollHeight - resizeListener + isMisinformation: boolean = false; //误报按钮的显隐 + button = false; + tableScrollHeight; + resizeListener; ngOnInit(): void { - // this.isShowEcharts.getMessage().subscribe((message: any) => { // this.isEchartsShow() // }); - this.tableScrollHeight = '100px' + this.tableScrollHeight = "100px"; // 页面监听 - this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { - let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px' - }); - let loginUserInfo - if (sessionStorage.getItem('isGasStation') == 'true') { - loginUserInfo = JSON.parse(sessionStorage.getItem('userdataOfgasstation')) - this.returnLastMenus(true) + this.resizeListener = fromEvent(window, "resize") + .pipe(debounceTime(100)) + .subscribe((event) => { + let tableHeader = + this.element.nativeElement.querySelector( + `.ant-table-header` + ).clientHeight; + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - + tableHeader - + 10 + + "px"; + }); + let loginUserInfo; + if (sessionStorage.getItem("isGasStation") == "true") { + loginUserInfo = JSON.parse( + sessionStorage.getItem("userdataOfgasstation") + ); + this.returnLastMenus(true); } else { - loginUserInfo = JSON.parse(sessionStorage.getItem('userdata')) - this.returnLastMenus(false) + loginUserInfo = JSON.parse(sessionStorage.getItem("userdata")); + this.returnLastMenus(false); } - if (loginUserInfo.permissions.find((item) => { - return item.name == 'Data.Violation.Positive.Censor' - })) { - this.isMisinformation = true + if ( + loginUserInfo.permissions.find((item) => { + return item.name == "Data.Violation.Positive.Censor"; + }) + ) { + this.isMisinformation = true; } else { - this.isMisinformation = false + this.isMisinformation = false; } //当前日期 let myDate: any = new Date(); let nowY = myDate.getFullYear(); let nowM = myDate.getMonth() + 1; let nowD = myDate.getDate(); - this.enddate = nowY + "-" + (nowM < 10 ? "0" + nowM : nowM) + "-" + (nowD < 10 ? "0" + nowD : nowD);//当前日期 + this.enddate = + nowY + + "-" + + (nowM < 10 ? "0" + nowM : nowM) + + "-" + + (nowD < 10 ? "0" + nowD : nowD); //当前日期 //获取三十天前日期 - let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29);//最后一个数字30可改,30天的意思 + let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29); //最后一个数字30可改,30天的意思 let lastY = lw.getFullYear(); let lastM = lw.getMonth() + 1; let lastD = lw.getDate(); - this.startdate = lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD);//三十天之前日期 + this.startdate = + lastY + + "-" + + (lastM < 10 ? "0" + lastM : lastM) + + "-" + + (lastD < 10 ? "0" + lastD : lastD); //三十天之前日期 this.validateForm = this.fb.group({ level: [null], type: [null], @@ -355,198 +426,249 @@ export class CriminalRecordsComponent implements OnInit { appealState: [null], site: [null], datePicker: [[this.startdate, this.enddate]], - misinformation: ['true'], + misinformation: ["true"], }); setTimeout(() => { // 饼图 - this.myChart = echarts.init(document.getElementById('piechart')); + this.myChart = echarts.init(document.getElementById("piechart")); this.myChart.setOption(this.option); //柱状折线图 - this.mybarChart = echarts.init(document.getElementById('barchart')); + this.mybarChart = echarts.init(document.getElementById("barchart")); this.mybarChart.setOption(this.baroption); - }, 0); + this.warningType(); + this.getViolateRecordList(); - this.warningType() - this.getViolateRecordList() - - this.getAggregations() - + this.getAggregations(); } ngOnDestroy(): void { - this.resizeListener.unsubscribe() + this.resizeListener.unsubscribe(); } returnLastMenus(e) { - let userMenu + let userMenu; if (e) { - userMenu = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).menus + userMenu = JSON.parse( + sessionStorage.getItem("userdataOfgasstation") + ).menus; } else { - userMenu = JSON.parse(sessionStorage.getItem('userdata')).menus + userMenu = JSON.parse(sessionStorage.getItem("userdata")).menus; } for (let index = 0; index < userMenu.length; index++) { for (let k = 0; k < userMenu.length; k++) { if (userMenu[index].name == "预警类型统计") { if (userMenu[index].id == userMenu[k].parentId) { - this.button = true + this.button = true; } } - } } - return + return; } //刷新饼图图表数据 - num - echartsData: any + num; + echartsData: any; refreshPieData(data) { //饼图 let option = this.myChart.getOption(); - var num = 0 - data.pieTop.forEach(element => { - num += element.count - element.name = element.key - element.value = element.count + var num = 0; + data.pieTop.forEach((element) => { + num += element.count; + element.name = element.key; + element.value = element.count; }); - this.num = num + this.num = num; option.series[0].data = data.pieTop; this.myChart.setOption(option); } //刷新柱状折线图表数据 refreshBarLineData(data, type) { - console.log('统计图表数据', data) + console.log("统计图表数据", data); //柱状图 let option = this.mybarChart.getOption(); - console.log('柱图option', option) - if (type == 'month') {//近一个月柱状折线图 - option = this.baroption - let monthArr = [] - let valuedata = [] - data.timeTop.forEach(element => { - monthArr.push(moment(element.key).format('MM.DD')) - valuedata.push(element.count) + console.log("柱图option", option); + if (type == "month") { + //近一个月柱状折线图 + option = this.baroption; + let monthArr = []; + let valuedata = []; + data.timeTop.forEach((element) => { + monthArr.push(moment(element.key).format("MM.DD")); + valuedata.push(element.count); }); - option.xAxis.data = monthArr - option.series[0].data = valuedata - option.series[1].data = valuedata - } else if (type == 'eventTop') { - option = this.baroption2 - let ydata = [] - let valuedata = [] - data.eventTop.forEach(element => { - ydata.push(element.key) - valuedata.push(element.count) + option.xAxis.data = monthArr; + option.series[0].data = valuedata; + option.series[1].data = valuedata; + } else if (type == "eventTop") { + option = this.baroption2; + let ydata = []; + let valuedata = []; + data.eventTop.forEach((element) => { + ydata.push(element.key); + valuedata.push(element.count); }); - option.yAxis.data = ydata - option.series.data = valuedata - } else if (type == 'siteTop') { - option = this.baroption2 - let ydata = [] - let valuedata = [] - data.siteTop.forEach(element => { - ydata.push(element.key) - valuedata.push(element.count) + option.yAxis.data = ydata; + option.series.data = valuedata; + } else if (type == "siteTop") { + option = this.baroption2; + let ydata = []; + let valuedata = []; + data.siteTop.forEach((element) => { + ydata.push(element.key); + valuedata.push(element.count); }); - option.yAxis.data = ydata - option.series.data = valuedata + option.yAxis.data = ydata; + option.series.data = valuedata; } //1 this.mybarChart.setOption(option); } //获取统计信息 - chartsSpin: boolean = false + chartsSpin: boolean = false; getAggregations() { - this.chartsSpin = true - let ViolationIds = [] + this.chartsSpin = true; + let ViolationIds = []; if (this.validateForm.value.type) { - this.warningTypesDetails.forEach(item => { - item.id ? ViolationIds.push(item.id) : null + this.warningTypesDetails.forEach((item) => { + item.id ? ViolationIds.push(item.id) : null; }); } let body: any = { - organizationUnitId: JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id, + 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') + ' 00:00:00', moment(this.validateForm.value.datePicker[1]).format('yyyy-MM-DD') + ' 23:59:59'] : null - } - this.validateForm.value.level ? body.level = this.validateForm.value.level : null - this.validateForm.value.site ? body.violateArea = this.validateForm.value.site : null - ViolationIds.length != 0 ? body.violationType = ViolationIds : null - this.http.post('/api/services/app/ViolateRecord/Aggregations', body).subscribe((data: any) => { - this.echartsData = data.result - this.chartsSpin = false - this.refreshPieData(data.result) - this.refreshBarLineData(this.echartsData, 'month') - }) + ViolateTime: this.validateForm.value.datePicker + ? [ + moment(this.validateForm.value.datePicker[0]).format("yyyy-MM-DD") + + " 00:00:00", + moment(this.validateForm.value.datePicker[1]).format("yyyy-MM-DD") + + " 23:59:59", + ] + : null, + }; + this.validateForm.value.level + ? (body.level = this.validateForm.value.level) + : null; + this.validateForm.value.site + ? (body.violateArea = this.validateForm.value.site) + : null; + ViolationIds.length != 0 ? (body.violationType = ViolationIds) : null; + this.http + .post("/api/services/app/ViolateRecord/Aggregations", body) + .subscribe((data: any) => { + this.echartsData = data.result; + this.chartsSpin = false; + this.refreshPieData(data.result); + this.refreshBarLineData(this.echartsData, "month"); + }); } //获得违规记录列表 - SkipCount: string = '0' - MaxResultCount: string = '50' - list: any = [] - totalCount: string - tableSpin: boolean = false - isLoading = false + SkipCount: string = "0"; + MaxResultCount: string = "50"; + list: any = []; + totalCount: string; + tableSpin: boolean = false; + isLoading = false; getViolateRecordList() { - this.isLoading = true - let ViolationIds = [] + this.isLoading = true; + let ViolationIds = []; if (this.validateForm.value.event) { - ViolationIds = this.validateForm.value.event + ViolationIds = this.validateForm.value.event; } if (this.validateForm.value.type && !this.validateForm.value.event) { - this.warningTypesDetails.forEach(item => { - item.id ? ViolationIds.push(item.id) : null + this.warningTypesDetails.forEach((item) => { + item.id ? ViolationIds.push(item.id) : null; }); } - let disposalState - if (this.validateForm.value.disposalState == '0') { - disposalState = true - } else if (this.validateForm.value.disposalState == '1') { - disposalState = false + let disposalState; + if (this.validateForm.value.disposalState == "0") { + disposalState = true; + } else if (this.validateForm.value.disposalState == "1") { + disposalState = false; } else { - disposalState = null + disposalState = null; } let params = { Level: this.validateForm.value.level, ViolationIds: ViolationIds, 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') + ' 00:00:00', moment(this.validateForm.value.datePicker[1]).format('yyyy-MM-DD') + ' 23:59:59'] : null, + 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") + + " 00:00:00", + moment(this.validateForm.value.datePicker[1]).format("yyyy-MM-DD") + + " 23:59:59", + ] + : null, // ViolateTime: ['2021-05-21 00:00:00', '2022-06-20 23:59:59'], IsHandled: disposalState, SkipCount: this.SkipCount, MaxResultCount: this.MaxResultCount, AppealStatus: this.validateForm.value.appealState, - Positive: this.validateForm.value.misinformation - } - this.tableSpin = true - this.http.get('/api/services/app/ViolateRecord/GetAll', { - params: params - }).subscribe((data: any) => { - this.list = this.list.concat(data.result.items); - this.list = [...this.list] - // this.list = data.result.items - this.totalCount = data.result.totalCount - console.log('违规记录列表', data) - this.tableSpin = false - this.isLoading = false - setTimeout(() => { - let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px' - }, 0); - }) + Positive: this.validateForm.value.misinformation, + }; + this.tableSpin = true; + this.http + .get("/api/services/app/ViolateRecord/GetAll", { + params: params, + }) + .subscribe((data: any) => { + data.result.items = data.result.items.filter((item) => { + return ( + item.violation.violationType != "证照资质" || + (item.violation.violationType == "证照资质" && + item.gasStation.companyName.includes("延长")) + ); + }); + this.list = this.list.concat(data.result.items); + this.list = [...this.list]; + // this.list = data.result.items + this.totalCount = data.result.totalCount; + console.log("违规记录列表", data); + this.tableSpin = false; + this.isLoading = false; + setTimeout(() => { + let tableHeader = + this.element.nativeElement.querySelector( + `.ant-table-header` + ).clientHeight; + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - + tableHeader - + 10 + + "px"; + }, 0); + }); } ngAfterViewInit(): void { - fromEvent(this.element.nativeElement.querySelector(`.ant-table-body`) as HTMLCanvasElement, 'scroll').pipe(debounceTime(100)).subscribe(async (event: any) => { //监听 DOM 滚动事件 - if (event.target.scrollHeight - (event.target.scrollTop + event.target.clientHeight) <= 10) { - if (this.totalCount > this.list.length) { - console.log('需要加载数据了', event) - this.SkipCount = String(Number(this.SkipCount) + 50) - this.getViolateRecordList() + fromEvent( + this.element.nativeElement.querySelector( + `.ant-table-body` + ) as HTMLCanvasElement, + "scroll" + ) + .pipe(debounceTime(100)) + .subscribe(async (event: any) => { + //监听 DOM 滚动事件 + if ( + event.target.scrollHeight - + (event.target.scrollTop + event.target.clientHeight) <= + 10 + ) { + if (this.totalCount > this.list.length) { + console.log("需要加载数据了", event); + this.SkipCount = String(Number(this.SkipCount) + 50); + this.getViolateRecordList(); + } } - } - }); + }); } submitForm(): void { @@ -554,10 +676,10 @@ export class CriminalRecordsComponent implements OnInit { this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].updateValueAndValidity(); } - this.totalCount = null - this.list = [] - this.SkipCount = '0' - this.getViolateRecordList() + this.totalCount = null; + this.list = []; + this.SkipCount = "0"; + this.getViolateRecordList(); } resetForm(e: MouseEvent): void { e.preventDefault(); @@ -568,68 +690,85 @@ export class CriminalRecordsComponent implements OnInit { } this.validateForm.patchValue({ datePicker: [this.startdate, this.enddate], - misinformation: 'true' + misinformation: "true", }); - this.totalCount = null - this.list = [] - this.SkipCount = '0' - this.getViolateRecordList() + this.totalCount = null; + this.list = []; + this.SkipCount = "0"; + this.getViolateRecordList(); } - //预警类型接口 - warningTypesDetails: any - warningTypesDetailsCopy: any + warningTypesDetails: any; + warningTypesDetailsCopy: any; - warningTypes: any //预警接口数据 - warningTypesCopy: any - warningLevels: any - warningLevelsCopy: any + warningTypes: any; //预警接口数据 + warningTypesCopy: any; + warningLevels: any; + warningLevelsCopy: any; warningType() { - this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => { - - data.result = data.result.filter((item) => { - return item.eventSystemName != '设备报废临期提醒' && item.eventSystemName != '设备维保临期提醒' && item.eventSystemName != '证照有效期办理提醒' && item.eventSystemName != '证照有效期临期提醒' && item.eventSystemName != '证照年检办理提醒' && item.eventSystemName != '证照年检临期提醒' - }) - 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; - } + this.http + .get("/api/services/app/Violation/GetAllList") + .subscribe((data: any) => { + data.result = data.result.filter((item) => { + return ( + item.eventSystemName != "设备报废临期提醒" && + item.eventSystemName != "设备维保临期提醒" && + item.eventSystemName != "证照有效期办理提醒" && + item.eventSystemName != "证照有效期临期提醒" && + item.eventSystemName != "证照年检办理提醒" && + item.eventSystemName != "证照年检临期提醒" + ); + }); + 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) }); - // 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.warningTypesDetails = this.warningTypesDetailsCopy; + this.warningLevels = this.warningLevelsCopy; + return; } - this.warningTypes.forEach(element => { + this.warningTypes.forEach((element) => { if (element.key == e) { - this.warningTypesDetails = element - this.warningLevels = (element as any).groupBy((t) => { return t.level }); + this.warningTypesDetails = element; + this.warningLevels = (element as any).groupBy((t) => { + return t.level; + }); } }); this.validateForm.patchValue({ @@ -638,17 +777,19 @@ export class CriminalRecordsComponent implements OnInit { } levelChange(e) { if (!e) { - this.warningTypesDetails = this.warningTypesDetailsCopy - this.warningTypes = this.warningTypesCopy + this.warningTypesDetails = this.warningTypesDetailsCopy; + this.warningTypes = this.warningTypesCopy; this.validateForm.patchValue({ type: null, }); - return + return; } - this.warningLevels.forEach(element => { + this.warningLevels.forEach((element) => { if (element.key == e) { - this.warningTypesDetails = element - this.warningTypes = (element as any).groupBy((t) => { return t.violationType }); + this.warningTypesDetails = element; + this.warningTypes = (element as any).groupBy((t) => { + return t.violationType; + }); } }); this.validateForm.patchValue({ @@ -656,100 +797,126 @@ export class CriminalRecordsComponent implements OnInit { }); } - - - selectedType = '分布' - selectedRankingType = '站点排名' + selectedType = "分布"; + selectedRankingType = "站点排名"; echartClick(type) { - this.selectedType = type - this.mybarChart.dispose() - this.mybarChart = echarts.init(document.getElementById('barchart')); - if (type == '排名') { - console.log(this.selectedRankingType) - this.refreshBarLineData(this.echartsData, 'eventTop') + this.selectedType = type; + this.mybarChart.dispose(); + this.mybarChart = echarts.init(document.getElementById("barchart")); + if (type == "排名") { + console.log(this.selectedRankingType); + this.refreshBarLineData(this.echartsData, "eventTop"); } else { - this.refreshBarLineData(this.echartsData, 'month') + this.refreshBarLineData(this.echartsData, "month"); } - } look(item) { - if (item.violation.violationType == '设备监测') { - item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot) + if (item.violation.violationType == "设备监测") { + item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot); const modal = this.modal.create({ nzContent: DisposeequipmentComponent, nzViewContainerRef: this.viewContainerRef, nzWidth: 380, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, nzClosable: false, nzOnOk: async () => { if (instance.isScrap) { - await new Promise(resolve => { + await new Promise((resolve) => { let body = { id: item.violatedItemSnapshotObj.id, name: instance.copydata2.violatedItemSnapshotObj.name, - storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation, - productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'), - maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'), - validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'), + storageLocation: + instance.copydata2.violatedItemSnapshotObj.storageLocation, + productionDate: moment( + instance.copydata2.violatedItemSnapshotObj.productionDate + ).format("yyyy-MM-DD"), + maintenanceDate: moment( + instance.copydata2.violatedItemSnapshotObj.maintenanceDate + ).format("yyyy-MM-DD"), + validityEndTime: moment( + instance.copydata2.violatedItemSnapshotObj.validityEndTime + ).format("yyyy-MM-DD"), isScrapped: true, - organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId - } - this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { - let body = { - id: item.id, - handleRecord: '报废成功!' - } - this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { - resolve(data) - this.message.create('success', '报废成功!'); - item.handleTime = new Date() - return true - }) - }) - }) + organizationUnitId: + item.violatedItemSnapshotObj.organizationUnitId, + }; + this.http + .put("/api/services/app/FireEquipment/Update", body) + .subscribe((data: any) => { + let body = { + id: item.id, + handleRecord: "报废成功!", + }; + this.http + .post( + "/api/services/app/ViolateRecord/HandleViolateRecord", + body + ) + .subscribe((data) => { + resolve(data); + this.message.create("success", "报废成功!"); + item.handleTime = new Date(); + return true; + }); + }); + }); } else { if (instance.validateForm.valid) { - await new Promise(resolve => { + await new Promise((resolve) => { let body = { id: item.violatedItemSnapshotObj.id, name: instance.validateForm.value.name, storageLocation: instance.validateForm.value.storageLocation, - productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'), - maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'), - validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'), - organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId - } - this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { - // item.violatedItemSnapshotObj = data.result - let body = { - id: item.id, - handleRecord: '维保成功!' - } - this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { - resolve(data) - this.message.create('success', '维保成功!'); - item.handleTime = new Date() - return true - }) - }) - }) + productionDate: moment( + instance.validateForm.value.productionDate + ).format("yyyy-MM-DD"), + maintenanceDate: moment( + instance.validateForm.value.maintenanceDate + ).format("yyyy-MM-DD"), + validityEndTime: moment( + instance.validateForm.value.validityEndTime + ).format("yyyy-MM-DD"), + organizationUnitId: + item.violatedItemSnapshotObj.organizationUnitId, + }; + this.http + .put("/api/services/app/FireEquipment/Update", body) + .subscribe((data: any) => { + // item.violatedItemSnapshotObj = data.result + let body = { + id: item.id, + handleRecord: "维保成功!", + }; + this.http + .post( + "/api/services/app/ViolateRecord/HandleViolateRecord", + body + ) + .subscribe((data) => { + resolve(data); + this.message.create("success", "维保成功!"); + item.handleTime = new Date(); + return true; + }); + }); + }); } else { - this.message.create('warning', '请填写完整!'); - return false + this.message.create("warning", "请填写完整!"); + return false; } } - } + }, }); const instance = modal.getContentComponent(); } else { @@ -757,132 +924,151 @@ export class CriminalRecordsComponent implements OnInit { nzContent: GetOutOfLineDetailsComponent, nzWrapClassName: "vertical-center-modal", nzViewContainerRef: this.viewContainerRef, - nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, + nzWidth: + document.documentElement.clientHeight < 650 || + document.documentElement.clientWidth < 1400 + ? 1000 + : 1200, nzClosable: false, - nzClassName: 'modelnobg', + nzClassName: "modelnobg", nzBodyStyle: { - 'border-radius': '0px', - 'padding': '0px', + "border-radius": "0px", + padding: "0px", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, nzOnOk: async () => { for (let index = 0; index < this.list.length; index++) { const element = this.list[index]; if (element.id == item.id) { - this.list.splice(index, 1) - this.totalCount = String(Number(this.totalCount) - 1) - this.SkipCount = String(Number(this.SkipCount) - 1) - this.list = [...this.list] + this.list.splice(index, 1); + this.totalCount = String(Number(this.totalCount) - 1); + this.SkipCount = String(Number(this.SkipCount) - 1); + this.list = [...this.list]; } } - } + }, }); const instance = modal.getContentComponent(); } - } goOilList() { - this.router.navigate(['/records/petrolStation/oliunloadinglist']) + this.router.navigate(["/records/petrolStation/oliunloadinglist"]); } goWarningList() { - this.router.navigate(['/records/petrolStation/warningstatisticslist']) + this.router.navigate(["/records/petrolStation/warningstatisticslist"]); } goMisinformationList() { - this.router.navigate(['records/petrolStation/misinformationList']) + this.router.navigate(["records/petrolStation/misinformationList"]); } dispose(item) { - console.log(item) + console.log(item); const modal = this.modal.create({ nzContent: DispositionComponent, nzWrapClassName: "vertical-center-modal", nzViewContainerRef: this.viewContainerRef, nzWidth: 380, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzComponentParams: {}, nzFooter: null, nzClosable: false, nzOnOk: async () => { if (instance.validateForm.valid) { - await new Promise(resolve => { + await new Promise((resolve) => { let body = { id: item.id, - handleRecord: instance.validateForm.value.content - } - this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { - resolve(data) - this.message.create('success', '处置成功!'); - item.handleTime = new Date() - return true - }) - }) + handleRecord: instance.validateForm.value.content, + }; + this.http + .post("/api/services/app/ViolateRecord/HandleViolateRecord", body) + .subscribe((data) => { + resolve(data); + this.message.create("success", "处置成功!"); + item.handleTime = new Date(); + return true; + }); + }); } else { - this.message.create('warning', '请填写完整!'); - return false + this.message.create("warning", "请填写完整!"); + return false; } }, }); const instance = modal.getContentComponent(); } - - exportExcel() { // console.log(this.validateForm) - let ViolationIds = [] + let ViolationIds = []; // console.log(this.validateForm.value.event) if (this.validateForm.value.event) { - ViolationIds = this.validateForm.value.event + ViolationIds = this.validateForm.value.event; } if (this.validateForm.value.type && !this.validateForm.value.event) { - this.warningTypesDetails.forEach(item => { - item.id ? ViolationIds.push(item.id) : null + this.warningTypesDetails.forEach((item) => { + item.id ? ViolationIds.push(item.id) : null; }); } - let disposalState - if (this.validateForm.value.disposalState == '0') { - disposalState = true - } else if (this.validateForm.value.disposalState == '1') { - disposalState = false + let disposalState; + if (this.validateForm.value.disposalState == "0") { + disposalState = true; + } else if (this.validateForm.value.disposalState == "1") { + disposalState = false; } else { - disposalState = null + disposalState = null; } const httpOptions = { - responseType: 'blob' as 'json', + responseType: "blob" as "json", params: { Level: this.validateForm.value.level, ViolationIds: ViolationIds, 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') + ' 00:00:00', moment(this.validateForm.value.datePicker[1]).format('yyyy-MM-DD') + ' 23:59:59'] : null, + 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" + ) + " 00:00:00", + moment(this.validateForm.value.datePicker[1]).format( + "yyyy-MM-DD" + ) + " 23:59:59", + ] + : null, IsHandled: disposalState, - Positive: this.validateForm.value.misinformation - } + Positive: this.validateForm.value.misinformation, + }, }; - this.http.get(`/api/services/app/ViolateRecord/ExportExcel`, httpOptions).subscribe((data: any) => { - // console.log('导出成功') - // 文件名中有中文 则对文件名进行转码 - const link = document.createElement('a'); - const blob = new Blob([data], { type: 'application/vnd.ms-excel' }); - link.setAttribute('href', window.URL.createObjectURL(blob)); - link.setAttribute('download', '预警记录' + '.xls'); - link.style.visibility = 'hidden'; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - this.message.create('success', `导出成功`); - }, err => { - this.message.create('error', `导出失败`); - }) + this.http + .get(`/api/services/app/ViolateRecord/ExportExcel`, httpOptions) + .subscribe( + (data: any) => { + // console.log('导出成功') + // 文件名中有中文 则对文件名进行转码 + const link = document.createElement("a"); + const blob = new Blob([data], { type: "application/vnd.ms-excel" }); + link.setAttribute("href", window.URL.createObjectURL(blob)); + link.setAttribute("download", "预警记录" + ".xls"); + link.style.visibility = "hidden"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + this.message.create("success", `导出成功`); + }, + (err) => { + this.message.create("error", `导出失败`); + } + ); } } diff --git a/src/app/pages/singlelogin/singlelogin.component.ts b/src/app/pages/singlelogin/singlelogin.component.ts index 9eb2106..a35de7a 100644 --- a/src/app/pages/singlelogin/singlelogin.component.ts +++ b/src/app/pages/singlelogin/singlelogin.component.ts @@ -149,6 +149,7 @@ export class SingleloginComponent implements OnInit { user: this.CurrentUserInfo.data, org: this.AuthOrganInfos.data[0], sinochemOrgs: this.AuthOrganInfos.data, + userDetail: JSON.stringify(this.CurrentUserInfo.data), }; this.http.post("/api/TokenAuth/SinochemLogin", body).subscribe( (data: any) => { diff --git a/src/app/pages/today-warning-admin/today-warning-admin.component.ts b/src/app/pages/today-warning-admin/today-warning-admin.component.ts index 3b11ca4..bb45918 100644 --- a/src/app/pages/today-warning-admin/today-warning-admin.component.ts +++ b/src/app/pages/today-warning-admin/today-warning-admin.component.ts @@ -287,6 +287,13 @@ export class TodayWarningAdminComponent implements OnInit { params: params, }) .subscribe((data: any) => { + data.result.items = data.result.items.filter((item) => { + return ( + item.violation.violationType != "证照资质" || + (item.violation.violationType == "证照资质" && + item.gasStation.companyName.includes("延长")) + ); + }); this.list = data.result.items; this.totalCount = data.result.totalCount; console.log("预警列表", this.list); diff --git a/src/app/pages/today-warning/today-warning.component.ts b/src/app/pages/today-warning/today-warning.component.ts index 3d725a2..cac60fa 100644 --- a/src/app/pages/today-warning/today-warning.component.ts +++ b/src/app/pages/today-warning/today-warning.component.ts @@ -230,6 +230,13 @@ export class TodayWarningComponent implements OnInit { params: params, }) .subscribe((data: any) => { + data.result.items = data.result.items.filter((item) => { + return ( + item.violation.violationType != "证照资质" || + (item.violation.violationType == "证照资质" && + item.gasStation.companyName.includes("延长")) + ); + }); this.list = data.result.items; this.totalCount = data.result.totalCount; console.log("预警列表", this.list);