mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
viewer hot-fix
This commit is contained in:
@@ -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)=>{});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user