Browse Source

[完善]证照或者器材临期提醒

dev
邵佳豪 3 years ago
parent
commit
4489a77f36
  1. 76
      src/app/pages/home-page/home-page.component.ts
  2. 6
      src/app/pages/home/home.component.html
  3. 73
      src/app/pages/home/home.component.ts
  4. 47
      src/app/pages/today-warning-admin/today-warning-admin.component.ts
  5. 6
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
  6. 1
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
  7. 46
      src/app/pages/today-warning/today-warning.component.ts

76
src/app/pages/home-page/home-page.component.ts

@ -5,6 +5,7 @@ import * as echarts from 'echarts';
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';
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-home-page',
templateUrl: './home-page.component.html',
@ -12,7 +13,7 @@ import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-d
})
export class HomePageComponent implements OnInit {
constructor(private http: HttpClient, private router: Router, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { }
constructor(private http: HttpClient, private router: Router, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
warningechartpie//预警饼图
warningechartpieOption = {
@ -75,7 +76,7 @@ export class HomePageComponent implements OnInit {
textShadowColor: '#8df',
textShadowBlur: 3,
color: '#fff',
},
active: {
fontSize: 14,
@ -272,10 +273,10 @@ export class HomePageComponent implements OnInit {
violationType: {
violationTypeAgg: []
},
dev:{
stationCount:'',
violationCount:'',
cameraCount:''
dev: {
stationCount: '',
violationCount: '',
cameraCount: ''
}
}
totalCount
@ -641,36 +642,43 @@ export class HomePageComponent implements OnInit {
isOpenModel: boolean = false
look(item) {
this.isOpenModel = true
let data = {
violateImage: item.notification.data.violateImage,
violateVideo: item.notification.data.violateVideo
console.log(item)
if (item.notification.data.eventSystemName == '灭火器维护' || item.notification.data.eventSystemName == '证照预警') {
this.message.create('warning', `证照或者器材即将临期,请联系加油站处理!`);
} else {
this.isOpenModel = true
let data = {
violateImage: item.notification.data.violateImage,
violateVideo: item.notification.data.violateVideo
}
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: data
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => {
this.isOpenModel = false
this.rollStart()
});
this.readMess(item.notification.id)
}
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: data
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => {
this.isOpenModel = false
this.rollStart()
});
this.readMess(item.notification.id)
}
//标记为已读

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

@ -87,4 +87,8 @@
忽略
</div>
</div>
</ng-template>
</ng-template>
<!--
<nz-modal [(nzVisible)]="isVisible">
<app-get-out-of-line-details [data]="modalData"></app-get-out-of-line-details>
</nz-modal> -->

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

@ -85,7 +85,7 @@ export class HomeComponent implements OnInit {
}
reloadPage = (userNotification) => {
reloadPage = (userNotification) => {
console.log('abp.notifications.received收到通知', userNotification);
this.receiptOfNotification(userNotification)
};
@ -102,42 +102,49 @@ export class HomeComponent implements OnInit {
}
this.messageId.push(obj)
}
isVisible = false
modalData
look(item) {
let params = {
id: item.notification.entityId
}
this.http.get('/api/services/app/ViolateRecord/Get', {
params: params
}).subscribe((data: any) => {
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: data.result
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
this.messageId.forEach((element) => {
if (element.id == item.notification.entityId) {
this.notificationService.remove(element.messageId)
}
if (item.notification.data.properties.EventSystemName == '灭火器维护' || item.notification.data.properties.EventSystemName == '证照预警') {
this.message.create('warning', `证照或者器材即将临期,请联系加油站处理!`);
} else {
let params = {
id: item.notification.entityId
}
this.http.get('/api/services/app/ViolateRecord/Get', {
params: params
}).subscribe((data: any) => {
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: data.result
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
this.messageId.forEach((element) => {
if (element.id == item.notification.entityId) {
this.notificationService.remove(element.messageId)
}
})
this.readMess(item.notification.id)
})
})
this.readMess(item.notification.id)
}
}
//标记为已读

47
src/app/pages/today-warning-admin/today-warning-admin.component.ts

@ -159,34 +159,33 @@ export class TodayWarningAdminComponent implements OnInit {
}
isVisible=false
look(item) {
let type
if (item.violation.violationType.indexOf('卸油')) {
type = 1
if (item.violation.eventSystemName == '灭火器维护' || item.violation.eventSystemName == '证照预警') {
this.message.create('warning', `证照或者器材即将临期,请联系加油站处理!`);
} else {
type = 0
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: item
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
}
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: item
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
}
dispose(item) {

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

@ -13,12 +13,6 @@
</div>
<div class="content">
<div *ngIf="selectedType == 'img'" class="imgbox">
<!-- <div class="imglist">
<span class="imglisttitle">截图列表</span>
<div class="img">
<img src="../../../../assets/images/bgImg.jpg" alt="">
</div>
</div> -->
<div class="bigimg">
<img [src]="imgUrl" alt="">
</div>

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

@ -98,6 +98,7 @@
}
.bigimg {
// min-width: 1149px;
flex: 1;
box-sizing: border-box;
padding-left: 13px;

46
src/app/pages/today-warning/today-warning.component.ts

@ -113,32 +113,30 @@ export class TodayWarningComponent implements OnInit {
look(item) {
let type
if (item.violation.violationType.indexOf('卸油')) {
type = 1
if (item.violation.eventSystemName == '灭火器维护' || item.violation.eventSystemName == '证照预警') {
this.message.create('warning', `证照或者器材即将临期,请联系加油站处理!`);
} else {
type = 0
}
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: item
},
nzFooter: null,
nzOnOk: async () => {
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1200,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
},
nzComponentParams: {
data: item
},
nzFooter: null,
nzOnOk: async () => {
}
});
const instance = modal.getContentComponent();
}
});
const instance = modal.getContentComponent();
}
}
dispose(item) {

Loading…
Cancel
Save