view doc from search

This commit is contained in:
tiago.kayaya
2021-04-09 04:34:21 +01:00
parent 9f9adfbe97
commit 6ab6bc3868
6 changed files with 443 additions and 18 deletions
@@ -1,4 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { MenuController, ModalController, NavParams } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@Component({
selector: 'app-document-detail',
@@ -7,9 +11,51 @@ import { Component, OnInit } from '@angular/core';
})
export class DocumentDetailPage implements OnInit {
constructor() { }
docId: string;
applicationId:string;
LoadedDocument:any;
constructor(
private navParams: NavParams,
private modalController: ModalController,
private alertService: AlertService,
private processes: ProcessesService,
private menu: MenuController,
private iab: InAppBrowser,
) {
this.docId = this.navParams.get('docId');
this.applicationId = this.navParams.get('applicationId');
}
ngOnInit() {
console.log(this.docId);
console.log(this.applicationId);
this.LoadDocumentDetails();
}
async LoadDocumentDetails(){
this.processes.GetDocumentDetails(this.docId, '').subscribe(res=>{
console.log(res);
this.LoadedDocument = res[0];
});
}
viewDocument(){
this.processes.GetDocumentUrl(this.docId, '8').subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
openMenu() {
this.menu.open();
this.modalController.dismiss();
}
close(){
this.modalController.dismiss();
}
}