This commit is contained in:
Eudes Inácio
2021-10-09 21:13:26 +01:00
14 changed files with 249 additions and 245 deletions
@@ -183,6 +183,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
}) })
} }
else{ else{
console.log(this.document);
alert('PARA')
this.docs.push({ this.docs.push({
ApplicationId: this.document.ApplicationId || this.document.ApplicationType, ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
Source: 1, Source: 1,
@@ -22,8 +22,8 @@
<iframe id="iframe" [src]="trustedUrl" height="100%" width="100%" title="Iframe Example"></iframe> <iframe id="iframe" [src]="trustedUrl" height="100%" width="100%" title="Iframe Example"></iframe>
</div> </div>
<div *ngIf="!trustedUrl" class=" height-100 width-100 d-flex align-center justify-center"> <div *ngIf="!trustedUrl" style="text-align: center; color: #0d89d1" class=" height-100 width-100 d-flex align-center justify-center">
<img style="width: 100px;" src="/assets/images/Blocks-loader.gif" /> Estamos a preparar a visualização do documento. Por favor aguarde.
</div> </div>
</ion-content> </ion-content>
@@ -15,9 +15,6 @@ import { Location } from '@angular/common'
import { SqliteService } from 'src/app/services/sqlite.service'; import { SqliteService } from 'src/app/services/sqlite.service';
import { synchro } from '../../../services/socket/synchro.service'; import { synchro } from '../../../services/socket/synchro.service';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage'; import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page';
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page'; import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
import { ExpedientTaskModalPage } from '../../gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ExpedientTaskModalPage } from '../../gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
@@ -297,70 +294,43 @@ export class ViewEventPage implements OnInit {
const docId = this.loadedEvent.Attachments[ this.dicIndex].SourceId const docId = this.loadedEvent.Attachments[ this.dicIndex].SourceId
const applicationId: any = this.loadedEvent.Attachments[ this.dicIndex].ApplicationId const applicationId: any = this.loadedEvent.Attachments[ this.dicIndex].ApplicationId
const selectedDoc = this.loadedEvent.Attachments[ this.dicIndex]
this.processes.GetDocumentDetails(docId, applicationId).subscribe( async(res)=> { console.log('selectedDoc', selectedDoc)
this.LoadedDocument = res;
this.LoadedDocument.Subject = this.LoadedDocument.Assunto
let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate); this.task = {
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]); serialNumber: '',
taskStartDate: '',
let task: ExpedientTaskModalPageNavParamsTask isEvent: true,
let document: SearchDocumentDetails = this.LoadedDocument workflowInstanceDataFields: {
let folder: SearchFolderDetails = this.LoadedDocument FolderID: '',
Subject: selectedDoc.SourceName,
if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) { SourceSecFsID: selectedDoc.ApplicationId || selectedDoc['ApplicationID'],
task = { SourceType: 'DOC',
serialNumber: folder.DispatchNumber, SourceID: selectedDoc.SourceId,
taskStartDate: folder.DateDispatch, DispatchNumber: ''
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,
}
}
} else {
console.log('unexpected ApplicationID')
} }
}
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewDocumentPage, component: ViewDocumentPage,
componentProps: { componentProps: {
trustedUrl: '', trustedUrl: '',
file: { file: {
title: task.workflowInstanceDataFields.Subject, title: this.task.workflowInstanceDataFields.Subject,
url: '', url: '',
title_link: '', title_link: '',
},
Document: this.LoadedDocument,
applicationId: document.ApplicationID || document.ApplicationId,
docId: document.ApplicationID || document.ApplicationId,
folderId: folder['FolderId'] || folder['FolderID'] || folder.folderId
}, },
cssClass: 'modal modal-desktop' Document: this.loadedEvent.Attachments[ this.dicIndex],
}); applicationId: this.task.workflowInstanceDataFields.SourceSecFsID,
await modal.present(); docId: selectedDoc.SourceId,
folderId: '',
task: this.task
},
cssClass: 'modal modal-desktop'
}); });
await modal.present();
} }
async openBookMeetingModal() { async openBookMeetingModal() {
@@ -66,7 +66,7 @@
<div> <div>
<div class="file"> <div class="file">
<!-- <canvas id="pdf_canvas"></canvas> --> <!-- <canvas id="pdf_canvas"></canvas> -->
<div (click)="viewDocument(file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file"> <div (click)="viewDocument(msg.file, file.title_link)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type"> <span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
@@ -365,28 +365,66 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}; };
} }
viewDocument(file:any){ viewDocument(file:any, url?:string){
if(file.type == "file"){
let fullUrl = "https://www.tabularium.pt" + file.title_link; if(file.type == "application/webtrix") {
this.fileService.viewDocumentByUrl(fullUrl); this.openViewDocumentModal(file);
} }
else{ else{
this.fileService.viewDocumentByUrl(file.title_link); let fullUrl = "https://www.tabularium.pt" + url;
//this.openViewDocumentModal(file); this.fileService.viewDocumentByUrl(fullUrl);
} }
} }
async openViewDocumentModal(file:any){ async openViewDocumentModal(file:any){
let task = {
serialNumber: '',
taskStartDate: '',
isEvent: true,
workflowInstanceDataFields: {
FolderID: '',
Subject: file.Assunto,
SourceSecFsID: file.ApplicationId,
SourceType: 'DOC',
SourceID: file.DocId,
DispatchNumber: ''
}
}
let doc = {
"Id": "",
"ParentId": "",
"Source": 1,
"ApplicationId": file.ApplicationId,
"CreateDate": "",
"Data": null,
"Description":"",
"Link": null,
"SourceId": file.DocId,
"SourceName": file.Assunto,
"Stakeholders": "",
}
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewDocumentPage, component: ViewDocumentPage,
componentProps: { componentProps: {
file: file, trustedUrl: '',
file: {
title: file.Assunto,
url: '',
title_link: '',
},
Document: doc,
applicationId: file.ApplicationId,
docId: file.DocId,
folderId: '',
task: task
}, },
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop'
backdropDismiss: false
}); });
await modal.present(); await modal.present();
modal.onDidDismiss();
} }
async bookMeeting() { async bookMeeting() {
@@ -64,7 +64,7 @@
<div> <div>
<div class="file"> <div class="file">
<!-- <canvas id="pdf_canvas"></canvas> --> <!-- <canvas id="pdf_canvas"></canvas> -->
<div (click)="docIndex(i); viewDocument(msg.file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file"> <div (click)="docIndex(i); viewDocument(msg.file, file.title_link)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type"> <span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
+46 -69
View File
@@ -282,16 +282,15 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}) })
} }
viewDocument(file:any){ viewDocument(file:any, url?:string){
console.log(file); console.log(file);
if(file.type == "file"){ if(file.type == "application/webtrix") {
let fullUrl = "https://www.tabularium.pt" + file.title_link; this.openViewDocumentModal(file);
this.fileService.viewDocumentByUrl(fullUrl);
} }
else{ else{
this.fileService.viewDocumentByUrl(file.title_link); let fullUrl = "https://www.tabularium.pt" + url;
//this.openViewDocumentModal(file); this.fileService.viewDocumentByUrl(fullUrl);
} }
} }
@@ -300,75 +299,53 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async openViewDocumentModal(file:any){ async openViewDocumentModal(file:any){
console.log(file);
const docId = file.DocId;
const applicationId: any = file.ApplicationId;
this.processes.GetDocumentDetails(docId, applicationId).subscribe( async(res)=> { let task = {
serialNumber: '',
this.LoadedDocument = res; taskStartDate: '',
this.LoadedDocument.Subject = this.LoadedDocument.Assunto isEvent: true,
workflowInstanceDataFields: {
let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate); FolderID: '',
//this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]); Subject: file.Assunto,
SourceSecFsID: file.ApplicationId,
let task: ExpedientTaskModalPageNavParamsTask SourceType: 'DOC',
let document: SearchDocumentDetails = this.LoadedDocument SourceID: file.DocId,
let folder: SearchFolderDetails = this.LoadedDocument DispatchNumber: ''
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
},
}
}
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,
}
}
} else {
console.log('unexpected ApplicationID')
} }
}
let doc = {
"Id": "",
"ParentId": "",
"Source": 1,
"ApplicationId": file.ApplicationId,
"CreateDate": "",
"Data": null,
"Description":"",
"Link": null,
"SourceId": file.DocId,
"SourceName": file.Assunto,
"Stakeholders": "",
}
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewDocumentPage, component: ViewDocumentPage,
componentProps: { componentProps: {
trustedUrl: '', trustedUrl: '',
file: { file: {
title: task.workflowInstanceDataFields.Subject, title: file.Assunto,
url: '', url: '',
title_link: '', title_link: '',
},
Document: this.LoadedDocument,
applicationId: document.ApplicationID || document.ApplicationId,
docId: document.ApplicationID || document.ApplicationId,
folderId: folder['FolderId'] || folder['FolderID'] || folder.folderId
}, },
cssClass: 'modal modal-desktop' Document: doc,
}); applicationId: file.ApplicationId,
await modal.present(); docId: file.DocId,
folderId: '',
task: task
},
cssClass: 'modal modal-desktop'
}); });
await modal.present();
} }
getChatMembers() { getChatMembers() {
+1 -7
View File
@@ -267,8 +267,6 @@ export class FileService {
modal.onDidDismiss().then(async res=>{ modal.onDidDismiss().then(async res=>{
const data = res.data; const data = res.data;
alert('HERE')
if(data.selected){ if(data.selected){
const loader = this.toastService.loading(); const loader = this.toastService.loading();
@@ -277,14 +275,9 @@ export class FileService {
console.log(res.data.selected.Id); console.log(res.data.selected.Id);
console.log(res.data.selected.ApplicationType); console.log(res.data.selected.ApplicationType);
console.log('AQUIIIII');
alert('HERE 2')
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise(); let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
console.log(url_no_options); console.log(url_no_options);
console.log('Oie');
let body = { let body = {
"message": "message":
@@ -305,6 +298,7 @@ export class FileService {
"type": "application/webtrix", "type": "application/webtrix",
"ApplicationId": res.data.selected.ApplicationType, "ApplicationId": res.data.selected.ApplicationType,
"DocId": res.data.selected.Id, "DocId": res.data.selected.Id,
"Assunto": res.data.selected.Assunto,
} }
} }
} }
+19 -2
View File
@@ -27,7 +27,7 @@ export class ProcessesService {
) { ) {
this.loggeduser = this.user.ValidatedUser; this.loggeduser = this.user.ValidatedUser;
this.setHeader() this.setHeader()
this.changeProfileService.registerCallback(()=>{ this.changeProfileService.registerCallback(()=>{
this.loggeduser = this.user.ValidatedUser; this.loggeduser = this.user.ValidatedUser;
@@ -89,7 +89,7 @@ export class ProcessesService {
}; };
return this.http.get<any>(`${geturl}`, options); return this.http.get<any>(`${geturl}`, options);
} }
SetTaskToPending(serialNumber:string): Observable<any>{ SetTaskToPending(serialNumber:string): Observable<any>{
const geturl = environment.apiURL + 'Tasks/SetTaskPending'; const geturl = environment.apiURL + 'Tasks/SetTaskPending';
@@ -325,6 +325,23 @@ export class ProcessesService {
return this.http.post<any>(`${url}`,body, options); return this.http.post<any>(`${url}`,body, options);
} }
DocumentDetail(DocId:string, FsId:string){
const geturl = environment.apiURL + 'ecm/GetDocument';
let params = new HttpParams();
params = params.set("docId", DocId);
params = params.set("applicationId", FsId);
params = params.set("externalAppId ", 101);
params = params.set("SourceLocation ", 17);
let options = {
headers: this.headers,
params: params
};
return this.http.get<any>(`${geturl}`, options);
}
getFileBase64(DocId: string | number) { getFileBase64(DocId: string | number) {
let url = environment.apiURL + 'ecm/document/file'; let url = environment.apiURL + 'ecm/document/file';
@@ -172,70 +172,6 @@ export class ViewEventPage implements OnInit {
const docId = this.loadedEvent.Attachments[ this.dicIndex].SourceId const docId = this.loadedEvent.Attachments[ this.dicIndex].SourceId
const applicationId: any = this.loadedEvent.Attachments[ this.dicIndex].ApplicationId const applicationId: any = this.loadedEvent.Attachments[ this.dicIndex].ApplicationId
// this.processes.GetDocumentDetails(docId, applicationId).subscribe( async(res)=> {
// this.LoadedDocument = res;
// this.LoadedDocument.Subject = this.LoadedDocument.Assunto
// let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate);
// this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
// let task: ExpedientTaskModalPageNavParamsTask
// let document: SearchDocumentDetails = this.LoadedDocument
// 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
// },
// }
// } 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,
// }
// }
// } else {
// console.log('unexpected ApplicationID')
// }
// const modal = await this.modalController.create({
// component: ViewDocumentPage,
// componentProps: {
// trustedUrl: '',
// file: {
// title: task.workflowInstanceDataFields.Subject,
// url: '',
// title_link: '',
// },
// Document: this.LoadedDocument,
// applicationId: task.workflowInstanceDataFields.SourceSecFsID,
// docId: this.LoadedDocument.DocId || this.LoadedDocument.DocID,
// folderId: folder['FolderId'] || folder['FolderID'] || folder.folderId
// },
// cssClass: 'modal modal-desktop'
// });
// await modal.present();
// });
const selectedDoc = this.loadedEvent.Attachments[ this.dicIndex] const selectedDoc = this.loadedEvent.Attachments[ this.dicIndex]
console.log('selectedDoc', selectedDoc) console.log('selectedDoc', selectedDoc)
@@ -254,7 +190,6 @@ export class ViewEventPage implements OnInit {
} }
} }
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewDocumentPage, component: ViewDocumentPage,
componentProps: { componentProps: {
@@ -59,7 +59,7 @@
<div> <div>
<div class="file"> <div class="file">
<!-- <canvas id="pdf_canvas"></canvas> --> <!-- <canvas id="pdf_canvas"></canvas> -->
<div (click)="viewDocument(file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file"> <div (click)="viewDocument(msg.file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type"> <span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
@@ -608,28 +608,63 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}); });
} }
viewDocument(file:any){ viewDocument(file:any, url?:string){
if(file.type == "file"){ if(file.type == "application/webtrix") {
let fullUrl = "https://www.tabularium.pt" + file.title_link; this.openViewDocumentModal(file);
this.fileService.viewDocumentByUrl(fullUrl); }
} else{
else{ let fullUrl = "https://www.tabularium.pt" + url;
this.fileService.viewDocumentByUrl(file.title_link); this.fileService.viewDocumentByUrl(fullUrl);
//this.openViewDocumentModal(file); }
}
} }
async openViewDocumentModal(file:any){ async openViewDocumentModal(file:any){
let task = {
serialNumber: '',
taskStartDate: '',
isEvent: true,
workflowInstanceDataFields: {
FolderID: '',
Subject: file.Assunto,
SourceSecFsID: file.ApplicationId,
SourceType: 'DOC',
SourceID: file.DocId,
DispatchNumber: ''
}
}
let doc = {
"Id": "",
"ParentId": "",
"Source": 1,
"ApplicationId": file.ApplicationId,
"CreateDate": "",
"Data": null,
"Description":"",
"Link": null,
"SourceId": file.DocId,
"SourceName": file.Assunto,
"Stakeholders": "",
}
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewDocumentPage, component: ViewDocumentPage,
componentProps: { componentProps: {
file: file, trustedUrl: '',
file: {
title: file.Assunto,
url: '',
title_link: '',
},
Document: doc,
applicationId: file.ApplicationId,
docId: file.DocId,
folderId: '',
task: task
}, },
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop'
backdropDismiss: false
}); });
await modal.present(); await modal.present();
modal.onDidDismiss();
} }
takePicture(){ takePicture(){
@@ -51,7 +51,7 @@
<div> <div>
<div class="file"> <div class="file">
<!-- <canvas id="pdf_canvas"></canvas> --> <!-- <canvas id="pdf_canvas"></canvas> -->
<div (click)="viewDocument(file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file"> <div (click)="viewDocument(msg.file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type"> <span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
+49 -13
View File
@@ -242,28 +242,64 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}) })
} }
viewDocument(file:any){ viewDocument(file:any, url?:string){
if(file.type == "file"){ if(file.type == "application/webtrix") {
let fullUrl = "https://www.tabularium.pt" + file.title_link; this.openViewDocumentModal(file);
this.fileService.viewDocumentByUrl(fullUrl); }
} else{
else{ let fullUrl = "https://www.tabularium.pt" + url;
this.fileService.viewDocumentByUrl(file.title_link); this.fileService.viewDocumentByUrl(fullUrl);
//this.openViewDocumentModal(file); }
}
} }
async openViewDocumentModal(file:any){ async openViewDocumentModal(file:any){
let task = {
serialNumber: '',
taskStartDate: '',
isEvent: true,
workflowInstanceDataFields: {
FolderID: '',
Subject: file.Assunto,
SourceSecFsID: file.ApplicationId,
SourceType: 'DOC',
SourceID: file.DocId,
DispatchNumber: ''
}
}
let doc = {
"Id": "",
"ParentId": "",
"Source": 1,
"ApplicationId": file.ApplicationId,
"CreateDate": "",
"Data": null,
"Description":"",
"Link": null,
"SourceId": file.DocId,
"SourceName": file.Assunto,
"Stakeholders": "",
}
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewDocumentPage, component: ViewDocumentPage,
componentProps: { componentProps: {
file: file, trustedUrl: '',
file: {
title: file.Assunto,
url: '',
title_link: '',
},
Document: doc,
applicationId: file.ApplicationId,
docId: file.DocId,
folderId: '',
task: task
}, },
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop'
backdropDismiss: false
}); });
await modal.present(); await modal.present();
modal.onDidDismiss();
} }
getChatMembers() { getChatMembers() {