mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add document viewer in chat
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -614,22 +614,58 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
this.fileService.viewDocumentByUrl(fullUrl);
|
||||
}
|
||||
else{
|
||||
this.fileService.viewDocumentByUrl(file.title_link);
|
||||
//this.openViewDocumentModal(file);
|
||||
//this.fileService.viewDocumentByUrl(file.title_link);
|
||||
this.openViewDocumentModal(file);
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
|
||||
@@ -248,22 +248,58 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.fileService.viewDocumentByUrl(fullUrl);
|
||||
}
|
||||
else{
|
||||
this.fileService.viewDocumentByUrl(file.title_link);
|
||||
//this.openViewDocumentModal(file);
|
||||
//this.fileService.viewDocumentByUrl(file.title_link);
|
||||
this.openViewDocumentModal(file);
|
||||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user