Browse Source

[完善]新增误报按钮

dev
邵佳豪 3 years ago
parent
commit
03c315510f
  1. 2
      src/app/pages/criminal-records/criminal-records.component.ts
  2. 1
      src/app/pages/home/home.component.ts
  3. 9
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
  4. 14
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
  5. 34
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

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

@ -682,4 +682,6 @@ export class CriminalRecordsComponent implements OnInit {
});
const instance = modal.getContentComponent();
}
}

1
src/app/pages/home/home.component.ts

@ -127,6 +127,7 @@ export class HomeComponent implements OnInit {
this.isVisible = false;
//清除sessionStorage
sessionStorage.removeItem('isDefaultPassword')
sessionStorage.removeItem('isPasswordExpired')
}, err => {
this.message.create('warning', err.error.error.message);
this.isConfirmLoading = false;

9
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html

@ -26,8 +26,13 @@
<div class="disposebox">
<div class="title">
<span>处置内容</span>
<span *ngIf="!data.handleTime" style="color: #36A2FF;cursor: pointer;" (click)="submit()">提交</span>
<span *ngIf="data.handleTime" style="color: #4BFFD4;cursor: default;">已处置</span>
<div class="btn">
<span *ngIf="!data.handleTime" style="color: #FF4B65;cursor: pointer;"
(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>
</div>
</div>
<div class="disposeContent">
<textarea *ngIf="!data.handleTime" [(ngModel)]="content"></textarea>

14
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss

@ -104,11 +104,22 @@
.title {
display: flex;
justify-content: space-between;
.btn {
display: flex;
align-items: center;
span{
margin: 0 4px;
display: inline-block;
// border: 1px solid red;
}
}
}
.disposeContent {
display: flex;
align-items: center;
textarea {
width: 100%;
height: 40px;
@ -116,7 +127,8 @@
border: 1px solid #91CCFF;
background-color: #172c45;
}
span{
span {
display: inline-block;
width: 100%;
height: 40px;

34
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http';
import { Component, OnInit, Input } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
@Component({
selector: 'app-get-out-of-line-details',
templateUrl: './get-out-of-line-details.component.html',
@ -10,7 +11,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
export class GetOutOfLineDetailsComponent implements OnInit {
@Input() data: any
constructor(private fb: FormBuilder, private http: HttpClient, private message: NzMessageService) { }
constructor(private fb: FormBuilder, private http: HttpClient, private message: NzMessageService, private modal: NzModalService) { }
imgUrl: string
@ -40,7 +41,36 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.data.handleTime = new Date()
this.data.handleRecord = this.content
})
}
//误报
misinformation() {
this.modal.confirm({
nzTitle: '判定该预警为误报吗?',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
let body = {
id: this.data.id,
handleRecord: this.content ? this.content : '此条预警为误报',
isFalsePositive: true
}
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
this.message.create('success', '处置成功!');
this.data.handleTime = new Date()
if (this.content) {
this.data.handleRecord = this.content
} else {
this.data.handleRecord = '此条预警为误报'
this.content = '此条预警为误报'
}
})
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel')
})
}
}

Loading…
Cancel
Save