mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
view doc from search
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user