刘向辉 3 years ago
parent
commit
1b6fd869f7
  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 * as moment from 'moment';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component'; import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component';
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({ @Component({
selector: 'app-home-page', selector: 'app-home-page',
templateUrl: './home-page.component.html', templateUrl: './home-page.component.html',
@ -12,7 +13,7 @@ import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-d
}) })
export class HomePageComponent implements OnInit { 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//预警饼图 warningechartpie//预警饼图
warningechartpieOption = { warningechartpieOption = {
@ -75,7 +76,7 @@ export class HomePageComponent implements OnInit {
textShadowColor: '#8df', textShadowColor: '#8df',
textShadowBlur: 3, textShadowBlur: 3,
color: '#fff', color: '#fff',
}, },
active: { active: {
fontSize: 14, fontSize: 14,
@ -272,10 +273,10 @@ export class HomePageComponent implements OnInit {
violationType: { violationType: {
violationTypeAgg: [] violationTypeAgg: []
}, },
dev:{ dev: {
stationCount:'', stationCount: '',
violationCount:'', violationCount: '',
cameraCount:'' cameraCount: ''
} }
} }
totalCount totalCount
@ -641,36 +642,43 @@ export class HomePageComponent implements OnInit {
isOpenModel: boolean = false isOpenModel: boolean = false
look(item) { look(item) {
this.isOpenModel = true console.log(item)
let data = { if (item.notification.data.eventSystemName == '灭火器维护' || item.notification.data.eventSystemName == '证照预警') {
violateImage: item.notification.data.violateImage, this.message.create('warning', `证照或者器材即将临期,请联系加油站处理!`);
violateVideo: item.notification.data.violateVideo } 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>
</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); console.log('abp.notifications.received收到通知', userNotification);
this.receiptOfNotification(userNotification) this.receiptOfNotification(userNotification)
}; };
@ -102,42 +102,49 @@ export class HomeComponent implements OnInit {
} }
this.messageId.push(obj) this.messageId.push(obj)
} }
isVisible = false
modalData
look(item) { look(item) {
let params = { if (item.notification.data.properties.EventSystemName == '灭火器维护' || item.notification.data.properties.EventSystemName == '证照预警') {
id: item.notification.entityId this.message.create('warning', `证照或者器材即将临期,请联系加油站处理!`);
} } else {
this.http.get('/api/services/app/ViolateRecord/Get', { let params = {
params: params id: item.notification.entityId
}).subscribe((data: any) => { }
const modal = this.modal.create({ this.http.get('/api/services/app/ViolateRecord/Get', {
nzContent: GetOutOfLineDetailsComponent, params: params
nzViewContainerRef: this.viewContainerRef, }).subscribe((data: any) => {
nzWidth: 1200, const modal = this.modal.create({
nzBodyStyle: { nzContent: GetOutOfLineDetailsComponent,
'border': '1px solid #6d9cc7', nzViewContainerRef: this.viewContainerRef,
'border-radius': '0px', nzWidth: 1200,
'padding': '0px', nzBodyStyle: {
'box-shadow': '0 0 8px 0 #fff', 'border': '1px solid #6d9cc7',
'background': '#000D21', 'border-radius': '0px',
}, 'padding': '0px',
nzComponentParams: { 'box-shadow': '0 0 8px 0 #fff',
data: data.result 'background': '#000D21',
}, },
nzFooter: null, nzComponentParams: {
nzOnOk: async () => { 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) 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) { look(item) {
let type if (item.violation.eventSystemName == '灭火器维护' || item.violation.eventSystemName == '证照预警') {
if (item.violation.violationType.indexOf('卸油')) { this.message.create('warning', `证照或者器材即将临期,请联系加油站处理!`);
type = 1
} else { } 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) { 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>
<div class="content"> <div class="content">
<div *ngIf="selectedType == 'img'" class="imgbox"> <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"> <div class="bigimg">
<img [src]="imgUrl" alt=""> <img [src]="imgUrl" alt="">
</div> </div>

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

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

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

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

Loading…
Cancel
Save