Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
import { Component, OnInit, AfterViewInit, Input } from '@angular/core';
import { AppSettingsService } from './../../shared/app-settings/app-settings.service';
import { MenuModel } from './../../shared/menu/menu.component.model';
import { PdfReferenceService } from '../pdf-reference/pdf-reference.service';
import { EwvViewerService } from '../ewv-viewer/ewv-viewer.service';
import { WindowRefService } from '../../window-ref.service';
@Component({
selector: 'app-ewv-base',
templateUrl: './ewv-base.component.html',
styleUrls: ['./ewv-base.component.scss']
})
export class EwvBaseComponent implements OnInit, AfterViewInit {
ewvMenu: MenuModel;
@Input()
title = '';
@Input()
tabIdx = '0';
constructor(
public appSettingsService: AppSettingsService,
private pdfReferenceService: PdfReferenceService,
private ewvViewerService: EwvViewerService,
private _window: WindowRefService
) {}
ngOnInit() {}
ngAfterViewInit() {
setTimeout(() => {
this.setMenu();
});
}
setMenu() {
this.appSettingsService
.getMenu('EWV_MENU')
.subscribe(menu => (this.ewvMenu = menu));
// this.pdfReferenceService.populatePdfReferenceMenu().subscribe(data => {
// this.ewvMenu.dropDownGroups[1].dropdowns = data;
// });
}
getPdfFile(guid: number) {
this.ewvViewerService.getPdfFile(guid).subscribe(data => {
const fileName = data.headers.get('Content-Disposition');
const pdfBlob = new Blob([data.blob()], { type: 'application/pdf' });
const pdfURL = this._window.nativeWindow.URL.createObjectURL(pdfBlob);
if (
this._window.nativeWindow.navigator &&
this._window.nativeWindow.navigator.msSaveOrOpenBlob
) {
this._window.nativeWindow.navigator.msSaveOrOpenBlob(pdfBlob, fileName);
return;
}
this._window.nativeWindow.open(pdfURL);
});
}
notify(evt) {
if (evt.guid) {
this.getPdfFile(evt.guid);
}
}
}