mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Send many alterations.
This commit is contained in:
Generated
+116
@@ -0,0 +1,116 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
Generated
+35
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenRepo" />
|
||||
<option name="name" value="MavenRepo" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://dl.bintray.com/ionic-team/capacitor" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+21
-6
@@ -527,6 +527,12 @@
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
|
||||
"dev": true
|
||||
},
|
||||
"inquirer": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz",
|
||||
@@ -2027,9 +2033,12 @@
|
||||
}
|
||||
},
|
||||
"@ionic-native/camera": {
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@ionic-native/camera/-/camera-4.20.0.tgz",
|
||||
"integrity": "sha512-WnfQq8RV+7ezOqpCyNx9Xgpy7Y8TZehGLSxZXnCqCbFZ72CpC70Q5AV/eTIRGiKkotx2U6nUopYF+gTj1cunFA=="
|
||||
"version": "5.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@ionic-native/camera/-/camera-5.30.0.tgz",
|
||||
"integrity": "sha512-eIEhr7dRsjTyw/XIxF+TPx4A4feFmFE4cZhg5qYXUdI+eBymX6iii/J47OjsFg9ulCcrNUXg54iL5LqmhkeG5A==",
|
||||
"requires": {
|
||||
"@types/cordova": "^0.0.34"
|
||||
}
|
||||
},
|
||||
"@ionic-native/core": {
|
||||
"version": "5.27.0",
|
||||
@@ -2930,6 +2939,12 @@
|
||||
"semver-intersect": "1.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
|
||||
"dev": true
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
@@ -7943,9 +7958,9 @@
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
|
||||
"version": "1.3.7",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz",
|
||||
"integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ=="
|
||||
},
|
||||
"inquirer": {
|
||||
"version": "6.3.1",
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
"@fullcalendar/angular": "^5.3.0",
|
||||
"@fullcalendar/daygrid": "^5.3.0",
|
||||
"@fullcalendar/interaction": "^5.3.0",
|
||||
"@ionic-native/camera": "^4.20.0",
|
||||
"@ionic-native/camera": "^5.30.0",
|
||||
"@ionic-native/core": "^5.0.7",
|
||||
"@ionic-native/file": "^5.30.0",
|
||||
"@ionic-native/file-path": "^5.30.0",
|
||||
|
||||
@@ -16,6 +16,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { File } from '@ionic-native/File/ngx';
|
||||
import { WebView } from '@ionic-native/ionic-webview/ngx';
|
||||
import { FilePath } from '@ionic-native/file-path/ngx';
|
||||
import { Camera } from '@ionic-native/camera/ngx';
|
||||
|
||||
import { IonicStorageModule } from '@ionic/storage';
|
||||
|
||||
@@ -34,6 +35,7 @@ import { IonicStorageModule } from '@ionic/storage';
|
||||
HttpClientModule,
|
||||
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
|
||||
InAppBrowser,
|
||||
Camera,
|
||||
File,
|
||||
WebView,
|
||||
FilePath,
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export class Photo {
|
||||
fileName: string;
|
||||
webviewPath: string;
|
||||
fileFormat: string;
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
/* import { Image } from './image'; */
|
||||
|
||||
export class Publication{
|
||||
publicationId:string;
|
||||
processId:string;
|
||||
title: string;
|
||||
description: string;
|
||||
date: Date;
|
||||
DocumentId:string;
|
||||
ProcessId:string;
|
||||
Title: string;
|
||||
Message: string;
|
||||
DatePublication: Date;
|
||||
/* image: Image; */
|
||||
imageTitle: string;
|
||||
imageUrl:string;
|
||||
imageFormat: string;
|
||||
OriginalFileName: string;
|
||||
FileBase64:string;
|
||||
FileExtension: string;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ export class PublicationFolder {
|
||||
ProcessId: number;
|
||||
Description: string;
|
||||
Detail: string;
|
||||
DateBegin: Date;
|
||||
DateBegin: string;
|
||||
DateEnd: string;
|
||||
ActionType: string;
|
||||
}
|
||||
@@ -46,6 +46,25 @@
|
||||
<div class="ion-input-class">
|
||||
<ion-datetime
|
||||
[(ngModel)]="folder.DateBegin"
|
||||
placeholder="Início"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022">
|
||||
</ion-datetime>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-datetime
|
||||
[(ngModel)]="folder.DateEnd"
|
||||
placeholder="Fim"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
@@ -63,7 +82,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-textarea-class">
|
||||
<ion-textarea [(ngModel)]="folder.Detail" rows="3" cols="20" placeholder="Descrição da ação..."></ion-textarea>
|
||||
<ion-textarea [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da ação..."></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,7 @@ export class NewActionPage implements OnInit {
|
||||
Description: this.folder.Description,
|
||||
Detail: this.folder.Detail,
|
||||
DateBegin: this.folder.DateBegin,
|
||||
DateEnd: this.folder.DateEnd,
|
||||
ActionType: this.segment,
|
||||
}
|
||||
console.log(this.folder);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="publicationType!='1'" class="ion-item-container">
|
||||
<ion-input [(ngModel)]="pub.title" name="title" ngDefaultControl placeholder="Título" ></ion-input>
|
||||
<ion-input [(ngModel)]="pub.Title" name="title" ngDefaultControl placeholder="Título" ></ion-input>
|
||||
</div>
|
||||
|
||||
<div *ngIf="publicationType!='1'" class="container-div">
|
||||
@@ -32,24 +32,24 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-textarea-class">
|
||||
<ion-textarea [(ngModel)]="pub.description" name="description" ngDefaultControl rows="6" cols="20" placeholder="Corpo de texto..."></ion-textarea>
|
||||
<ion-textarea [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto..."></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="publication" class="ion-item-container-no-border">
|
||||
<div *ngIf="photoService.photos.length > 0" class="ion-item-container-no-border">
|
||||
<ion-label class="attached-title">Fotografia Anexada</ion-label>
|
||||
<ion-item lines="none">
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-img [(ngModel)]="pub.imageUrl" name="image" ngDefaultControl [src]="pub.imageUrl"></ion-img>
|
||||
<ion-img [(ngModel)]="pub.FileBase64" name="image" ngDefaultControl [src]="'data:image/png;base64,'+this.photoService.photos[0].webviewPath"></ion-img>
|
||||
</ion-thumbnail>
|
||||
<!-- <ion-thumbnail *ngIf="!publication" slot="start">
|
||||
<ion-img [(ngModel)]="publication.imageUrl" [src]="guestPicture"></ion-img>
|
||||
</ion-thumbnail> -->
|
||||
<ion-label>
|
||||
<p>Nome da foto</p>
|
||||
<p>{{photoService.photos[0].fileName}}</p>
|
||||
<p>size</p>
|
||||
</ion-label>
|
||||
<ion-icon name="close"></ion-icon>
|
||||
<ion-icon (click)="clear()" name="close"></ion-icon>
|
||||
</ion-item>
|
||||
|
||||
<!-- <ion-thumbnail>
|
||||
@@ -63,13 +63,13 @@
|
||||
<ion-icon src="assets/images/icons-add-photo.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-button (click)="takePicture()">Tirar Fotografia</ion-button>
|
||||
<ion-label (click)="takePictureCodova()">Tirar Fotografia</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="ion-item-container-no-border">
|
||||
<ion-label (click)="getGallery()">
|
||||
<div hidden class="ion-item-container-no-border">
|
||||
<ion-label (click)="takePictureCodova()">
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-add-photos.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -79,8 +79,10 @@
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="footer-toolbar">
|
||||
<ion-buttons slot="start">
|
||||
@@ -90,7 +92,7 @@
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>Criar</ion-label>
|
||||
<ion-label>Gravar</ion-label>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { GalleryPage } from '../gallery/gallery.page';
|
||||
/* import { Camera } from '@ionic-native/camera/ngx'; */
|
||||
|
||||
import {Plugins, CameraResultType, CameraSource} from '@capacitor/core';
|
||||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { Image } from 'src/app/models/image';
|
||||
/* import { Camera } from '@ionic-native/camera/ngx'; */
|
||||
import { ThrowStmt } from '@angular/compiler';
|
||||
import { PhotoService } from 'src/app/services/photo.service';
|
||||
|
||||
/* const { Camera } = Plugins; */
|
||||
const { Camera } = Plugins;
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
@@ -34,8 +34,11 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
guestPicture:any;
|
||||
|
||||
capturedImage:any;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
public photoService: PhotoService,
|
||||
private navParams: NavParams,
|
||||
/* private camera: Camera, */
|
||||
private sanitizer: DomSanitizer,
|
||||
@@ -48,8 +51,18 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.setTitle();
|
||||
this.clear();
|
||||
|
||||
}
|
||||
takePictureCodova(){
|
||||
this.photoService.takePicture();
|
||||
}
|
||||
|
||||
/* takePictureCapacitor() {
|
||||
this.photoService.addNewToGallery();
|
||||
this.pub.FileBase64 = this.photoService.photos[0].webviewPath;
|
||||
console.log(this.pub.FileBase64);
|
||||
} */
|
||||
|
||||
|
||||
/* async takePictures() {
|
||||
@@ -72,7 +85,8 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
save(){
|
||||
async save(){
|
||||
console.log(this.pub.FileBase64);
|
||||
if(this.publicationType == '3'){
|
||||
this.image = {
|
||||
title: this.image.title,
|
||||
@@ -80,41 +94,42 @@ export class NewPublicationPage implements OnInit {
|
||||
format: 'png'
|
||||
}
|
||||
this.publication = {
|
||||
publicationId:this.publication.publicationId,
|
||||
processId:this.publication.processId,
|
||||
title: this.publication.title,
|
||||
description: this.publication.description,
|
||||
date: this.publication.date,
|
||||
/* image: this.image, */
|
||||
imageTitle: '',
|
||||
imageUrl: this.publication.imageUrl,
|
||||
imageFormat: 'png',
|
||||
DocumentId:this.publication.DocumentId,
|
||||
ProcessId:this.publication.ProcessId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: this.publication.DatePublication,
|
||||
OriginalFileName: '',
|
||||
FileBase64: this.publication.FileBase64,
|
||||
FileExtension: 'jpg',
|
||||
}
|
||||
console.log('Edit');
|
||||
console.log(this.publication);
|
||||
this.publications.UpdatePublication(this.publication.processId, this.publication);
|
||||
this.publications.UpdatePublication(this.publication.ProcessId, this.publication);
|
||||
this.close();
|
||||
}
|
||||
else{
|
||||
|
||||
this.image = {
|
||||
title: this.image.title,
|
||||
url: this.image.url,
|
||||
format: 'png'
|
||||
}
|
||||
this.publication = {
|
||||
publicationId:null,
|
||||
processId:this.folderId,
|
||||
title: this.pub.title,
|
||||
description: this.pub.description,
|
||||
date: new Date(),
|
||||
/* image: this.image, */
|
||||
imageTitle: '',
|
||||
imageUrl: '',
|
||||
imageFormat: 'jpg',
|
||||
DocumentId:null,
|
||||
ProcessId:this.folderId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: new Date(),
|
||||
OriginalFileName: 'foto',
|
||||
FileBase64: this.photoService.photos[0].webviewPath,
|
||||
FileExtension: 'jpg',
|
||||
}
|
||||
|
||||
console.log('Create');
|
||||
console.log(this.publication);
|
||||
this.publications.CreatePublication(this.folderId, this.publication);
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,6 +137,9 @@ export class NewPublicationPage implements OnInit {
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
clear(){
|
||||
this.photoService.photos = [];
|
||||
}
|
||||
setTitle(){
|
||||
if(this.publicationType == '1'){
|
||||
this.publicationTitle = 'Nova Publicação Rápida';
|
||||
@@ -135,7 +153,7 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async openGallery() {
|
||||
/* async openGallery() {
|
||||
const modal = await this.modalController.create({
|
||||
component: GalleryPage,
|
||||
componentProps:{
|
||||
@@ -145,7 +163,7 @@ export class NewPublicationPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
} */
|
||||
|
||||
async takePicture(){
|
||||
const image = await Plugins.Camera.getPhoto({
|
||||
@@ -154,7 +172,8 @@ export class NewPublicationPage implements OnInit {
|
||||
resultType: CameraResultType.DataUrl,
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
|
||||
console.log(image);
|
||||
|
||||
this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl));
|
||||
}
|
||||
openCamera(){
|
||||
@@ -180,5 +199,6 @@ export class NewPublicationPage implements OnInit {
|
||||
console.log(e);
|
||||
}); */
|
||||
}
|
||||
Add
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
<div class="item-content">
|
||||
<ion-label>
|
||||
<p class="item-content-date">{{viagem.DateBegin}}</p>
|
||||
<p class="item-content-date">De {{viagem.DateBegin}} a {{viagem.DateEnd}}</p>
|
||||
<p class="item-content-title">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail">{{viagem.Detail}}</p>
|
||||
</ion-label>
|
||||
|
||||
@@ -55,6 +55,7 @@ ion-toolbar{
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
}
|
||||
.div-title{
|
||||
padding: 0!important;
|
||||
@@ -73,7 +74,7 @@ ion-toolbar{
|
||||
width: 360px;
|
||||
padding: 0 0px 0 0px;
|
||||
overflow: auto;
|
||||
margin: 0 auto;
|
||||
margin: 0px auto;
|
||||
}
|
||||
.item-icon{
|
||||
margin-top: 28px;
|
||||
|
||||
@@ -14,12 +14,14 @@ import { ViewPublicationsPage } from './view-publications/view-publications.page
|
||||
})
|
||||
export class PublicationsPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
publicationFolder: PublicationFolder;
|
||||
|
||||
publicationFolderList: PublicationFolder[];
|
||||
publicationsEventFolderList: PublicationFolder[];
|
||||
publicationsTravelFolderList: PublicationFolder[];
|
||||
|
||||
theDate:any;
|
||||
theEndDate:any;
|
||||
customDate:any;
|
||||
months: string[];
|
||||
days:string[];
|
||||
@@ -54,11 +56,26 @@ export class PublicationsPage implements OnInit {
|
||||
this.publications.GetPublicationFolderList().subscribe(res=>{
|
||||
this.publicationFolderList = res;
|
||||
console.log(res);
|
||||
|
||||
this.publicationsEventFolderList = res.filter(data => data.ActionType == "Evento");
|
||||
this.publicationsTravelFolderList = res.filter(data => data.ActionType == "Viagem");
|
||||
console.log(this.publicationsTravelFolderList);
|
||||
|
||||
this.publicationsEventFolderList = new Array();
|
||||
this.publicationsTravelFolderList = new Array();
|
||||
res.forEach(data => {
|
||||
this.theDate = new Date(data.DateBegin);
|
||||
this.theEndDate = new Date(data.DateEnd);
|
||||
let folder: PublicationFolder = {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
DateBegin: this.theDate.getDate() +" de " + ( this.months[this.theDate.getMonth()])+" de " +this.theDate.getFullYear(),
|
||||
DateEnd: this.theEndDate.getDate() +" de " + ( this.months[this.theEndDate.getMonth()])+" de " +this.theEndDate.getFullYear(),
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
if(data.ActionType == "Evento"){
|
||||
this.publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else{
|
||||
this.publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -76,7 +93,7 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
async viewPublications(folder: PublicationFolder) {
|
||||
let item = this.publicationFolderList;
|
||||
/* let item = this.publicationFolderList; */
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewPublicationsPage,
|
||||
componentProps:{
|
||||
|
||||
+8
-8
@@ -17,29 +17,29 @@
|
||||
<ion-content>
|
||||
<div class="content-top"></div>
|
||||
<div class="content-container">
|
||||
<div *ngIf="publication.title != ''">
|
||||
<div *ngIf="publication.Title != ''">
|
||||
<div class="title-content">
|
||||
<div class="back-icon">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<ion-label class="title"> {{publication.title}}</ion-label>
|
||||
<p class="post-data">{{publication.date}}</p>
|
||||
<ion-label class="title"> {{publication.Title}}</ion-label>
|
||||
<p class="post-data">{{publication.DatePublication | date: 'dd-MM-yy | h:mm'}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-item">
|
||||
<div *ngIf="publication.imageUrl.length > 30" class="post-img">
|
||||
<img src="{{publication.imageUrl}}" alt="image" tappable (click)="openPreview(publication.imageUrl)">
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
<img src="{{publication.FileBase64}}" alt="image" tappable (click)="openPreview(publication.FileBase64)">
|
||||
</div>
|
||||
<div *ngIf="publication.imageUrl.length < 30" class="post-img">
|
||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||
</div>
|
||||
<div class="post-description">
|
||||
<p>{{publication.description}}</p>
|
||||
<p>{{publication.Message}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="publication.title == ''">
|
||||
<div *ngIf="publication.Title == ''">
|
||||
<div class="title-content">
|
||||
<div class="back-icon">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
|
||||
+23
-18
@@ -24,20 +24,20 @@ export class PublicationDetailPage implements OnInit {
|
||||
this.publicationId = this.navParams.get('publicationId');
|
||||
this.folderId = this.navParams.get('folderIdId');
|
||||
this.publication = {
|
||||
publicationId: '',
|
||||
processId:'',
|
||||
title:'',
|
||||
description: '',
|
||||
DocumentId: '',
|
||||
ProcessId:'',
|
||||
Title:'',
|
||||
Message: '',
|
||||
/* image: null, */
|
||||
date: null,
|
||||
imageUrl: '',
|
||||
imageTitle: '',
|
||||
imageFormat: '',
|
||||
DatePublication: null,
|
||||
FileBase64: '',
|
||||
OriginalFileName: '',
|
||||
FileExtension: '',
|
||||
};
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.publication.imageUrl);
|
||||
console.log(this.publication.FileBase64);
|
||||
|
||||
this.getPublicationDetail();
|
||||
}
|
||||
@@ -50,15 +50,15 @@ export class PublicationDetailPage implements OnInit {
|
||||
format: 'png'
|
||||
}
|
||||
this.publication = {
|
||||
publicationId: res.DocumentId,
|
||||
processId:res.ProcessId,
|
||||
title:res.Title,
|
||||
description: res.Message,
|
||||
date: res.DatePublication,
|
||||
DocumentId: res.DocumentId,
|
||||
ProcessId:res.ProcessId,
|
||||
Title:res.Title,
|
||||
Message: res.Message,
|
||||
DatePublication: res.DatePublication,
|
||||
/* image: itemImage, */
|
||||
imageUrl: "data:image/jpg;base64," + res.FileBase64,
|
||||
imageTitle: '',
|
||||
imageFormat: '',
|
||||
FileBase64: "data:image/jpg;base64," + res.FileBase64,
|
||||
OriginalFileName: '',
|
||||
FileExtension: '',
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -68,7 +68,12 @@ export class PublicationDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
deletePost(){
|
||||
|
||||
console.log(this.folderId);
|
||||
console.log(this.publicationId);
|
||||
|
||||
|
||||
this.publications.DeletePublication(this.folderId, this.publicationId);
|
||||
this.close();
|
||||
}
|
||||
|
||||
async editPost(publicationType:any) {
|
||||
|
||||
@@ -15,6 +15,12 @@
|
||||
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<div class="content-top"></div>
|
||||
<div class="content-container">
|
||||
<div class="title-content">
|
||||
@@ -35,22 +41,22 @@
|
||||
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
|
||||
<div class="post-item"
|
||||
*ngFor="let publication of publicationList"
|
||||
(click)="viewPublicationDetail(publication.processId,publication.publicationId)">
|
||||
<div *ngIf="publication.imageUrl.length > 30" class="post-img">
|
||||
<img src="{{publication.imageUrl}}" alt="image">
|
||||
(click)="viewPublicationDetail(publication.ProcessId,publication.DocumentId)">
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
<img src="{{publication.FileBase64}}" alt="image">
|
||||
</div>
|
||||
<div *ngIf="publication.imageUrl.length < 30" class="post-img">
|
||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||
</div>
|
||||
<div class="post-content">
|
||||
<div class="post-title-time">
|
||||
<div class="post-title">
|
||||
<ion-label>{{publication.title}}</ion-label>
|
||||
<ion-label>{{publication.Title}}</ion-label>
|
||||
</div>
|
||||
<div class="post-data">{{publication.date}}</div>
|
||||
<div class="post-data">{{publication.DatePublication | date: 'dd-MM-yy | h:mm'}}</div>
|
||||
</div>
|
||||
<div class="post-description">
|
||||
<p>{{publication.description}}</p>
|
||||
<p>{{publication.Message}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -125,13 +125,13 @@
|
||||
margin-top: 5px;
|
||||
}
|
||||
.post-title{
|
||||
width: 80%;
|
||||
width: 60%;
|
||||
float: left;
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
}
|
||||
.post-data{
|
||||
width: 20%;
|
||||
width: 40%;
|
||||
float: left;
|
||||
font-size: 13px;
|
||||
color: #797979;
|
||||
|
||||
@@ -12,6 +12,8 @@ import { PublicationDetailPage } from './publication-detail/publication-detail.p
|
||||
styleUrls: ['./view-publications.page.scss'],
|
||||
})
|
||||
export class ViewPublicationsPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
|
||||
publicationList: Publication[];
|
||||
item: PublicationFolder;
|
||||
|
||||
@@ -27,6 +29,13 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.getPublications()
|
||||
/* console.log(this.item); */
|
||||
}
|
||||
doRefresh(event) {
|
||||
this.getPublications()
|
||||
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
@@ -43,15 +52,15 @@ export class ViewPublicationsPage implements OnInit {
|
||||
format: 'png'
|
||||
}
|
||||
let item: Publication = {
|
||||
"publicationId":element.DocumentId,
|
||||
"processId":element.ProcessId,
|
||||
"title":element.Title,
|
||||
"description": element.Message,
|
||||
"date": element.DatePublication,
|
||||
"DocumentId":element.DocumentId,
|
||||
"ProcessId":element.ProcessId,
|
||||
"Title":element.Title,
|
||||
"Message": element.Message,
|
||||
"DatePublication": element.DatePublication,
|
||||
/* image:itemImage, */
|
||||
"imageUrl": "data:image/jpg;base64," + element.FileBase64,
|
||||
"imageTitle": '',
|
||||
"imageFormat": '',
|
||||
"FileBase64": "data:image/jpg;base64," + element.FileBase64,
|
||||
"OriginalFileName": '',
|
||||
"FileExtension": '',
|
||||
}
|
||||
this.publicationList.push(item);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PhotoService } from './photo.service';
|
||||
|
||||
describe('PhotoService', () => {
|
||||
let service: PhotoService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(PhotoService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Plugins, CameraResultType, Capacitor, FilesystemDirectory, CameraPhoto, CameraSource } from '@capacitor/core';
|
||||
import { Photo } from '../models/photo';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||
|
||||
/* const { Camera, Filesystem, Storage } = Plugins; */
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PhotoService {
|
||||
public photos: Photo[] = [];
|
||||
private PHOTO_STORAGE: string = "photos";
|
||||
private platform: Platform;
|
||||
|
||||
constructor(platform: Platform,
|
||||
private camera:Camera) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
async takePicture(){
|
||||
const options: CameraOptions = {
|
||||
quality: 100,
|
||||
destinationType: this.camera.DestinationType.FILE_URI,
|
||||
encodingType: this.camera.EncodingType.JPEG,
|
||||
mediaType: this.camera.MediaType.PICTURE
|
||||
}
|
||||
|
||||
this.camera.getPicture(options).then((imageData) => {
|
||||
// imageData is either a base64 encoded string or a file URI
|
||||
// If it's base64 (DATA_URL):
|
||||
let base64Image = 'data:image/jpeg;base64,' + imageData;
|
||||
return base64Image;
|
||||
}, (err) => {
|
||||
// Handle error
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* async addNewToGallery() {
|
||||
// Take a photo using Capacitor
|
||||
const capturedPhoto = await Camera.getPhoto({
|
||||
resultType: CameraResultType.Base64,
|
||||
source: CameraSource.Camera,
|
||||
quality: 90,
|
||||
width: 1080,
|
||||
height: 720,
|
||||
});
|
||||
|
||||
this.photos.unshift({
|
||||
fileName: new Date().getTime() + '.png',
|
||||
webviewPath: capturedPhoto.base64String,
|
||||
fileFormat: capturedPhoto.format,
|
||||
});
|
||||
|
||||
console.log(capturedPhoto);
|
||||
|
||||
|
||||
console.log(this.photos[0]);
|
||||
|
||||
} */
|
||||
|
||||
}
|
||||
@@ -110,7 +110,7 @@ export class PublicationsService {
|
||||
params = params.set("folderId", folderId);
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
/* params: params */
|
||||
};
|
||||
return this.http.post<any>(`${geturl}`, body, options).toPromise().then(res =>{
|
||||
console.log(res);
|
||||
@@ -123,13 +123,29 @@ export class PublicationsService {
|
||||
params = params.set("folderId", folderId);
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
/* params: params */
|
||||
};
|
||||
return this.http.put<any>(`${geturl}`, body, options).toPromise().then(res =>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
DeletePublication(folderId:any,publicationId:any){
|
||||
const geturl = environment.apiURL + 'presidentialActions/'+folderId+'/posts/'+publicationId;
|
||||
let params = new HttpParams();
|
||||
params = params.set("folderId", folderId);
|
||||
params = params.set("id", publicationId);
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
/* params: params */
|
||||
};
|
||||
return this.http.delete(`${geturl}`, options).toPromise().then(res =>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user