mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
upload file on chat its done
This commit is contained in:
@@ -821,9 +821,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
})));
|
})));
|
||||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
|
|
||||||
const fileBase64 = await this._getBase64(file)
|
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('blobFile', blob);
|
formData.append('blobFile', blob);
|
||||||
|
|
||||||
@@ -841,7 +838,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}],
|
}],
|
||||||
temporaryData: formData,
|
temporaryData: formData,
|
||||||
attachmentsModelData: {
|
attachmentsModelData: {
|
||||||
fileBase64: fileBase64
|
fileBase64: encodedData
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1084,7 +1081,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openFile(pdfString, filename, type) {
|
async openFile(pdfString, filename, type) {
|
||||||
const blob = this.b64toBlob(pdfString, 'application/pdf')
|
const blob = this.b64toBlob(pdfString, type)
|
||||||
let pathFile = ''
|
let pathFile = ''
|
||||||
const fileName = filename
|
const fileName = filename
|
||||||
const contentFile = blob
|
const contentFile = blob
|
||||||
@@ -1097,7 +1094,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
await Filesystem.writeFile({
|
await Filesystem.writeFile({
|
||||||
path: fileName,
|
path: fileName,
|
||||||
data: pdfString,
|
data: pdfString,
|
||||||
directory: Directory.Documents,
|
directory: Directory.Data,
|
||||||
}).then((dir) => {
|
}).then((dir) => {
|
||||||
console.log('DIR ', dir)
|
console.log('DIR ', dir)
|
||||||
this.fileOpener
|
this.fileOpener
|
||||||
|
|||||||
@@ -829,24 +829,32 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
console.log(file)
|
console.log(file)
|
||||||
|
|
||||||
|
|
||||||
|
/* const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||||
|
console.error(error);
|
||||||
|
})));
|
||||||
|
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
|
const fileBase64 = await this._getBase64(file)
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('blobFile', blob);
|
||||||
|
console.log('add file', fileBase64) */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||||
console.log('TYPE',file.type)
|
console.log('TYPE',file.type)
|
||||||
|
|
||||||
const encodedData = 'data:application/pdf;base64,'+btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
})));
|
})));
|
||||||
console.log(encodedData)
|
console.log(encodedData)
|
||||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||||
console.log('BLOB BLOB',blob)
|
console.log('BLOB BLOB',blob)
|
||||||
/* const fileBase64 = await this._getBase64(file)
|
|
||||||
console.log('BASE&$',fileBase64) */
|
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
/* const formData = new FormData();
|
formData.append('blobFile', blob);
|
||||||
console.log('add file', formData)
|
/* console.log('add file', fileBase64) */
|
||||||
formData.append('blobFile', blob); */
|
|
||||||
let ob = {'blobFile': blob}
|
|
||||||
|
|
||||||
this.ChatSystemService.getDmRoom(roomId).send({
|
this.ChatSystemService.getDmRoom(roomId).send({
|
||||||
file: {
|
file: {
|
||||||
@@ -859,7 +867,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
// "text": "description",
|
// "text": "description",
|
||||||
"title_link_download": false,
|
"title_link_download": false,
|
||||||
}],
|
}],
|
||||||
temporaryData: ob,
|
temporaryData: formData,
|
||||||
attachmentsModelData: {
|
attachmentsModelData: {
|
||||||
fileBase64: encodedData,
|
fileBase64: encodedData,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,9 +272,9 @@
|
|||||||
<!-- <ion-fab-button *ngIf="p.userPermission([p.permissionList.Agenda.access])" title="Nova Reunião" (click)="bookMeeting()" color="light">
|
<!-- <ion-fab-button *ngIf="p.userPermission([p.permissionList.Agenda.access])" title="Nova Reunião" (click)="bookMeeting()" color="light">
|
||||||
<ion-icon name="calendar"></ion-icon>
|
<ion-icon name="calendar"></ion-icon>
|
||||||
</ion-fab-button> -->
|
</ion-fab-button> -->
|
||||||
<!-- <ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||||
<ion-icon name="document"></ion-icon>
|
<ion-icon name="document"></ion-icon>
|
||||||
</ion-fab-button> -->
|
</ion-fab-button>
|
||||||
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
||||||
<ion-icon name="image"></ion-icon>
|
<ion-icon name="image"></ion-icon>
|
||||||
</ion-fab-button>
|
</ion-fab-button>
|
||||||
|
|||||||
@@ -252,9 +252,9 @@
|
|||||||
<!-- <ion-fab-button *ngIf="p.userPermission([p.permissionList.Agenda.access])" title="Nova Reunião" (click)="bookMeeting()" color="light">
|
<!-- <ion-fab-button *ngIf="p.userPermission([p.permissionList.Agenda.access])" title="Nova Reunião" (click)="bookMeeting()" color="light">
|
||||||
<ion-icon name="calendar"></ion-icon>
|
<ion-icon name="calendar"></ion-icon>
|
||||||
</ion-fab-button> -->
|
</ion-fab-button> -->
|
||||||
<!-- <ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||||
<ion-icon name="document"></ion-icon>
|
<ion-icon name="document"></ion-icon>
|
||||||
</ion-fab-button> -->
|
</ion-fab-button>
|
||||||
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
||||||
<ion-icon name="image"></ion-icon>
|
<ion-icon name="image"></ion-icon>
|
||||||
</ion-fab-button>
|
</ion-fab-button>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
|
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
|
||||||
<!-- <button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button> -->
|
<button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
|
||||||
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
|
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
|
||||||
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
|
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "4eff2575b",
|
"shortSHA": "081fe8692",
|
||||||
"SHA": "4eff2575b69312a72f16c8e30e03bd6a797bb762",
|
"SHA": "081fe8692c8575cc102a91c6357d193d52cb9c0f",
|
||||||
"branch": "developer-prod",
|
"branch": "developer-prod",
|
||||||
"lastCommitAuthor": "'Eudes Inácio'",
|
"lastCommitAuthor": "'Eudes Inácio'",
|
||||||
"lastCommitTime": "'Wed Aug 30 20:54:47 2023 +0100'",
|
"lastCommitTime": "'Wed Aug 30 20:56:46 2023 +0100'",
|
||||||
"lastCommitMessage": "add file on chat its hide",
|
"lastCommitMessage": "pull made",
|
||||||
"lastCommitNumber": "5250",
|
"lastCommitNumber": "5252",
|
||||||
"change": "",
|
"change": "",
|
||||||
"changeStatus": "On branch developer-prod\nYour branch and 'origin/developer-prod' have diverged,\nand have 3 and 1 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/modals/create-process/create-process.page.ts\n\tmodified: src/app/models/folder.model.ts\n\tmodified: src/assets/images/theme/gov/icons-delete.svg",
|
"changeStatus": "On branch developer-prod\nYour branch is up to date with 'origin/developer-prod'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.html\n\tmodified: src/app/shared/chat/messages/messages.page.html\n\tmodified: src/app/shared/popover/chat-options-popover/chat-options-popover.page.html",
|
||||||
"changeAuthor": "eudes.inacio"
|
"changeAuthor": "eudes.inacio"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user