viewer hot-fix

This commit is contained in:
Peter Maquiran
2021-10-08 19:29:21 +01:00
parent 405c989b87
commit 9ceb915fef
37 changed files with 708 additions and 360 deletions
@@ -2,7 +2,6 @@
<ion-toolbar class="d-flex">
<div class="d-flex align-items-center px-20 pt-20 font-25">
<div class="left cursor-pointer" (click)="close()">
<!-- <ion-icon class="font-35" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon> -->
<fa-icon icon="chevron-left" class="menu-icon"></fa-icon>
</div>
@@ -10,7 +9,7 @@
{{file.title}}
</div>
<div class="right cursor-pointer">
<div class="right cursor-pointer" (click)="openOptions()">
<fa-icon icon="ellipsis-v" class="menu-icon"></fa-icon>
</div>
@@ -19,7 +18,12 @@
</ion-header>
<ion-content class="pt-10 height-100">
<div class="height-100">
<div class="height-100" *ngIf="trustedUrl">
<iframe id="iframe" [src]="trustedUrl" height="100%" width="100%" title="Iframe Example"></iframe>
</div>
<div *ngIf="!trustedUrl" class=" height-100 width-100 d-flex align-center justify-center">
<img src="/assets/images/Blocks-loader.gif" />
</div>
</ion-content>
@@ -1,7 +1,13 @@
import { Component, OnInit } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { ModalController, NavParams } from '@ionic/angular';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ProcessesService } from 'src/app/services/processes.service';
import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page';
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
8
@Component({
selector: 'app-view-document',
templateUrl: './view-document.page.html',
@@ -13,28 +19,122 @@ export class ViewDocumentPage implements OnInit {
a:string = "https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=";
viewerUrl: string;
trustedUrl: any;
file:any;
file: any;
sourceId: any;
applicationId: any;
LoadedDocument: any;
docId: any
folderId: any
task: ExpedientTaskModalPageNavParamsTask;
Document: any
constructor(
private modalController: ModalController,
private navParams: NavParams,
private sanitazer: DomSanitizer,
private processes: ProcessesService,
) {
this.file = this.navParams.get('file');
this.url = this.file.title_link;
console.log(this.url);
this.sourceId = this.navParams.get('sourceId');
this.applicationId = this.navParams.get('applicationId');
this.docId = this.navParams.get('docId');
this.folderId = this.navParams.get('folderId')
this.Document = this.navParams.get('Document')
}
// console.log('this.Document', this.Document)
// if(this.Document.ApplicationId == 361) {
// this.sourceId = this.folderId
// } else if(this.Document.ApplicationId == 8) {
// this.sourceId = this.Document.DocId || this.Document.SourceId
// }
}
ngOnInit() {
this.viewerUrl = this.url.replace("webTRIX.Viewer.Branch1/pdfjs/web/viewpdf.aspx?file=/webTRIX.Viewer.Branch1/arq/637690403731947760.pdf&i", "FileShare/pdfjs/web/viewer.html?file");
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(this.viewerUrl);
console.log(this.trustedUrl);
this.processes.GetViewer(this.docId, this.applicationId).subscribe(res=>{
const link: string = res
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
console.log('trustedUrl', this.trustedUrl)
})
//this.getDetails()
}
close() {
this.modalController.dismiss();
}
async openOptions() {
const modal = await this.modalController.create({
component: EventDetailsDocumentsOptionsPage,
cssClass: 'model aside-modal search-submodal',
componentProps: {
fulltask: this.task,
task: this.task
}
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res.data.component == 'openBookMeetingModal') {
this.openBookMeetingModal()
} else if(res.data.component == 'openExpedientActionsModal') {
this.openExpedientActionsModal(res.data.taskAction)
} else {
console.log('component not found')
}
})
}
async openBookMeetingModal() {
let classs;
if( window.innerWidth < 701) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: DocumentSetUpMeetingPage,
componentProps: {
subject: this.task.workflowInstanceDataFields.Subject,
document: this.LoadedDocument,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
//this.location.back();
});
}
// efetuar despacho
async openExpedientActionsModal( taskAction: any) {
let classs;
if( window.innerWidth < 701) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: taskAction,
task: this.task,
seachDocuments: this.LoadedDocument,
aplicationId: this.LoadedDocument.ApplicationId || this.LoadedDocument.ApplicationID
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then( async(res)=>{});
}
}