mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon>
|
<ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom">
|
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom" >
|
||||||
|
|
||||||
<ion-select class="d-block d-md-none" [(ngModel)]="postData.Priority" interface="action-sheet" Cancel-text="Cancelar" required>
|
<ion-select class="d-block d-md-none" [(ngModel)]="postData.Priority" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||||
<ion-select-option value="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</ion-select-option>
|
<ion-select-option value="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</ion-select-option>
|
||||||
@@ -36,12 +36,12 @@
|
|||||||
<ion-select-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</ion-select-option>
|
<ion-select-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</ion-select-option>
|
||||||
</ion-select>
|
</ion-select>
|
||||||
|
|
||||||
<mat-form-field appearance="fill" class="width-100 d-none d-md-block" floatLabel="never">
|
<mat-form-field appearance="none" class="width-100 d-none d-md-block" floatLabel="never">
|
||||||
<mat-select placeholder="Prazo*" [(value)]="postData.Priority">
|
<mat-select placeholder="Prazo*" [(ngModel)]="postData.Priority">
|
||||||
<mat-option [value]="99999861">Normal</mat-option>
|
<mat-option value="99999861">Normal</mat-option>
|
||||||
<mat-option [value]="99999862">Urgente</mat-option>
|
<mat-option value="99999862">Urgente</mat-option>
|
||||||
<mat-option [value]="99999863">Muito Urgente</mat-option>
|
<mat-option value="99999863">Muito Urgente</mat-option>
|
||||||
<mat-option [value]="99999864">Urgentíssimo</mat-option>
|
<mat-option value="99999864">Urgentíssimo</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
class="width-100 d-block"
|
class="width-100 d-block"
|
||||||
appearance="none">
|
appearance="none">
|
||||||
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
|
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
|
||||||
<mat-option *ngFor="let type of subjectTypes" [value]="type.Code">{{type.Description}}</mat-option>
|
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ export class NewEventPage implements OnInit {
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close(){
|
close(){
|
||||||
this.modalController.dismiss();
|
this.modalController.dismiss();
|
||||||
}
|
}
|
||||||
@@ -189,8 +190,6 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
if(this.Form.invalid) return false
|
if(this.Form.invalid) return false
|
||||||
|
|
||||||
console.log('passed')
|
|
||||||
|
|
||||||
if(this.documents.length >= 0) {
|
if(this.documents.length >= 0) {
|
||||||
this.postEvent.HasAttachments = true;
|
this.postEvent.HasAttachments = true;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-8
@@ -65,12 +65,12 @@
|
|||||||
<ion-select-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</ion-select-option>
|
<ion-select-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</ion-select-option>
|
||||||
</ion-select>
|
</ion-select>
|
||||||
|
|
||||||
<mat-form-field appearance="fill" class="width-100 d-none d-md-block" appearance="none">
|
<mat-form-field class="width-100 d-none d-md-block" appearance="none">
|
||||||
<mat-select placeholder="Prazo*" [(ngModel)]="postData.Priority">
|
<mat-select [(ngModel)]="postData.Priority">
|
||||||
<mat-option [value]="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</mat-option>
|
<mat-option value="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</mat-option>
|
||||||
<mat-option [value]="99999862"><b>Urgente</b> (2 dias para a execução da tarefa)</mat-option>
|
<mat-option value="99999862"><b>Urgente</b> (2 dias para a execução da tarefa)</mat-option>
|
||||||
<mat-option [value]="99999863"><b>Muito Urgente</b> (1 dia para a execução da tarefa)</mat-option>
|
<mat-option value="99999863"><b>Muito Urgente</b> (1 dia para a execução da tarefa)</mat-option>
|
||||||
<mat-option [value]="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</mat-option>
|
<mat-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
class="width-100 d-block"
|
class="width-100 d-block"
|
||||||
appearance="none">
|
appearance="none">
|
||||||
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
|
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
|
||||||
<mat-option *ngFor="let type of subjectTypes" [value]="type.Code">{{type.Description}}</mat-option>
|
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
@@ -128,7 +128,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
|
|||||||
+4
-4
@@ -224,16 +224,16 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(this.postData.Priority=='99999861'){
|
if(this.postData.Priority=='99999861') {
|
||||||
this.dispatchFolder.DeadlineType = 'Normal';
|
this.dispatchFolder.DeadlineType = 'Normal';
|
||||||
}
|
}
|
||||||
else if(this.postData.Priority=='99999862'){
|
else if(this.postData.Priority=='99999862') {
|
||||||
this.dispatchFolder.DeadlineType = 'Urgente';
|
this.dispatchFolder.DeadlineType = 'Urgente';
|
||||||
}
|
}
|
||||||
else if(this.postData.Priority=='99999863'){
|
else if(this.postData.Priority=='99999863') {
|
||||||
this.dispatchFolder.DeadlineType = 'Muito Urgente';
|
this.dispatchFolder.DeadlineType = 'Muito Urgente';
|
||||||
}
|
}
|
||||||
else if(this.postData.Priority=='99999864'){
|
else if(this.postData.Priority=='99999864') {
|
||||||
this.dispatchFolder.DeadlineType = 'Urgentíssimo';
|
this.dispatchFolder.DeadlineType = 'Urgentíssimo';
|
||||||
}
|
}
|
||||||
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ export class ExpedientesPrPage implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.router.events.forEach((event) => {
|
this.router.events.forEach((event) => {
|
||||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||||
this.LoadList();
|
this.refreshing();
|
||||||
console.log('not run');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -107,6 +106,12 @@ export class ExpedientesPrPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshing() {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.LoadList();
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
|
||||||
doRefresh(event) {
|
doRefresh(event) {
|
||||||
this.LoadList();
|
this.LoadList();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -8,12 +8,40 @@ import { NewActionPageRoutingModule } from './new-action-routing.module';
|
|||||||
|
|
||||||
import { NewActionPage } from './new-action.page';
|
import { NewActionPage } from './new-action.page';
|
||||||
|
|
||||||
|
import { MatNativeDateModule } from '@angular/material/core';
|
||||||
|
import {
|
||||||
|
NgxMatDatetimePickerModule,
|
||||||
|
NgxMatNativeDateModule,
|
||||||
|
NgxMatTimepickerModule
|
||||||
|
} from '@angular-material-components/datetime-picker';
|
||||||
|
import { ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatSelectModule } from '@angular/material/select';
|
||||||
|
import { NgxMatMomentModule } from '@angular-material-components/moment-adapter';
|
||||||
|
import { MAT_DATE_LOCALE } from '@angular/material/core';
|
||||||
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||||
|
import { MatInputModule } from '@angular/material/input';
|
||||||
|
import { MatDialogModule } from '@angular/material/dialog';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
NewActionPageRoutingModule
|
NewActionPageRoutingModule,
|
||||||
|
// Angular material
|
||||||
|
MatDatepickerModule,
|
||||||
|
MatInputModule,
|
||||||
|
MatNativeDateModule,
|
||||||
|
NgxMatDatetimePickerModule,
|
||||||
|
NgxMatTimepickerModule,
|
||||||
|
NgxMatNativeDateModule,
|
||||||
|
NgxMatMomentModule,
|
||||||
|
MatSelectModule,
|
||||||
|
MatButtonModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
MatDialogModule,
|
||||||
],
|
],
|
||||||
exports: [NewActionPage],
|
exports: [NewActionPage],
|
||||||
declarations: [NewActionPage]
|
declarations: [NewActionPage]
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ion-item-container">
|
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||||
<ion-input [(ngModel)]="folder.Description" placeholder="Assunto" ></ion-input>
|
<ion-input [(ngModel)]="folder.Description" placeholder="Assunto" ></ion-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-datetime
|
<ion-datetime
|
||||||
[(ngModel)]="folder.DateBegin"
|
[(ngModel)]="folder.DateBegin"
|
||||||
|
class="d-block d-md-none"
|
||||||
placeholder="Início"
|
placeholder="Início"
|
||||||
displayFormat="D MMM YYYY H:mm"
|
displayFormat="D MMM YYYY H:mm"
|
||||||
minuteValues="0,15,30,45"
|
minuteValues="0,15,30,45"
|
||||||
@@ -37,6 +38,25 @@
|
|||||||
min="2018"
|
min="2018"
|
||||||
max="2025">
|
max="2025">
|
||||||
</ion-datetime>
|
</ion-datetime>
|
||||||
|
|
||||||
|
<mat-form-field class="date-hour-picker d-none d-md-block">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||||
|
placeholder="Choose a date"
|
||||||
|
[formControl]="dateControlStart"
|
||||||
|
[min]="minDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #picker1
|
||||||
|
[showSpinners]="showSpinners"
|
||||||
|
[showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
|
[stepSecond]="stepSecond"
|
||||||
|
[touchUi]="touchUi"
|
||||||
|
>
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,6 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-datetime
|
<ion-datetime
|
||||||
|
class="d-block d-md-none"
|
||||||
[(ngModel)]="folder.DateEnd"
|
[(ngModel)]="folder.DateEnd"
|
||||||
placeholder="Fim"
|
placeholder="Fim"
|
||||||
displayFormat="D MMM YYYY H:mm"
|
displayFormat="D MMM YYYY H:mm"
|
||||||
@@ -56,6 +77,25 @@
|
|||||||
min="2018"
|
min="2018"
|
||||||
max="2025">
|
max="2025">
|
||||||
</ion-datetime>
|
</ion-datetime>
|
||||||
|
|
||||||
|
<mat-form-field class="date-hour-picker d-none d-md-block">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="fim"
|
||||||
|
placeholder="Choose a date"
|
||||||
|
[formControl]="dateControlEnd"
|
||||||
|
[min]="endMinDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #fim
|
||||||
|
[showSpinners]="showSpinners"
|
||||||
|
[showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
|
[stepSecond]="stepSecond"
|
||||||
|
[touchUi]="touchUi"
|
||||||
|
>
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,29 +1,76 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { AnimationController, ModalController } from '@ionic/angular';
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
import * as moment from 'moment';
|
||||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||||
import { PublicationsService } from 'src/app/services/publications.service';
|
import { PublicationsService } from 'src/app/services/publications.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||||
|
|
||||||
|
|
||||||
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
|
parse: {
|
||||||
|
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||||
|
},
|
||||||
|
display: {
|
||||||
|
dateInput: "DD MMM YYYY H:mm",
|
||||||
|
monthYearLabel: "MMM YYYY",
|
||||||
|
dateA11yLabel: "LL",
|
||||||
|
monthYearA11yLabel: "MMMM YYYY"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-new-action',
|
selector: 'app-new-action',
|
||||||
templateUrl: './new-action.page.html',
|
templateUrl: './new-action.page.html',
|
||||||
styleUrls: ['./new-action.page.scss'],
|
styleUrls: ['./new-action.page.scss'],
|
||||||
|
providers: [
|
||||||
|
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
||||||
|
]
|
||||||
})
|
})
|
||||||
export class NewActionPage implements OnInit {
|
export class NewActionPage implements OnInit {
|
||||||
|
|
||||||
folder: PublicationFolder;
|
folder: PublicationFolder;
|
||||||
segment:string;
|
segment:string;
|
||||||
|
|
||||||
|
Form: FormGroup;
|
||||||
|
validateFrom = false
|
||||||
|
|
||||||
|
public date: any;
|
||||||
|
public disabled = false;
|
||||||
|
public showSpinners = true;
|
||||||
|
public showSeconds = false;
|
||||||
|
public touchUi = false;
|
||||||
|
public enableMeridian = false;
|
||||||
|
public minDate = new Date().toISOString().slice(0,10)
|
||||||
|
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||||
|
public stepHour = 1;
|
||||||
|
public stepMinute = 5;
|
||||||
|
public stepSecond = 5;
|
||||||
|
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||||
|
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||||
|
|
||||||
|
showLoader = false
|
||||||
|
|
||||||
|
get dateStart () {
|
||||||
|
return this.dateControlStart.value
|
||||||
|
}
|
||||||
|
|
||||||
|
get dateEnd () {
|
||||||
|
return this.dateControlEnd.value
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private publication: PublicationsService,
|
private publication: PublicationsService,
|
||||||
private animationController: AnimationController,
|
|
||||||
private toastService: ToastService
|
private toastService: ToastService
|
||||||
|
|
||||||
) {
|
) {
|
||||||
this.folder = new PublicationFolder();
|
this.folder = new PublicationFolder();
|
||||||
|
|
||||||
|
this.dateControlStart = new FormControl(moment(new Date()));
|
||||||
|
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -34,7 +81,39 @@ export class NewActionPage implements OnInit {
|
|||||||
console.log(ev.detail.value);
|
console.log(ev.detail.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
async save(){
|
get dateValid() {
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []
|
||||||
|
} else {
|
||||||
|
return ['ok']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
runValidation() {
|
||||||
|
this.validateFrom = true
|
||||||
|
}
|
||||||
|
|
||||||
|
injectValidation() {
|
||||||
|
|
||||||
|
this.Form = new FormGroup({
|
||||||
|
Subject: new FormControl(this.folder.Description, [
|
||||||
|
Validators.required,
|
||||||
|
// Validators.minLength(4)
|
||||||
|
]),
|
||||||
|
Date: new FormControl(this.dateValid, [
|
||||||
|
Validators.required
|
||||||
|
]),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async save() {
|
||||||
|
|
||||||
|
this.injectValidation()
|
||||||
|
this.runValidation()
|
||||||
|
|
||||||
|
if(this.Form.invalid) return false
|
||||||
|
|
||||||
this.folder = {
|
this.folder = {
|
||||||
ProcessId: null,
|
ProcessId: null,
|
||||||
Description: this.folder.Description,
|
Description: this.folder.Description,
|
||||||
@@ -43,7 +122,6 @@ export class NewActionPage implements OnInit {
|
|||||||
DateEnd: this.folder.DateEnd,
|
DateEnd: this.folder.DateEnd,
|
||||||
ActionType: this.segment,
|
ActionType: this.segment,
|
||||||
}
|
}
|
||||||
console.log(this.folder);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.publication.CreatePublicationFolder(this.folder).toPromise();
|
await this.publication.CreatePublicationFolder(this.folder).toPromise();
|
||||||
@@ -54,12 +132,9 @@ export class NewActionPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close(){
|
close(){
|
||||||
this.modalController.dismiss();
|
this.modalController.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,19 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
import { ModalController, NavParams } from '@ionic/angular';
|
||||||
import { GalleryPage } from '../gallery/gallery.page';
|
|
||||||
|
|
||||||
/* import {Plugins, CameraResultType, CameraSource} from '@capacitor/core'; */
|
/* import {Plugins, CameraResultType, CameraSource} from '@capacitor/core'; */
|
||||||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
||||||
import { PublicationsService } from 'src/app/services/publications.service';
|
import { PublicationsService } from 'src/app/services/publications.service';
|
||||||
import { Publication } from 'src/app/models/publication';
|
import { Publication } from 'src/app/models/publication';
|
||||||
import { Image } from 'src/app/models/image';
|
import { Image } from 'src/app/models/image';
|
||||||
import { ThrowStmt } from '@angular/compiler';
|
|
||||||
import { PhotoService } from 'src/app/services/photo.service';
|
import { PhotoService } from 'src/app/services/photo.service';
|
||||||
import { AlertService } from 'src/app/services/alert.service';
|
|
||||||
//Capacitor
|
//Capacitor
|
||||||
/* const { Camera } = Plugins; */
|
|
||||||
|
|
||||||
//Cordova
|
//Cordova
|
||||||
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
|
||||||
import { ViewPublicationsPage } from '../view-publications/view-publications.page';
|
|
||||||
import { LoadingService } from 'src/app/services/loading.service';
|
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { ThemePalette } from '@angular/material/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-new-publication',
|
selector: 'app-new-publication',
|
||||||
@@ -26,6 +21,24 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
styleUrls: ['./new-publication.page.scss'],
|
styleUrls: ['./new-publication.page.scss'],
|
||||||
})
|
})
|
||||||
export class NewPublicationPage implements OnInit {
|
export class NewPublicationPage implements OnInit {
|
||||||
|
|
||||||
|
// date picker
|
||||||
|
public date: any;
|
||||||
|
public disabled = false;
|
||||||
|
public showSpinners = true;
|
||||||
|
public showSeconds = false;
|
||||||
|
public touchUi = false;
|
||||||
|
public enableMeridian = false;
|
||||||
|
public minDate = new Date().toISOString().slice(0,10)
|
||||||
|
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||||
|
public stepHour = 1;
|
||||||
|
public stepMinute = 5;
|
||||||
|
public stepSecond = 5;
|
||||||
|
public color: ThemePalette = 'primary';
|
||||||
|
|
||||||
|
Form: FormGroup;
|
||||||
|
validateFrom = false
|
||||||
|
|
||||||
showLoader: boolean;
|
showLoader: boolean;
|
||||||
publication: Publication;
|
publication: Publication;
|
||||||
pub: Publication = new Publication();
|
pub: Publication = new Publication();
|
||||||
@@ -38,7 +51,6 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
Defaultimage:any = '';
|
Defaultimage:any = '';
|
||||||
|
|
||||||
|
|
||||||
photo: SafeResourceUrl;
|
photo: SafeResourceUrl;
|
||||||
|
|
||||||
guestPicture:any;
|
guestPicture:any;
|
||||||
@@ -46,7 +58,6 @@ export class NewPublicationPage implements OnInit {
|
|||||||
capturedImage:any;
|
capturedImage:any;
|
||||||
capturedImageTitle:any;
|
capturedImageTitle:any;
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
public photoService: PhotoService,
|
public photoService: PhotoService,
|
||||||
@@ -66,6 +77,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
this.clear();
|
this.clear();
|
||||||
// this.takePicture();
|
// this.takePicture();
|
||||||
}
|
}
|
||||||
|
|
||||||
takePicture() {
|
takePicture() {
|
||||||
const options: CameraOptions = {
|
const options: CameraOptions = {
|
||||||
quality: 90,
|
quality: 90,
|
||||||
@@ -87,7 +99,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getPicture(){
|
getPicture() {
|
||||||
const options: CameraOptions = {
|
const options: CameraOptions = {
|
||||||
quality: 90,
|
quality: 90,
|
||||||
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
|
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
|
||||||
@@ -97,6 +109,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
targetWidth: 720,
|
targetWidth: 720,
|
||||||
targetHeight: 720,
|
targetHeight: 720,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.camera.getPicture(options).then((imageData) => {
|
this.camera.getPicture(options).then((imageData) => {
|
||||||
// imageData is either a base64 encoded string or a file URI
|
// imageData is either a base64 encoded string or a file URI
|
||||||
// If it's base64 (DATA_URL):
|
// If it's base64 (DATA_URL):
|
||||||
@@ -108,10 +121,34 @@ export class NewPublicationPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async save(){
|
runValidation() {
|
||||||
console.log('SAVE');
|
this.validateFrom = true
|
||||||
|
}
|
||||||
|
|
||||||
if(this.publicationType == '3'){
|
injectValidation() {
|
||||||
|
|
||||||
|
this.Form = new FormGroup({
|
||||||
|
Subject: new FormControl(this.pub.Title, [
|
||||||
|
Validators.required,
|
||||||
|
// Validators.minLength(4)
|
||||||
|
]),
|
||||||
|
capturedImage: new FormControl(this.capturedImage, [
|
||||||
|
|
||||||
|
]),
|
||||||
|
Message: new FormControl(this.pub.Message, [
|
||||||
|
Validators.required
|
||||||
|
])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async save() {
|
||||||
|
|
||||||
|
this.injectValidation()
|
||||||
|
this.runValidation()
|
||||||
|
|
||||||
|
if(this.Form.invalid) return false
|
||||||
|
|
||||||
|
if(this.publicationType == '3') {
|
||||||
console.log(this.navParams.get('publication'));
|
console.log(this.navParams.get('publication'));
|
||||||
|
|
||||||
if(this.capturedImage != '') {
|
if(this.capturedImage != '') {
|
||||||
@@ -139,7 +176,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.publication = {
|
this.publication = {
|
||||||
DateIndex: this.publication.DateIndex,
|
DateIndex: this.publication.DateIndex,
|
||||||
DocumentId:this.publication.DocumentId,
|
DocumentId:this.publication.DocumentId,
|
||||||
@@ -165,7 +202,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.publication = {
|
this.publication = {
|
||||||
DateIndex: new Date(),
|
DateIndex: new Date(),
|
||||||
DocumentId:null,
|
DocumentId:null,
|
||||||
@@ -194,15 +231,17 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
close(){
|
close() {
|
||||||
this.modalController.dismiss().then(()=>{
|
this.modalController.dismiss().then(()=>{
|
||||||
this.showLoader=true;
|
this.showLoader=true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
clear(){
|
|
||||||
|
clear() {
|
||||||
this.capturedImage = '';
|
this.capturedImage = '';
|
||||||
}
|
}
|
||||||
setTitle(){
|
|
||||||
|
setTitle() {
|
||||||
if(this.publicationType == '1') {
|
if(this.publicationType == '1') {
|
||||||
this.publicationTitle = 'Nova Publicação Rápida';
|
this.publicationTitle = 'Nova Publicação Rápida';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ import { IonicModule } from '@ionic/angular';
|
|||||||
import { PublicationsPageRoutingModule } from './publications-routing.module';
|
import { PublicationsPageRoutingModule } from './publications-routing.module';
|
||||||
|
|
||||||
import { PublicationsPage } from './publications.page';
|
import { PublicationsPage } from './publications.page';
|
||||||
import { SharedModule } from 'src/app/shared/shared.module';
|
|
||||||
import { ViewPublicationsPage } from 'src/app/shared/publication/view-publications/view-publications.page';
|
|
||||||
import { NewPublicationPage } from 'src/app/shared/publication/new-publication/new-publication.page';
|
|
||||||
import { PublicationDetailPage } from 'src/app/shared/publication/view-publications/publication-detail/publication-detail.page';
|
|
||||||
import { NewActionPage } from 'src/app/shared/publication/new-action/new-action.page';
|
|
||||||
import { ComponentsModule } from 'src/app/components/components.module';
|
import { ComponentsModule } from 'src/app/components/components.module';
|
||||||
import { ViewPublicationsPageModule } from 'src/app/shared/publication/view-publications/view-publications.module';
|
import { ViewPublicationsPageModule } from 'src/app/shared/publication/view-publications/view-publications.module';
|
||||||
import { NewPublicationPageModule } from 'src/app/shared/publication/new-publication/new-publication.module';
|
import { NewPublicationPageModule } from 'src/app/shared/publication/new-publication/new-publication.module';
|
||||||
@@ -20,7 +15,6 @@ import { PublicationDetailPageModule } from 'src/app/shared/publication/view-pub
|
|||||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||||
import { EditActionPageModule } from 'src/app/shared/publication/edit-action/edit-action.module';
|
import { EditActionPageModule } from 'src/app/shared/publication/edit-action/edit-action.module';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class flex-grow-1">
|
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
|
||||||
|
|
||||||
<mat-form-field appearance="none" floatLabel="never" class="width-100" required>
|
<mat-form-field appearance="none" floatLabel="never" class="width-100" required>
|
||||||
<!-- <input matInput type="text" > -->
|
<!-- <input matInput type="text" > -->
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class flex-grow-1">
|
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('IsRecurring')?.invalid && validateFrom " >
|
||||||
|
|
||||||
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
|
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
|
||||||
<mat-select placeholder="Selecione repetição*" [(ngModel)]="postEvent.IsRecurring">
|
<mat-select placeholder="Selecione repetição*" [(ngModel)]="postEvent.IsRecurring">
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import * as moment from 'moment';
|
|||||||
templateUrl: './edit-event.page.html',
|
templateUrl: './edit-event.page.html',
|
||||||
styleUrls: ['./edit-event.page.scss'],
|
styleUrls: ['./edit-event.page.scss'],
|
||||||
})
|
})
|
||||||
|
|
||||||
export class EditEventPage implements OnInit {
|
export class EditEventPage implements OnInit {
|
||||||
|
|
||||||
stEvent: Event;
|
stEvent: Event;
|
||||||
@@ -191,7 +192,10 @@ export class EditEventPage implements OnInit {
|
|||||||
this.injectValidation()
|
this.injectValidation()
|
||||||
this.runValidation()
|
this.runValidation()
|
||||||
|
|
||||||
if(this.Form.invalid) return false
|
if(this.Form.invalid) {
|
||||||
|
alert('error')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
this.getDatepickerData()
|
this.getDatepickerData()
|
||||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||||
|
|||||||
@@ -35,21 +35,17 @@ export class ExpedientesPrPage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
) {
|
) {
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
|
this.LoadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.LoadList();
|
|
||||||
this.router.events.forEach((event) => {
|
this.router.events.forEach((event) => {
|
||||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||||
this.doRefresh();
|
this.refreshing();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
notImplemented(){
|
|
||||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
|
||||||
}
|
|
||||||
|
|
||||||
openExpedientDetailPage(data){
|
openExpedientDetailPage(data){
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.openExpedientDetail.emit(data);
|
this.openExpedientDetail.emit(data);
|
||||||
@@ -115,6 +111,12 @@ export class ExpedientesPrPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshing() {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.LoadList();
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
|
||||||
doRefresh() {
|
doRefresh() {
|
||||||
this.LoadList();
|
this.LoadList();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||||
@@ -26,9 +26,9 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
private animationController: AnimationController,
|
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
private toastService: ToastService) {
|
private toastService: ToastService,
|
||||||
|
) {
|
||||||
this.task = this.navParams.get('task')
|
this.task = this.navParams.get('task')
|
||||||
this.fulltask = this.navParams.get('fulltask')
|
this.fulltask = this.navParams.get('fulltask')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export class EditActionPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async save(){
|
async save() {
|
||||||
let body = {
|
let body = {
|
||||||
ProcessId: this.folderId,
|
ProcessId: this.folderId,
|
||||||
Description: this.folder.Description,
|
Description: this.folder.Description,
|
||||||
|
|||||||
@@ -56,7 +56,13 @@ export class NewActionPage implements OnInit {
|
|||||||
console.log(ev.detail.value);
|
console.log(ev.detail.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get dateValid() {
|
||||||
|
if (window.innerWidth <= 800) {
|
||||||
|
return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []
|
||||||
|
} else {
|
||||||
|
return ['ok']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
runValidation() {
|
runValidation() {
|
||||||
this.validateFrom = true
|
this.validateFrom = true
|
||||||
@@ -68,7 +74,10 @@ export class NewActionPage implements OnInit {
|
|||||||
Subject: new FormControl(this.folder.Description, [
|
Subject: new FormControl(this.folder.Description, [
|
||||||
Validators.required,
|
Validators.required,
|
||||||
// Validators.minLength(4)
|
// Validators.minLength(4)
|
||||||
])
|
]),
|
||||||
|
Date: new FormControl(this.dateValid, [
|
||||||
|
Validators.required
|
||||||
|
]),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user