Browse Source

[新增]新增历史纪录页面

master
邵佳豪 3 years ago
parent
commit
bde9a09582
  1. 57
      src/app/pages/criminal-records-admin/criminal-records-admin.component.html
  2. 16
      src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
  3. 26
      src/app/pages/get-out-of-line-details/get-out-of-line-details.component.html
  4. 2
      src/app/pages/get-out-of-line-details/get-out-of-line-details.component.ts
  5. 201
      src/app/pages/histories/histories.component.html
  6. 626
      src/app/pages/histories/histories.component.scss
  7. 348
      src/app/pages/histories/histories.component.ts
  8. 3
      src/app/pages/home/home.component.html
  9. 6
      src/app/pages/pages-routing.module.ts
  10. 3
      src/app/pages/pages.module.ts
  11. 3
      src/theme.less

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

@ -1,10 +1,5 @@
<div class="recordsboxadmin" id="recordsboxadmin">
<div class="content">
<div class="title">
<app-title [name]="'预警审核列表'"></app-title>
</div>
@ -200,57 +195,5 @@
</div>
</div>
<!-- <div class="tablebox" id="tablebox">
<nz-table [nzLoading]="tableSpin" [nzPageSize]='9999' #headerTable [nzData]="list" [nzShowPagination]="false"
[nzNoResult]='null' nzTableLayout="fixed" [nzScroll]="{ y:tableheight() }" >
<thead>
<tr>
<th>序号</th>
<th>预警级别</th>
<th>预警类型</th>
<th>预警事件</th>
<th>所属公司</th>
<th>管理区域</th>
<th>加油站</th>
<th>预警区域</th>
<th>摄像头名称</th>
<th>预警时间</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody id="table">
<tr *ngFor="let item of headerTable.data;let key = index">
<th nzEllipsis>
{{key + 1}}
</th>
<th nzEllipsis>
<img *ngIf="item.violation.level == 1" src="../../../assets/images/level1.png" alt="">
<img *ngIf="item.violation.level == 2" src="../../../assets/images/level2.png" alt="">
<img *ngIf="item.violation.level == 3" src="../../../assets/images/level3.png" alt="">
<img *ngIf="item.violation.level == 4" src="../../../assets/images/level4.png" alt="">
<span *ngIf="item.violation.level == 1">Ⅰ级</span>
<span *ngIf="item.violation.level == 2">Ⅱ级</span>
<span *ngIf="item.violation.level == 3">Ⅲ级</span>
<span *ngIf="item.violation.level == 4">Ⅳ级</span>
</th>
<th nzEllipsis [title]="item.violation.violationType">{{item.violation.violationType}}</th>
<th nzEllipsis [title]="item.violation.eventSystemName">{{item.violation.eventSystemName}}</th>
<th nzEllipsis [title]="item.gasStation.companyName">{{item.gasStation.companyName}}</th>
<th nzEllipsis [title]="item.gasStation.locationName">{{item.gasStation.locationName}}</th>
<th nzEllipsis [title]="item.gasStation.stationName">{{item.gasStation.stationName}}</th>
<th nzEllipsis [title]="item.violateArea">{{item.violateArea}}</th>
<th nzEllipsis [title]="item.cameraNo">{{item.cameraNo}}</th>
<th nzEllipsis>{{item.violateTime | date:"yyyy-MM-dd HH:mm:ss"}}</th>
<th nzEllipsis>
<span *ngIf="item.handleTime">已处置</span>
<span *ngIf="!item.handleTime" style="color: #FF4B65;">未处置</span>
</th>
<th nzEllipsis><span class="look" (click)="look(item)" style="margin-right: 12px;">查看</span></th>
</tr>
</tbody>
</nz-table>
</div> -->
</div>
</div>

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

@ -109,7 +109,7 @@ export class CriminalRecordsAdminComponent implements OnInit {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.site,
OrganizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
OrganizationUnitId: this.validateForm.value.organization,
IsContainsChildren: 'true',
CanVerify: 'true',
// IsHandled: disposalState,
@ -128,7 +128,11 @@ export class CriminalRecordsAdminComponent implements OnInit {
console.log('违规记录列表', data)
this.tableSpin = false
console.log(this.list.length)
})
},
(err) => {
this.tableSpin = false;
this.message.create('error', err.error.error.details);
})
}
ngAfterViewInit(): void {
@ -344,7 +348,8 @@ export class CriminalRecordsAdminComponent implements OnInit {
'background': '#000D21',
},
nzComponentParams: {
data: item
data: item,
isBtn: true
},
nzFooter: null,
nzOnOk: async () => {
@ -370,9 +375,4 @@ export class CriminalRecordsAdminComponent implements OnInit {
}
tableheight() {
return (document.getElementById('tablebox').clientHeight - 32) + 'px'
}
}

26
src/app/pages/get-out-of-line-details/get-out-of-line-details.component.html

@ -24,31 +24,7 @@
<video controls style="width: 100%;height: 100%;" [src]="vedioUrl"></video>
</div>
</div>
<!-- <div class="disposebox">
<div class="title">
<span>处置内容</span>
<div class="disposeboxbtn">
<span *ngIf="!data.handleTime" style="color: #c73939;cursor: pointer;margin-right: 6px;" (click)="misinformation()">误报</span>
<span *ngIf="!data.handleTime" style="color: #36A2FF;cursor: pointer;" (click)="submit()">提交</span>
<span *ngIf="data.handleTime" style="color: #4BFFD4;cursor: default;">已处置<span *ngIf="data.isFalsePositive">(误报)</span></span>
</div>
</div>
<div class="disposeContent">
<textarea *ngIf="!data.handleTime" [(ngModel)]="content"></textarea>
<span *ngIf="data.handleTime">{{content}}</span>
</div>
<div class="disposeTime" *ngIf="data.handleTime">
<span style="margin-right: 12px;">
处置人:{{data.handleUsername}}
</span>
<span>
处置时间:{{data.handleTime|date:"yyyy-MM-dd HH:mm:ss"}}
</span>
</div>
</div> -->
<div class="btnbox">
<div class="btnbox" *ngIf="isBtn">
<button nz-button nzType="primary" [nzLoading]="isPushLoading" (click)="push()">推送</button>
<button nz-button nzType="primary" [nzLoading]="isMisinformationLoading" nzDanger
(click)="misinformation()">误报</button>

2
src/app/pages/get-out-of-line-details/get-out-of-line-details.component.ts

@ -10,7 +10,7 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
})
export class GetOutOfLineDetailsComponent implements OnInit {
@Input() data: any
@Input() isBtn: any
constructor(private http: HttpClient, private message: NzMessageService, private modal: NzModalService, private initialModal: NzModalRef) { }

201
src/app/pages/histories/histories.component.html

@ -0,0 +1,201 @@
<div class="recordsboxadmin" id="recordsboxadmin">
<div class="content">
<div class="title">
<app-title [name]="'历史纪录列表'"></app-title>
</div>
<div class="search">
<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>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams searchParamsLong">
<nz-form-control>
<nz-tree-select [nzAllowClear]="false" [nzDropdownClassName]="'maxHeightTreeSelect'"
nzShowSearch [(ngModel)]="defaultOrId" formControlName="organization" [nzNodes]="nodes"
nzPlaceHolder="请选择所属机构" [nzExpandedIcon]="multiExpandedIconTpl">
</nz-tree-select>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'"
class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear id="type" (ngModelChange)="typeChange($event)" formControlName="type"
nzPlaceHolder="请选择预警类型">
<nz-option *ngFor="let item of warningTypes" [nzValue]="item.key" [nzLabel]="item.key">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select 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-control>
<nz-select nzAllowClear id="site" formControlName="site" nzPlaceHolder="请选择区域">
<nz-option nzValue="出入口" nzLabel="出入口"></nz-option>
<nz-option nzValue="加油区" nzLabel="加油区"></nz-option>
<nz-option nzValue="油罐区" nzLabel="油罐区"></nz-option>
<nz-option nzValue="便利店" nzLabel="便利店"></nz-option>
<nz-option nzValue="办公区" nzLabel="办公区"></nz-option>
<nz-option nzValue="其他区域" nzLabel="其他区域"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear formControlName="disposalState" nzPlaceHolder="请选择处置状态">
<nz-option nzValue="true" nzLabel="已通过"></nz-option>
<nz-option nzValue="false" nzLabel="误报"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams searchParams2">
<nz-form-control>
<nz-range-picker [nzAllowClear]="false" formControlName="datePicker"></nz-range-picker>
<br />
</nz-form-control>
</nz-form-item>
<nz-form-item class="btn">
<nz-form-control>
<button nz-button type="submit" class="submit"><i nz-icon [nzType]="'search'"></i>查询</button>
</nz-form-control>
</nz-form-item>
<nz-form-item class="btn">
<nz-form-control>
<button nz-button type="button" class="reset" (click)="resetForm($event)"><i nz-icon
[nzType]="'sync'"></i>重置</button>
</nz-form-control>
</nz-form-item>
</form>
</div>
<div class="tablebox">
<div class="table">
<div nz-row class="th" style="box-sizing: border-box;padding-right: 2px;">
<div nz-col nzSpan="1" style="text-align: center;">
<span>序号</span>
</div>
<div nz-col nzSpan="2" style="text-align: center;">
<span style="margin-right:46px;">
预警级别
</span>
</div>
<div nz-col nzSpan="2">
预警类型
</div>
<div nz-col nzSpan="2">
预警事件
</div>
<div nz-col nzSpan="2">
所属公司
</div>
<div nz-col nzSpan="3">
管理区域
</div>
<div nz-col nzSpan="3">
加油站
</div>
<div nz-col nzSpan="2">
预警区域
</div>
<div nz-col nzSpan="2">
摄像头名称
</div>
<div nz-col nzSpan="2">
预警时间
</div>
<div nz-col nzSpan="2">
状态
</div>
<div nz-col nzSpan="1">
操作
</div>
</div>
<div class="tbody" id="tbody">
<div nz-row class="tr" *ngFor="let item of list;let key = index">
<div nz-col nzSpan="1" style="text-align: center;position: relative;">
<span>{{key + 1}}</span>
<span class="new" *ngIf="item.isNewMessage"></span>
</div>
<div nz-col nzSpan="2">
<img style="margin-left: 18px;" *ngIf="item.violation.level == 1"
src="../../../assets/images/level1.png" alt="">
<img style="margin-left: 18px;" *ngIf="item.violation.level == 2"
src="../../../assets/images/level2.png" alt="">
<img style="margin-left: 18px;" *ngIf="item.violation.level == 3"
src="../../../assets/images/level3.png" alt="">
<img style="margin-left: 18px;" *ngIf="item.violation.level == 4"
src="../../../assets/images/level4.png" alt="">
<span *ngIf="item.violation.level == 1">Ⅰ级</span>
<span *ngIf="item.violation.level == 2">Ⅱ级</span>
<span *ngIf="item.violation.level == 3">Ⅲ级</span>
<span *ngIf="item.violation.level == 4">Ⅳ级</span>
</div>
<div nz-col nzSpan="2" [title]="item.violation.violationType">
{{item.violation.violationType}}
</div>
<div nz-col nzSpan="2" [title]="item.violation.eventSystemName">
{{item.violation.eventSystemName}}
</div>
<div nz-col nzSpan="2" [title]="item.gasStation.companyName">
{{item.gasStation.companyName}}
</div>
<div nz-col nzSpan="3" [title]="item.gasStation.locationName">
{{item.gasStation.locationName}}
</div>
<div nz-col nzSpan="3" [title]="item.gasStation.stationName">
{{item.gasStation.stationName}}
</div>
<div nz-col nzSpan="2" [title]="item.violateArea">
{{item.violateArea}}
</div>
<div nz-col nzSpan="2" [title]="item.cameraNo">
{{item.cameraNo}}
</div>
<div nz-col nzSpan="2">
{{item.violateTime | date:"yyyy-MM-dd HH:mm:ss"}}
</div>
<div nz-col nzSpan="2">
<span *ngIf="item.positive">已通过</span>
<span *ngIf="!item.positive" style="color: #FF4B65;">误报</span>
</div>
<div nz-col nzSpan="1">
<span class="look" (click)="look(item)" style="margin-right: 12px;">查看</span>
</div>
</div>
<div nz-row class="tr" *ngIf="tableSpin">
<div nz-col nzSpan="24" style="text-align: center;">
<nz-spin nzSimple></nz-spin>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

626
src/app/pages/histories/histories.component.scss

@ -0,0 +1,626 @@
.recordsboxadmin {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.search {
box-sizing: border-box;
padding: 0 36px;
width: 100%;
height: 32px;
margin-bottom: 16px;
form {
width: 100%;
height: 32px;
display: flex;
justify-content: flex-start;
.searchParams,
.btn {
margin: 0 3px;
}
.searchParams {
// flex: 5;
width: 150px;
}
.searchParamsLong {
width: 250px;
}
.searchParams2 {
width: 220px;
}
.btn {
// flex: 1;
}
nz-select {
color: rgba(145, 204, 255, 0.95);
}
nz-tree-select {
color: rgba(145, 204, 255, 0.95);
}
nz-range-picker {
background-color: rgba(0, 0, 0, 0);
width: 100%;
}
}
}
.content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
.title {
width: 100%;
height: 64px;
box-sizing: border-box;
padding: 0 28px;
margin: 13px 0;
position: relative;
.titlebox {
width: 100%;
height: 100%;
display: flex;
align-items: center;
img {
width: 65px;
height: 65px;
}
.content {
flex: 1;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
// background-image: linear-gradient(to right, #002147, #033565, #064e8e, #064e8e, #033565, #002147);
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.32) 50%, rgba(35, 153, 255, 0) 100%);
.contentitem {
width: 100%;
height: 32px;
display: flex;
align-items: center;
// background-image: linear-gradient(to right, #002147, #0f5ca0, #1c88e6, #1c88e6, #0f5ca0, #002147);
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.8) 50%, rgba(35, 153, 255, 0) 100%);
span {
margin-left: 10px;
color: #bce0ff;
font-size: 20px;
font-family: titlefont;
cursor: pointer;
}
span:nth-child(1) {
margin-left: 12px;
}
.grey {
color: #68829F;
}
}
}
}
.packup {
position: absolute;
right: 33px;
top: 16px;
cursor: pointer;
}
}
.chartsbox {
width: 100%;
display: flex;
justify-content: center;
.chartname {
position: absolute;
left: 20px;
top: 12px;
}
.chart {
width: 98%;
height: 350px;
box-sizing: border-box;
padding: 0 10px;
display: flex;
div {
display: flex;
flex-direction: column;
span {
font-family: titlefont;
display: flex;
align-items: center;
height: 28px;
color: #bee1ff;
font-size: 16px;
}
div {
flex: 1;
}
}
.leftbox {
width: 360px;
position: relative;
border: 0px;
box-shadow: 0 0 26px 0px #1a7fd7 inset;
margin-right: 16px;
.centerContent {
position: absolute;
top: 42%;
left: 50%;
transform: translateX(-50%);
width: 170px;
div {
text-align: center;
}
.numname {
font-family: titlefont;
color: #bee1ff;
}
.num {
color: #FFFFFF;
font-size: 42px;
text-shadow: 0px 0px 16px #3A9AFF;
font-weight: bold;
height: 49px;
line-height: 50px;
}
}
}
.rightbox {
flex: 1;
position: relative;
border: 0px;
box-shadow: 0 0 26px 0px #1a7fd7 inset;
.btnbox {
position: absolute;
right: 28px;
top: 12px;
display: flex;
flex-direction: row;
z-index: 999;
.btn {
width: 64px;
height: 30px;
text-align: center;
line-height: 30px;
// border: 1px solid #91CCFF;
color: #91CCFF;
border-radius: 0px;
box-shadow: 0 0 5px 1px #2399FF inset;
background: none;
cursor: pointer;
}
.rankingBtnbox {
display: flex;
flex-direction: column;
}
.selectedbtn {
background: linear-gradient(180deg, #000D21 0%, #001331 27%, #2399FF 100%);
color: white;
}
}
}
}
}
.tablebox {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
overflow: hidden;
.table {
color: white;
flex: 1;
width: 96%;
display: flex;
flex-direction: column;
overflow: hidden;
.th {
height: 38px;
line-height: 38px;
background: rgba(35, 153, 255, 0.2);
border: 1px solid rgba(35, 217, 255, 0.4);
box-shadow: 0 0 3px 0 rgba(35, 217, 255, 0.4) inset;
color: #23D9FF;
}
.tbody {
flex: 1;
overflow-y: auto;
.tr {
height: 38px;
line-height: 38px;
border-bottom: 1px solid #0d3761;
div {
color: #91CCFF;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.look {
color: #36A2FF;
cursor: pointer;
}
}
img {
width: 36px;
}
.new {
position: absolute;
right: 0;
top: 10px;
display: inline-block;
background: rgb(255, 56, 82);
width: 20px;
height: 20px;
border-radius: 4px;
line-height: 20px;
text-align: center;
font-size: 14px;
color: white;
}
}
}
}
.pagination {
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
}
::-webkit-scrollbar {
width: 0px;
}
}
}
// 适配125%
@media screen and (max-height: 750px) {
.search {
box-sizing: border-box;
padding: 0 30px;
height: 32px;
margin-bottom: 12px;
form {
width: 100%;
height: 32px;
}
}
.content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
.title {
height: 42px;
padding: 0 20px;
margin: 8px 0;
.titlebox {
width: 100%;
height: 100%;
display: flex;
align-items: center;
img {
width: 46px;
height: 46px;
}
.content {
height: 36px;
.contentitem {
width: 100%;
height: 25px;
span {
margin-left: 6px;
font-size: 16px;
}
span:nth-child(1) {
margin-left: 8px;
}
}
}
}
.packup {
position: absolute;
right: 33px;
top: 4px;
cursor: pointer;
}
}
.chartsbox {
width: 100%;
height: 43%;
.chartname {
position: absolute;
left: 20px;
top: 12px;
}
.chart {
height: 100%;
div {
span {
font-size: 14px;
}
div {
flex: 1;
}
}
.leftbox {
width: 300px;
box-shadow: 0 0 20px 0px #1a7fd7 inset;
margin-right: 12px;
.centerContent {
.num {
color: #FFFFFF;
font-size: 42px;
text-shadow: 0px 0px 16px #3A9AFF;
font-weight: bold;
height: 49px;
line-height: 50px;
}
}
}
.rightbox {
flex: 1;
position: relative;
border: 0px;
box-shadow: 0 0 26px 0px #1a7fd7 inset;
.btnbox {
position: absolute;
right: 28px;
top: 12px;
display: flex;
flex-direction: row;
z-index: 999;
.rankingBtn {
margin-right: 12px;
}
}
}
}
}
.tablebox {
.table {
.th {
height: 32px;
line-height: 32px;
font-size: 12px !important;
}
.tbody {
.tr {
height: 32px;
line-height: 32px;
div {
font-size: 12px !important;
}
img {
width: 32px;
}
}
}
}
}
}
}
// 适配150%
@media screen and (max-height: 600px) {
.search {
box-sizing: border-box;
padding: 0 22px;
height: 32px;
margin-bottom: 6px;
form {
width: 100%;
height: 32px;
}
}
.content {
.title {
height: 36px;
padding: 0 20px;
margin: 3px 0;
.titlebox {
width: 100%;
height: 100%;
display: flex;
align-items: center;
img {
width: 36px;
height: 36px;
}
.content {
height: 30px;
.contentitem {
width: 100%;
height: 22px;
span {
margin-left: 6px;
font-size: 13px;
}
span:nth-child(1) {
margin-left: 12px;
}
}
}
}
.packup {
position: absolute;
right: 33px;
top: 2px;
cursor: pointer;
}
}
.chartsbox {
width: 100%;
height: 40%;
.chartname {
position: absolute;
left: 20px;
top: 12px;
}
.chart {
height: 100%;
div {
span {
font-size: 14px;
}
div {
flex: 1;
}
}
.leftbox {
width: 260px;
box-shadow: 0 0 20px 0px #1a7fd7 inset;
margin-right: 8px;
.centerContent {
.num {
color: #FFFFFF;
font-size: 32px;
text-shadow: 0px 0px 12px #3A9AFF;
font-weight: bold;
height: 42px;
line-height: 42px;
}
}
}
.rightbox {
box-shadow: 0 0 22px 0px #1a7fd7 inset;
.btnbox {
position: absolute;
right: 28px;
top: 12px;
display: flex;
flex-direction: row;
z-index: 999;
.rankingBtn {
margin-right: 8px;
}
}
}
}
}
.tablebox {
.table {
.th {
height: 28px;
line-height: 28px;
font-size: 10px !important;
}
.tbody {
.tr {
height: 28px;
line-height: 28px;
div {
font-size: 10px !important;
}
img {
width: 30px;
}
}
}
}
}
}
}

348
src/app/pages/histories/histories.component.ts

@ -0,0 +1,348 @@
import { HttpClient } from '@angular/common/http';
import { Component, ElementRef, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router'
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import * as moment from 'moment';
import { NzModalService } from 'ng-zorro-antd/modal';
import { GetOutOfLineDetailsComponent } from '../get-out-of-line-details/get-out-of-line-details.component';
import { NzMessageService } from 'ng-zorro-antd/message';
import { TreeService } from 'src/app/service/tree.service';
import { DisposeequipmentComponent } from '../disposeequipment/disposeequipment.component';
import { SignalRAspNetCoreHelper } from '../../../shared/helpers/SignalRAspNetCoreHelper';
declare var abp: any
import 'linqjs';
@Component({
selector: 'app-histories',
templateUrl: './histories.component.html',
styleUrls: ['./histories.component.scss']
})
export class HistoriesComponent implements OnInit {
validateForm!: FormGroup;
constructor(private element: ElementRef, private toTree: TreeService, private http: HttpClient, private fb: FormBuilder, private router: Router, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
startdate
enddate
ngOnInit(): void {
//当前日期
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);//当前日期
//获取三十天前日期
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 30);//最后一个数字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.validateForm = this.fb.group({
level: [null],
organization: [null],
type: [null],
event: [null],
site: [null],
disposalState: [null],
datePicker: [[this.startdate, this.enddate]]
});
this.warningType()
this.tableSpin = true
this.getAllOrganization()
}
defaultOrId: string
//获取所有组织机构
nodes: any = []
getAllOrganization() {
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
}
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
});
this.nodes = [...this.toTree.toTree(data.result.items)]
this.defaultOrId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
this.validateForm.value.organization = this.defaultOrId
this.getViolateRecordList()
})
}
//获得违规记录列表
SkipCount: string = '0'
MaxResultCount: string = '50'
list: any = []
totalCount: string
tableSpin: boolean = false
getViolateRecordList() {
let ViolationIds = []
if (this.validateForm.value.event) {
ViolationIds.push(this.validateForm.value.event)
}
if (this.validateForm.value.type && !this.validateForm.value.event) {
this.warningTypesDetails.forEach(item => {
item.id ? ViolationIds.push(item.id) : null
});
}
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.site,
OrganizationUnitId: this.validateForm.value.organization,
IsContainsChildren: 'true',
CanVerify: 'false',
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,
SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount, //每页50条
Positive: this.validateForm.value.disposalState
}
this.tableSpin = true
this.http.get('/api/services/app/ViolateRecordVerification/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
console.log(this.list.length)
},
(err) => {
this.tableSpin = false;
this.message.create('error', err.error.error.details);
})
}
ngAfterViewInit(): void {
fromEvent(this.element.nativeElement.querySelector(`#tbody`) as HTMLCanvasElement, 'scroll').pipe(debounceTime(100)).subscribe((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()
}
}
});
SignalRAspNetCoreHelper.initSignalR();
abp.event.on('abp.notifications.received', this.reloadPage);
}
reloadPage = (userNotification) => {
console.log('abp.notifications.received收到通知', userNotification);
console.log('违规记录列表', this.list)
let params = {
id: userNotification.notification.entityId
}
this.http.get('/api/services/app/ViolateRecordVerification/Get', {
params: params
}).subscribe((data: any) => {
this.message.create('success', '收到一条新预警!');
})
};
ngOnDestroy() {
console.log('退出')
abp.event.off('abp.notifications.received', this.reloadPage);
abp.signalr.disconnect()
}
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 enddate = new Date(enddateStr);
//获取三十天前日期
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 startDate = new Date(startdateStr);
const dateList = []
while (true) {
startDate.setDate(startDate.getDate() + 1)
if (startDate.getTime() <= enddate.getTime()) {
if (startDate.getDate() < 10) {
// startDate.getFullYear() 获取年,此处没加上年份
dateList.push((startDate.getMonth() + 1) + '.0' + startDate.getDate())
} else {
dateList.push((startDate.getMonth() + 1) + '.' + startDate.getDate())
}
} else {
break
}
}
return dateList;
}
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.list = []
this.SkipCount = '0'
this.getViolateRecordList()
}
resetForm(e: MouseEvent): void {
e.preventDefault();
this.validateForm.reset();
for (const key in this.validateForm.controls) {
this.validateForm.controls[key].markAsPristine();
this.validateForm.controls[key].updateValueAndValidity();
}
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
datePicker: [this.startdate, this.enddate]
});
this.list = []
this.SkipCount = '0'
this.getViolateRecordList()
}
//预警类型接口
warningTypes: any //预警接口数据
warningTypesDetails: any
warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.warningTypesDetails = data.result
this.warningTypes = (data.result as any).groupBy((t) => { return t.violationType });
})
}
typeChange(e: any) {
this.warningTypes.forEach(element => {
if (element.key == e) {
this.warningTypesDetails = element
}
});
this.validateForm.patchValue({
event: null,
});
}
look(item) {
console.log('点击item', item)
if (item.violation.eventSystemName == '灭火器维护') {
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)'
},
nzComponentParams: {
data: item
},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
if (instance.isScrap) {
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'),
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
})
})
})
} else {
if (instance.validateForm.valid) {
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
})
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
}
});
const instance = modal.getContentComponent();
} else {
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: item,
isBtn: false
},
nzFooter: null,
nzOnOk: async () => {
console.log('推送成功了!!!', item)
}
});
const instance = modal.getContentComponent();
}
}
}

3
src/app/pages/home/home.component.html

@ -10,6 +10,9 @@
<li [routerLink]="['/records']" routerLinkActive="router-link-active">
预警误报审核
</li>
<li [routerLink]="['/histories']" routerLinkActive="router-link-active">
历史纪录
</li>
</div>

6
src/app/pages/pages-routing.module.ts

@ -3,11 +3,13 @@ import { NgModule } from '@angular/core';
import { AuthGuard } from '../auth.guard'
import { CriminalRecordsAdminComponent } from './criminal-records-admin/criminal-records-admin.component';
import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/oil-unloading-process-list.component';
import { HistoriesComponent } from './histories/histories.component';
const routes: Routes = [
{ path: 'records', component: CriminalRecordsAdminComponent },
{ path: 'records/oliunloadinglist', component: OilUnloadingProcessListComponent },
{ path: 'records/petrolStation/oliunloadinglist', component: OilUnloadingProcessListComponent },
{ path: 'histories', component: HistoriesComponent },
// { path: 'records/oliunloadinglist', component: OilUnloadingProcessListComponent },
// { path: 'records/petrolStation/oliunloadinglist', component: OilUnloadingProcessListComponent },
];
@NgModule({

3
src/app/pages/pages.module.ts

@ -43,9 +43,10 @@ import { OilUnloadingProcessComponent } from './oil-unloading-process/oil-unload
import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/oil-unloading-process-list.component';
import { ChangePasswordComponent } from './change-password/change-password.component';
import { DisposeequipmentComponent } from './disposeequipment/disposeequipment.component';
import { HistoriesComponent } from './histories/histories.component';
@NgModule({
declarations: [LoginComponent, HomeComponent, CriminalRecordsAdminComponent, GetOutOfLineDetailsComponent, OilUnloadingProcessComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, DisposeequipmentComponent],
declarations: [LoginComponent, HomeComponent, CriminalRecordsAdminComponent, GetOutOfLineDetailsComponent, OilUnloadingProcessComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, DisposeequipmentComponent, HistoriesComponent],
imports: [

3
src/theme.less

@ -184,3 +184,6 @@
background-color: #061d3c;
}
}
.ant-pagination-prev,.ant-pagination-next{
overflow: hidden;
}
Loading…
Cancel
Save