mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
add viewer
This commit is contained in:
@@ -58,11 +58,10 @@
|
||||
</ion-label>
|
||||
|
||||
<ion-label
|
||||
(click)="viewDocument()"
|
||||
*ngIf="LoadedDocument.ApplicationId == 361 || LoadedDocument.ApplicationID == 361"
|
||||
>
|
||||
<div *ngFor="let Document of LoadedDocument.Documents">
|
||||
<div class="attach-title-item">
|
||||
<div *ngFor="let Document of LoadedDocument.Documents; let i = index">
|
||||
<div class="attach-title-item" (click)="docIndex(i);viewDocumentModal()">
|
||||
{{Document.Assunto}}
|
||||
</div>
|
||||
<div *ngIf="Document.Sender" class="d-flex justify-between" style="justify-content: space-between">
|
||||
@@ -76,7 +75,6 @@
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="LoadedDocument" class="aside-right flex-column height-100">
|
||||
<div class="buttons">
|
||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTas
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
|
||||
import { Location } from '@angular/common';
|
||||
import { ViewDocumentPage } from '../view-document/view-document.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-document-detail',
|
||||
@@ -31,6 +32,8 @@ export class DocumentDetailPage implements OnInit {
|
||||
document: SearchDocumentDetails
|
||||
|
||||
task: ExpedientTaskModalPageNavParamsTask;
|
||||
DocumentTask: ExpedientTaskModalPageNavParamsTask;
|
||||
dicIndex = 0;
|
||||
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
@@ -69,51 +72,121 @@ export class DocumentDetailPage implements OnInit {
|
||||
let folder: SearchFolderDetails = this.LoadedDocument
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) {
|
||||
task = {
|
||||
serialNumber: folder.DispatchNumber,
|
||||
taskStartDate: folder.DateDispatch,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
|
||||
Subject: folder.Assunto,
|
||||
SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
|
||||
SourceType: 'FOLDER',
|
||||
SourceID: folder.folderId,
|
||||
DispatchNumber: folder.DispatchNumber
|
||||
},
|
||||
}
|
||||
// task = {
|
||||
// serialNumber: folder.DispatchNumber,
|
||||
// taskStartDate: folder.DateDispatch,
|
||||
// isEvent: true,
|
||||
// workflowInstanceDataFields: {
|
||||
// FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
|
||||
// Subject: folder.Assunto,
|
||||
// SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
|
||||
// SourceType: 'FOLDER',
|
||||
// SourceID: folder.folderId,
|
||||
// DispatchNumber: folder.DispatchNumber
|
||||
// },
|
||||
// }
|
||||
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
|
||||
task = {
|
||||
serialNumber: document.DocId,
|
||||
taskStartDate: document.DocDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: null,
|
||||
Subject: document.Assunto,
|
||||
DispatchNumber: null,
|
||||
SourceSecFsID: document.ApplicationID || document.ApplicationId,
|
||||
SourceType: 'DOC',
|
||||
SourceID: document.DocId,
|
||||
}
|
||||
}
|
||||
// task = {
|
||||
// serialNumber: document.DocId,
|
||||
// taskStartDate: document.DocDate,
|
||||
// isEvent: true,
|
||||
// workflowInstanceDataFields: {
|
||||
// FolderID: null,
|
||||
// Subject: document.Assunto,
|
||||
// DispatchNumber: null,
|
||||
// SourceSecFsID: document.ApplicationID || document.folderId,
|
||||
// SourceType: 'DOC',
|
||||
// SourceID: document.DocId,
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
console.log('unexpected ApplicationID')
|
||||
}
|
||||
|
||||
this.task = task
|
||||
console.log('this.task = task', this.task)
|
||||
|
||||
task = {
|
||||
serialNumber: '',
|
||||
taskStartDate: '',
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: '',
|
||||
Subject: this.LoadedDocument.SourceName || this.LoadedDocument.Assunto,
|
||||
SourceSecFsID: this.LoadedDocument.ApplicationId || this.LoadedDocument.ApplicationID,
|
||||
SourceType: 'DOC',
|
||||
SourceID: this.LoadedDocument.DocId || this.LoadedDocument.SourceId || this.LoadedDocument['folderId'],
|
||||
DispatchNumber: ''
|
||||
}
|
||||
}
|
||||
|
||||
this.DocumentTask = Object.assign(task, res)
|
||||
console.log('this.DocumentTask = DocumentTask', this.DocumentTask)
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
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();
|
||||
async viewDocument() {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: this.LoadedDocument.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document: this.LoadedDocument.Documents,
|
||||
applicationId: this.DocumentTask.workflowInstanceDataFields.SourceSecFsID,
|
||||
docId: this.DocumentTask.workflowInstanceDataFields.SourceID,
|
||||
task: this.DocumentTask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
}
|
||||
|
||||
docIndex(index: number) {
|
||||
this.dicIndex = index;
|
||||
}
|
||||
|
||||
async viewDocumentModal() {
|
||||
|
||||
const selectedDoc = this.LoadedDocument.Documents[ this.dicIndex]
|
||||
|
||||
this.task = {
|
||||
serialNumber: '',
|
||||
taskStartDate: '',
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: '',
|
||||
Subject: selectedDoc.SourceName || selectedDoc.Assunto,
|
||||
SourceSecFsID: selectedDoc.ApplicationId || selectedDoc.ApplicationID,
|
||||
SourceType: 'DOC',
|
||||
SourceID: selectedDoc.DocId || selectedDoc.SourceId,
|
||||
DispatchNumber: ''
|
||||
}
|
||||
}
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: this.task.workflowInstanceDataFields.Subject,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document: this.LoadedDocument.Documents[ this.dicIndex],
|
||||
applicationId: this.task.workflowInstanceDataFields.SourceSecFsID,
|
||||
docId: this.task.workflowInstanceDataFields.SourceID ,
|
||||
folderId: '',
|
||||
task: this.task
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
openMenu() {
|
||||
|
||||
Reference in New Issue
Block a user