Browse Source

[新增]新增实时通知

master
邵佳豪 3 years ago
parent
commit
80165dca80
  1. 3
      src/app/pages/criminal-records-admin/criminal-records-admin.component.html
  2. 14
      src/app/pages/criminal-records-admin/criminal-records-admin.component.scss
  3. 17
      src/app/pages/criminal-records-admin/criminal-records-admin.component.ts

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

@ -141,8 +141,9 @@
</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;">
<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"

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

@ -289,6 +289,20 @@
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;
}
}
}
}

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

@ -111,7 +111,7 @@ export class CriminalRecordsAdminComponent implements OnInit {
ViolateArea: this.validateForm.value.site,
OrganizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
IsContainsChildren: 'true',
IsCensored: 'false',
CanCensor: 'true',
// IsHandled: disposalState,
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,
@ -147,7 +147,20 @@ export class CriminalRecordsAdminComponent implements OnInit {
}
reloadPage = (userNotification) => {
console.log('abp.notifications.received收到通知', userNotification);
console.log('违规记录列表', this.list)
let params = {
id: userNotification.notification.entityId
}
this.http.get('/api/services/app/ViolateRecordCensorship/Get', {
params: params
}).subscribe((data: any) => {
data.result.isNewMessage = true
this.list.unshift(data.result)
this.message.create('success', '收到一条新预警!');
this.totalCount = String(Number(this.totalCount) + 1)
this.SkipCount = String(Number(this.SkipCount) + 1)
console.log('新获取一条', data.result)
})
};
ngOnDestroy() {
console.log('退出')

Loading…
Cancel
Save