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:
@@ -60,6 +60,16 @@ export class AppComponent {
|
||||
console.log('Orientation locked')
|
||||
}
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
} else {
|
||||
try {
|
||||
this.sqliteservice.databaseConn();
|
||||
} catch (error) {
|
||||
console.log("Error creating local database: ", error)
|
||||
}
|
||||
}
|
||||
|
||||
this.storageservice.get('networkCheckStore').then((network) => {
|
||||
if(network === 'online') {
|
||||
console.log('Network app componente check', network)
|
||||
|
||||
@@ -65,7 +65,7 @@ import { MediaCapture } from '@ionic-native/media-capture/ngx';
|
||||
import { Media } from '@ionic-native/media/ngx';
|
||||
import { StreamingMedia } from '@ionic-native/streaming-media/ngx';
|
||||
import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
|
||||
|
||||
import {NgxImageCompressService} from 'ngx-image-compress';
|
||||
|
||||
/* import { FCM } from '@ionic-native/fcm/ngx';
|
||||
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
@@ -132,7 +132,8 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
MediaCapture,
|
||||
Media,
|
||||
StreamingMedia,
|
||||
PhotoViewer
|
||||
PhotoViewer,
|
||||
NgxImageCompressService
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ion-tab-button tab="events">
|
||||
<!-- <ion-icon name="home"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
||||
<ion-badge color="danger">{{toDayEventStorage.eventsList.length + expedienteGdStore.count}}</ion-badge>
|
||||
<!-- <ion-badge color="danger">{{toDayEventStorage.eventsList.length + expedienteGdStore.count}}</ion-badge> -->
|
||||
<ion-label>Início</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<ion-tab-button (click)="goto('/home/gabinete-digital')">
|
||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
||||
<ion-badge color="danger" *ngIf="!p.userRole(['PR'])" >{{ documentCounterService.mdTotalDocument }}</ion-badge>
|
||||
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge>
|
||||
<!-- <ion-badge color="danger" *ngIf="!p.userRole(['PR'])" >{{ documentCounterService.mdTotalDocument }}</ion-badge>
|
||||
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge> -->
|
||||
<ion-label>Gabinete</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import { EventsService } from 'src/app/services/events.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Device } from '@capacitor/device';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -122,6 +123,8 @@ export class HomePage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.logDeviceInfo();
|
||||
|
||||
this.notificationsService.onReciveForeground();
|
||||
this.notificationsService.onReciveBackground();
|
||||
|
||||
@@ -149,6 +152,12 @@ export class HomePage implements OnInit {
|
||||
myWorker.postMessage('ali'); */
|
||||
}
|
||||
|
||||
logDeviceInfo = async () => {
|
||||
const info = await Device.getInfo();
|
||||
|
||||
console.log('Device info',info);
|
||||
};
|
||||
|
||||
updateList() {
|
||||
|
||||
/* this.notificationsService.registerCallback(
|
||||
|
||||
@@ -72,9 +72,9 @@
|
||||
<img style="width: 40px;" src="assets/images/logo-removebg-preview.png"/>
|
||||
</div>
|
||||
|
||||
<div hidden class="btn-close d-flex cursor-pointer pr-10" (click)="changeTheme('tribunal')" >
|
||||
<!-- <div hidden class="btn-close d-flex cursor-pointer pr-10" (click)="changeTheme('tribunal')" >
|
||||
<img style="width: 40px;" src="assets/images/theme/tribunal/tribunal-constitucional-logo.png"/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<ion-header class="ion-no-border ">
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-header class="ion-no-border text-white">
|
||||
<ion-header class="ion-no-border init-event-header">
|
||||
<ion-label>
|
||||
<p class="time ion-text-center">{{customDate}}</p>
|
||||
</ion-label>
|
||||
|
||||
@@ -275,6 +275,7 @@ ion-toolbar{
|
||||
// new
|
||||
.main{
|
||||
padding: 0px em(20px);
|
||||
background: linear-gradient(270deg, var(--color2) 100%, var(--color3) 100%, var(--color4) 100%, var(--color5) 100%) !important;
|
||||
}
|
||||
|
||||
.event-number{
|
||||
|
||||
@@ -192,9 +192,9 @@ export class InactivityPage implements OnInit {
|
||||
goback() {
|
||||
const pathName = this.SessionStore.user.UrlBeforeInactivity
|
||||
if(pathName) {
|
||||
this.router.navigate([pathName]);
|
||||
this.router.navigate([pathName],{replaceUrl: true});
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
this.router.navigate(['/home/events'], {replaceUrl: true});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
|
||||
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { NgxImageCompressService } from "ngx-image-compress";
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
@@ -72,6 +73,9 @@ export class NewPublicationPage implements OnInit {
|
||||
capturedImageTitle: any;
|
||||
public photos: any[] = [];
|
||||
|
||||
imgResultBeforeCompress: string;
|
||||
imgResultAfterCompress: string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
public photoService: PhotoService,
|
||||
@@ -83,6 +87,7 @@ export class NewPublicationPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private platform: Platform,
|
||||
private loadingCtrl: LoadingController,
|
||||
public imageCompress: NgxImageCompressService
|
||||
) {
|
||||
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
@@ -104,11 +109,11 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
async takePicture() {
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 50,
|
||||
quality: 20,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||
|
||||
|
||||
});
|
||||
|
||||
if (image) {
|
||||
@@ -118,13 +123,13 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
imageSize(image){
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
canvas.width=100
|
||||
canvas.height=34
|
||||
ctx.drawImage(image, 0, 0, 100, 34);
|
||||
document.body.appendChild(canvas);
|
||||
imageSize(image) {
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
canvas.width = 100
|
||||
canvas.height = 34
|
||||
ctx.drawImage(image, 0, 0, 100, 34);
|
||||
document.body.appendChild(canvas);
|
||||
}
|
||||
|
||||
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
@@ -392,7 +397,7 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
async selectImage() {
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 50,
|
||||
quality: 20,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||
@@ -403,7 +408,7 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Create a new file from a capture image
|
||||
async saveImage(photo: Photo) {
|
||||
@@ -492,12 +497,43 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
this.capturedImage = this.images[0].data
|
||||
|
||||
this.compressFile();
|
||||
|
||||
loading.dismiss();
|
||||
|
||||
}
|
||||
|
||||
/* compressImage() {
|
||||
let image = this.capturedImage;
|
||||
this.imageCompress.compressFile(image, orientation, 50, 50,).then(() => {
|
||||
|
||||
this.imgResultBeforeCompress = image;
|
||||
console.log('Size in bytes was:', this.imageCompress.byteCount(image));
|
||||
|
||||
this.imageCompress.compressFile(image, orientation, 50, 50).then(
|
||||
result => {
|
||||
this.imgResultAfterCompress = result;
|
||||
console.log('Size in bytes is now:', this.imageCompress.byteCount(result));
|
||||
}
|
||||
);
|
||||
})
|
||||
} */
|
||||
|
||||
compressFile() {
|
||||
|
||||
//this.imgResultBeforeCompress = image;
|
||||
this.imageCompress.getOrientation(this.capturedImage).then((orientation) => {
|
||||
console.log('Size in bytes was:', this.imageCompress.byteCount(this.capturedImage));
|
||||
this.imageCompress.compressFile(this.capturedImage, orientation, 20, 20).then(
|
||||
result => {
|
||||
this.capturedImage = result;
|
||||
console.log('Size in bytes is now:', this.imageCompress.byteCount(result));
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<ion-item-option class="edit-option" (click)="editAction(viagem.ProcessId)">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/cons-edit.svg" ></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
|
||||
|
||||
</button>
|
||||
</ion-item-option>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="header-container">
|
||||
|
||||
<div class="main-tab pb-10 ion-toolbar text-white">
|
||||
<div class="main-tab pb-10 ion-toolbar header-color">
|
||||
|
||||
<div class="mobile d-flex div-top-header justify-space-between">
|
||||
<div *ngIf="!hideSearchBtn" class="div-search">
|
||||
|
||||
@@ -770,6 +770,17 @@
|
||||
color: black;
|
||||
}
|
||||
|
||||
.header-color {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.init-event-header {
|
||||
color: white;
|
||||
background: linear-gradient(270deg, var(--color2) 100%, var(--color3) 100%, var(--color4) 100%, var(--color5) 100%) !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.background-blue {
|
||||
background-color: #0d89d1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user