mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -120,7 +120,7 @@
|
||||
<div [ngSwitch]="segment">
|
||||
<div *ngSwitchCase="'parecer'" class="centered-div d-flex height-100 align-center justify-content-center" >
|
||||
<div
|
||||
*ngIf="!skeletonLoader && pedidosstorage.listparecer.length == 0"
|
||||
*ngIf="pedidosstorage.listparecer.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
<div *ngSwitchCase="'deferimento'" class="centered-div d-flex height-100 align-center justify-content-center">
|
||||
<div
|
||||
*ngIf="!skeletonLoader && pedidosstorage.listdeferimento.length == 0"
|
||||
*ngIf="pedidosstorage.listdeferimento.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
|
||||
@@ -163,7 +163,9 @@ export class PedidosPage implements OnInit {
|
||||
this.parecerList.push(task);
|
||||
});
|
||||
this.addPedidoToDb(this.parecerList);
|
||||
|
||||
this.listToPresentparecerList = this.sortService.sortArrayISODate(this.parecerList);
|
||||
this.pedidosstorage.resetparecer(this.listToPresentparecerList);
|
||||
|
||||
}
|
||||
else if (this.segment == 'deferimento') {
|
||||
@@ -204,6 +206,8 @@ export class PedidosPage implements OnInit {
|
||||
});
|
||||
this.addPedidoToDb(this.deferimentoList);
|
||||
this.listToPresentdeferimentoList = this.sortService.sortArrayISODate(this.deferimentoList);
|
||||
this.pedidosstorage.resetdeferimento(this.listToPresentdeferimentoList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ion-item-container-no-border">
|
||||
<!-- <ion-label (click)="" class="cursor-pointer"> -->
|
||||
<ion-label (click)="selectImage()" class="cursor-pointer">
|
||||
<div class="attach-icon">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photos.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photos.svg"></ion-icon>
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
|
||||
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { Photos } from './photos';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
@@ -71,11 +70,7 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
capturedImage: any = '';
|
||||
capturedImageTitle: any;
|
||||
// public photos: any[] = [];
|
||||
|
||||
public photos: Photos[] = [];
|
||||
private PHOTO_STORAGE: string = "photos";
|
||||
private platform: Platform;
|
||||
public photos: any[] = [];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -86,7 +81,7 @@ export class NewPublicationPage implements OnInit {
|
||||
private fileLoaderService: FileLoaderService,
|
||||
private fileToBase64Service: FileToBase64Service,
|
||||
public ThemeService: ThemeService,
|
||||
// private platform: Platform,
|
||||
private platform: Platform,
|
||||
private loadingCtrl: LoadingController,
|
||||
) {
|
||||
|
||||
@@ -118,104 +113,17 @@ export class NewPublicationPage implements OnInit {
|
||||
if (image) {
|
||||
this.saveImage(image)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Little helper
|
||||
// async presentToast(text) {
|
||||
// const toast = await this.toastCtrl.create({
|
||||
// message: text,
|
||||
// duration: 3000,
|
||||
// });
|
||||
// toast.present();
|
||||
// }
|
||||
|
||||
// async selectImage() {
|
||||
// const image = await Camera.getPhoto({
|
||||
// quality: 90,
|
||||
// allowEditing: false,
|
||||
// resultType: CameraResultType.Uri,
|
||||
// source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||
// });
|
||||
|
||||
// if (image) {
|
||||
// this.saveImage(image)
|
||||
// }
|
||||
// }
|
||||
|
||||
// Create a new file from a capture image
|
||||
/* async saveImage(photo: Photo) {
|
||||
const base64Data = await this.readAsBase64(photo);
|
||||
|
||||
const fileName = new Date().getTime() + '.jpeg';
|
||||
const savedFile = await Filesystem.writeFile({
|
||||
path: `${IMAGE_DIR}/${fileName}`,
|
||||
data: base64Data,
|
||||
directory: Directory.Data
|
||||
});
|
||||
|
||||
// Reload the file list
|
||||
// Improve by only loading for the new image and unshifting array!
|
||||
this.loadFiles();
|
||||
} */
|
||||
|
||||
// https://ionicframework.com/docs/angular/your-first-app/3-saving-photos
|
||||
// private async readAsBase64(photo: Photo) {
|
||||
// if (this.platform.is('hybrid')) {
|
||||
// const file = await Filesystem.readFile({
|
||||
// path: photo.path
|
||||
// });
|
||||
|
||||
// return file.data;
|
||||
// }
|
||||
// else {
|
||||
// // Fetch the photo, read as a blob, then convert to base64 format
|
||||
// const response = await fetch(photo.webPath);
|
||||
// const blob = await response.blob();
|
||||
|
||||
// return await this.convertBlobToBase64(blob) as string;
|
||||
// }
|
||||
// }
|
||||
|
||||
// Helper function
|
||||
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
const reader = new FileReader;
|
||||
reader.onerror = reject;
|
||||
reader.onload = () => {
|
||||
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
const reader = new FileReader;
|
||||
reader.onerror = reject;
|
||||
reader.onload = () => {
|
||||
resolve(reader.result);
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
});
|
||||
|
||||
|
||||
async startUpload(file: LocalFile) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
async deleteImage(file: LocalFile) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
||||
|
||||
// async takePicture() {
|
||||
// const capturedImage = await Camera.getPhoto({
|
||||
// quality: 90,
|
||||
// // allowEditing: true,
|
||||
// resultType: CameraResultType.Uri,
|
||||
// source: CameraSource.Camera
|
||||
|
||||
// });
|
||||
|
||||
// }
|
||||
|
||||
// convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
// const reader = new FileReader;
|
||||
// reader.onerror = reject;
|
||||
// reader.onload = () => {
|
||||
// resolve(reader.result);
|
||||
// };
|
||||
// reader.readAsDataURL(blob);
|
||||
// });
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
});
|
||||
|
||||
|
||||
async laodPicture() {
|
||||
@@ -291,6 +199,8 @@ private async savePicture(photo: Photo) {
|
||||
|
||||
} */
|
||||
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
@@ -519,9 +429,9 @@ private async savePicture(photo: Photo) {
|
||||
}
|
||||
}
|
||||
|
||||
// // Create a new file from a capture image
|
||||
async saveImage(photo: Photo) {
|
||||
const base64Data = await this.readAsBase64(photo);
|
||||
// Create a new file from a capture image
|
||||
async saveImage(photo: Photo) {
|
||||
const base64Data = await this.readAsBase64(photo);
|
||||
|
||||
const fileName = new Date().getTime() + '.jpeg';
|
||||
const savedFile = await Filesystem.writeFile({
|
||||
|
||||
Reference in New Issue
Block a user