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
@@ -172,70 +172,6 @@ export class ViewEventPage implements OnInit {
const docId = this.loadedEvent.Attachments[ this.dicIndex].SourceId
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]
console.log('selectedDoc', selectedDoc)
@@ -254,7 +190,6 @@ export class ViewEventPage implements OnInit {
}
}
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
@@ -59,7 +59,7 @@
<div>
<div class="file">
<!-- <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">
<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>
@@ -608,28 +608,63 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
}
viewDocument(file:any){
if(file.type == "file"){
let fullUrl = "https://www.tabularium.pt" + file.title_link;
this.fileService.viewDocumentByUrl(fullUrl);
}
else{
this.fileService.viewDocumentByUrl(file.title_link);
//this.openViewDocumentModal(file);
}
viewDocument(file:any, url?:string){
if(file.type == "application/webtrix") {
this.openViewDocumentModal(file);
}
else{
let fullUrl = "https://www.tabularium.pt" + url;
this.fileService.viewDocumentByUrl(fullUrl);
}
}
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({
component: ViewDocumentPage,
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',
backdropDismiss: false
cssClass: 'modal modal-desktop'
});
await modal.present();
modal.onDidDismiss();
}
takePicture(){
@@ -51,7 +51,7 @@
<div>
<div class="file">
<!-- <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">
<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>
+49 -13
View File
@@ -242,28 +242,64 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
}
viewDocument(file:any){
if(file.type == "file"){
let fullUrl = "https://www.tabularium.pt" + file.title_link;
this.fileService.viewDocumentByUrl(fullUrl);
}
else{
this.fileService.viewDocumentByUrl(file.title_link);
//this.openViewDocumentModal(file);
}
viewDocument(file:any, url?:string){
if(file.type == "application/webtrix") {
this.openViewDocumentModal(file);
}
else{
let fullUrl = "https://www.tabularium.pt" + url;
this.fileService.viewDocumentByUrl(fullUrl);
}
}
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({
component: ViewDocumentPage,
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',
backdropDismiss: false
cssClass: 'modal modal-desktop'
});
await modal.present();
modal.onDidDismiss();
}
getChatMembers() {