mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -216,13 +216,13 @@
|
||||
<ion-fab-button title="Nova Reunião" (click)="bookMeeting()" color="light">
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button hidden title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-icon name="document"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
||||
<ion-icon name="image"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Tirar Fotografia" (click)="takePicture()" color="light">
|
||||
<ion-fab-button title="Tirar Fotografia" (click)="takePictureMobile()" color="light">
|
||||
<ion-icon name="camera"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Documento da Gestão Documental" (click)="addFileWebtrix()" color="light">
|
||||
|
||||
@@ -32,6 +32,7 @@ import { CameraService } from 'src/app/services/camera.service';
|
||||
import { element } from 'protractor';
|
||||
import { FileType } from 'src/app/models/fileType';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||
|
||||
/*
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
@@ -542,6 +543,41 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
async takePictureMobile() {
|
||||
const roomId = this.roomId
|
||||
|
||||
const file = await Camera.getPhoto({
|
||||
quality: 90,
|
||||
// allowEditing: true,
|
||||
resultType: CameraResultType.Base64,
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
console.log('ADDFILECHAT', file)
|
||||
//const imageData = await this.fileToBase64Service.convert(file)
|
||||
//console.log('ADDFILECHAT', imageData)
|
||||
|
||||
const response = await fetch('data:image/jpeg;base64,'+ file.base64String!);
|
||||
const blob = await response.blob();
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": '',
|
||||
},
|
||||
temporaryData: formData,
|
||||
attachments: [{
|
||||
"title": file.path ,
|
||||
"image_url": 'data:image/jpeg;base64,' +file.base64String,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
async takePicture() {
|
||||
const roomId = this.roomId
|
||||
|
||||
@@ -572,7 +608,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
}
|
||||
|
||||
async addImage() {
|
||||
this.addFileToChat(['image/apng', 'image/jpeg', 'image/png'])
|
||||
this.addFileToChatMobile(['image/apng', 'image/jpeg', 'image/png'])
|
||||
}
|
||||
|
||||
async addFile() {
|
||||
@@ -624,7 +660,40 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
}
|
||||
});
|
||||
}
|
||||
async addFileToChatMobile(types: typeof FileType[] ) {
|
||||
const roomId = this.roomId
|
||||
|
||||
const file = await Camera.getPhoto({
|
||||
quality: 90,
|
||||
// allowEditing: true,
|
||||
resultType: CameraResultType.Base64,
|
||||
source: CameraSource.Photos
|
||||
});
|
||||
console.log('ADDFILECHAT', file)
|
||||
//const imageData = await this.fileToBase64Service.convert(file)
|
||||
//console.log('ADDFILECHAT', imageData)
|
||||
|
||||
const response = await fetch('data:image/jpeg;base64,'+ file.base64String!);
|
||||
const blob = await response.blob();
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": ''
|
||||
},
|
||||
temporaryData: formData,
|
||||
attachments: [{
|
||||
"title": file.path ,
|
||||
"image_url": 'data:image/jpeg;base64,' +file.base64String,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
async addFileToChat(types: typeof FileType[] ) {
|
||||
|
||||
@@ -196,13 +196,13 @@
|
||||
<ion-fab-button title="Nova Reunião" (click)="bookMeeting()" color="light">
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Adicionar Documento" hidden (click)="addFile()" color="light">
|
||||
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-icon name="document"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
||||
<ion-icon name="image"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Tirar Fotografia" (click)="takePicture()" color="light">
|
||||
<ion-fab-button title="Tirar Fotografia" (click)="takePictureMobile()" color="light">
|
||||
<ion-icon name="camera"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Documento da Gestão Documental" (click)="addFileWebtrix()" color="light">
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="main-container px-20">
|
||||
<ion-list>
|
||||
<div class="post-item d-md-block mb-10 cursor-pointer"
|
||||
*ngFor="let publication of publicationListStorage.documents[folderId]"
|
||||
*ngFor="let publication of getpublication"
|
||||
(click)="viewPublicationDetail(publication.DocumentId)">
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="mb-10 post-img width-md-100">
|
||||
<img src="{{publication.FileBase64}}" alt="image">
|
||||
|
||||
@@ -13,6 +13,7 @@ import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-action.page';
|
||||
import { Storage } from '@ionic/storage';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -25,7 +26,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
publicationList: Publication[];
|
||||
item: PublicationFolder;
|
||||
|
||||
getpublication = [];
|
||||
error: any;
|
||||
|
||||
@Input() folderId: string;
|
||||
@@ -50,6 +51,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private publications: PublicationsService,
|
||||
public ThemeService: ThemeService,
|
||||
private toastService: ToastService,
|
||||
private storage: Storage
|
||||
) {
|
||||
this.item = new PublicationFolder();
|
||||
}
|
||||
@@ -72,10 +74,10 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
console.log('change view to ',this.folderId)
|
||||
|
||||
setTimeout(()=>{
|
||||
//setTimeout(()=>{
|
||||
this.getPublications();
|
||||
this.getPublicationDetail();
|
||||
}, 100)
|
||||
//}, 100)
|
||||
|
||||
|
||||
}
|
||||
@@ -99,11 +101,58 @@ export class ViewPublicationsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getPublicationsIds() {
|
||||
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
this.getFromDB()
|
||||
this.publications.GetPublicationsImages(this.folderId).subscribe(res => {
|
||||
|
||||
console.log('publications ids', res)
|
||||
this.publicationList = new Array();
|
||||
|
||||
for(let i = 0; i < res.length; i++) {
|
||||
this.publications.GetPublicationById(res[i]).subscribe(ress => {
|
||||
console.log('publications by ids', ress)
|
||||
let item: Publication = this.publicationPipe.itemList(ress)
|
||||
console.log('publications by ids 2', item)
|
||||
this.publicationList.push(item);
|
||||
})
|
||||
}
|
||||
|
||||
/* res.forEach(element => {
|
||||
console.log('publications elements', element)
|
||||
this.publications.GetPublicationById(element).subscribe(ress => {
|
||||
console.log('publications by ids', ress)
|
||||
let item: Publication = this.publicationPipe.itemList(ress)
|
||||
console.log('publications by ids 2', item)
|
||||
this.publicationList.push(item);
|
||||
})
|
||||
|
||||
}); */
|
||||
console.log('PUBLICATIONS IMAGEs',this.publicationList)
|
||||
this.storage.remove('view_publications');
|
||||
this.storage.set('view_publications', this.publicationList);
|
||||
console.log('PUBLICATIONS IMAGEs',this.publicationList)
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
this.getpublication = this.publicationList;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
this.storage.get('view_publications').then((viewPublications) => {
|
||||
this.getpublication = viewPublications;
|
||||
})
|
||||
}
|
||||
|
||||
getPublications() {
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
this.publicationList = new Array();
|
||||
this.publications.GetPublications(folderId).subscribe(res=> {
|
||||
this.getFromDB();
|
||||
this.publications.GetPublications(folderId).subscribe(async res=> {
|
||||
|
||||
res.forEach(element => {
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
@@ -111,7 +160,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
});
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
|
||||
await this.storage.remove('view_publications');
|
||||
await this.storage.set('view_publications', this.publicationList);
|
||||
//this.getFromDB();
|
||||
this.showLoader = false;
|
||||
},
|
||||
(error)=>{
|
||||
|
||||
Reference in New Issue
Block a user