mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -79,10 +79,12 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
mobilefirstConnect() {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("").then(
|
||||
(token) => {
|
||||
|
||||
try {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("").then( (token) => {
|
||||
|
||||
console.log('MobileFirst Server connect: Success ' + token);
|
||||
|
||||
|
||||
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
|
||||
WLResourceRequest.GET
|
||||
);
|
||||
@@ -105,8 +107,9 @@ export class HomePage implements OnInit {
|
||||
alert("Bummer...");
|
||||
alert("Failed to connect to MobileFirst Server");
|
||||
}); */
|
||||
}
|
||||
);
|
||||
});
|
||||
} catch {}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -137,12 +137,17 @@ export class DespachoPrPage implements OnInit {
|
||||
});
|
||||
this.getDocumentDetails(this.task.FolderId, '361');
|
||||
|
||||
}, ()=>{
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -139,12 +139,17 @@ export class DespachoPage implements OnInit {
|
||||
});
|
||||
});
|
||||
this.getDocumentDetails(this.task.FolderId, '361');
|
||||
}, ()=>{
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+7
-1
@@ -123,12 +123,18 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
});
|
||||
this.getDocumentDetails(this.task.FolderId, '361');
|
||||
|
||||
}, ()=>{
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -138,12 +138,17 @@ export class DiplomaPage implements OnInit {
|
||||
});
|
||||
this.getDocumentDetails(this.task.FolderId, '361');
|
||||
|
||||
}, ()=>{
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+15
-9
@@ -49,14 +49,14 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -160,12 +160,18 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
console.log('this.task', this.task)
|
||||
console.log('this.task.DocumentURL', this.task.DocumentURL)
|
||||
|
||||
}, ()=>{
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -187,12 +187,18 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
})
|
||||
|
||||
}, ()=>{
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -156,13 +156,18 @@ export class PedidoPage implements OnInit {
|
||||
});
|
||||
});
|
||||
this.getDocumentDetails(res.workflowInstanceDataFields.FolderID, '361');
|
||||
}, ()=>{
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
this.close()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível vizualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -124,7 +124,7 @@ export class LoginPage implements OnInit {
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
let attempt = await this.authService.login(this.userattempt);
|
||||
let attempt = await this.authService.login(this.userattempt)
|
||||
|
||||
if (attempt) {
|
||||
this.authService.loginChat(this.userattempt);
|
||||
@@ -138,9 +138,6 @@ export class LoginPage implements OnInit {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('O email e/ou palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar');
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Por favor, insira a sua palavra-passe');
|
||||
|
||||
@@ -89,10 +89,12 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
getPublicationDetail() {
|
||||
|
||||
setTimeout(() => {
|
||||
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
|
||||
this.item = allActions.find((e)=> e.ProcessId == this.folderId);
|
||||
}, 100);
|
||||
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
|
||||
this.item = allActions.find((e)=> e.ProcessId == this.folderId);
|
||||
}, 100);
|
||||
|
||||
}
|
||||
|
||||
getPublications() {
|
||||
|
||||
@@ -428,7 +428,7 @@ export class SearchPage implements OnInit {
|
||||
/**
|
||||
* @description set empty value to searchSubject
|
||||
*/
|
||||
clearSearchInput(){
|
||||
clearSearchInput() {
|
||||
this.searchSubject = ""
|
||||
|
||||
this.searchCategories = [];
|
||||
@@ -436,8 +436,7 @@ export class SearchPage implements OnInit {
|
||||
this.showDocuments = false;
|
||||
|
||||
this.wordCloud();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isoDate String Iso date
|
||||
|
||||
@@ -9,6 +9,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { AuthConnstants } from '../config/auth-constants';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { LocalstoreService } from '../store/localstore.service';
|
||||
import { ToastService } from './toast.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -27,7 +28,8 @@ export class AuthService {
|
||||
private storageService:StorageService,
|
||||
private router:Router,
|
||||
public alertController: AlertController,
|
||||
private localstoreService: LocalstoreService
|
||||
private localstoreService: LocalstoreService,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
@@ -80,6 +82,11 @@ export class AuthService {
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Verifique a sua conexão com a internet e volte a tentar')
|
||||
} else {
|
||||
this.toastService.badRequest('O email e/ou palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,12 +100,20 @@ export class ViewEventPage implements OnInit {
|
||||
this.today = new Date(res.StartDate);
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
this.getAttachments(this.loadedEvent.EventId);
|
||||
}, (errer)=> {
|
||||
}, (error)=> {
|
||||
|
||||
console.log('errer', )
|
||||
|
||||
this.viewEventDetailDismiss.emit({
|
||||
type: 'close'
|
||||
})
|
||||
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('não é possível vizualizar este event no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment" *ngIf="eventsMDGPRList">
|
||||
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment" *ngIf="eventaprovacaostore.listmd">
|
||||
<!-- <div class="header-content width-100"> -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<!-- </div> -->
|
||||
<ion-list class="width-100" *ngSwitchCase="'MDGPR'" >
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor="let event of eventsMDGPRList"
|
||||
*ngFor="let event of eventaprovacaostore.listmd"
|
||||
(click)="goToEventDetail(event)"
|
||||
>
|
||||
<!-- (click)="openApproveModal(event)" -->
|
||||
@@ -48,10 +48,10 @@
|
||||
</div>
|
||||
</ion-list>
|
||||
<ion-list class="width-100" *ngSwitchCase="'PR'">
|
||||
<div class="width-100" *ngIf="eventsPRList">
|
||||
<div class="width-100" *ngIf="eventaprovacaostore.listpr">
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor="let event of eventsPRList"
|
||||
*ngFor="let event of eventaprovacaostore.listpr"
|
||||
(click)="goToEventDetail(event)"
|
||||
>
|
||||
<div class="item event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
|
||||
@@ -6,6 +6,7 @@ import { ModalController } from '@ionic/angular';
|
||||
import { NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-events-to-approve',
|
||||
@@ -23,6 +24,7 @@ export class EventsToApprovePage implements OnInit {
|
||||
serialnumber:string;
|
||||
loggeduser: User;
|
||||
segment:string;
|
||||
eventaprovacaostore = EventoAprovacaoStore;
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
@@ -63,11 +65,13 @@ export class EventsToApprovePage implements OnInit {
|
||||
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
||||
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
||||
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
||||
this.eventaprovacaostore.resetmd(this.eventsMDGPRList);
|
||||
}
|
||||
else if(this.segment == 'PR'){
|
||||
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||
this.eventaprovacaostore.resetpr(this.eventsPRList);
|
||||
}
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
<div class="width-100 overflow-y-auto height-100" >
|
||||
<div >
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
<ion-list *ngIf="taskslist.length >= 1">
|
||||
<ion-list *ngIf="expedientegbstore.list.length >=0">
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of taskslist"
|
||||
*ngFor = "let task of expedientegbstore.list"
|
||||
(click)="goToExpediente(task.SerialNumber)"
|
||||
>
|
||||
<div class="item width-100">
|
||||
@@ -56,13 +56,13 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && taskslist.length == 0 && taskslist.length == 0"
|
||||
*ngIf="!skeletonLoader && expedientegbstore.list.length == 0 && expedientegbstore.list.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && taskslist.length == 0">
|
||||
<div *ngIf="skeletonLoader && expedientegbstore.list.length == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { LoadingService } from 'src/app/services/loading.service';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expedients',
|
||||
@@ -26,6 +27,7 @@ export class ExpedientsPage implements OnInit {
|
||||
|
||||
@Input() profile:string;
|
||||
skeletonLoader = true
|
||||
expedientegbstore = ExpedienteGdStore
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
@@ -90,7 +92,10 @@ export class ExpedientsPage implements OnInit {
|
||||
"Status": element.workflowInstanceDataFields.Status,
|
||||
}
|
||||
this.taskslist.push(task);
|
||||
|
||||
});
|
||||
console.log("Buffer store", this.taskslist)
|
||||
this.expedientegbstore.reset(this.taskslist);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
|
||||
<div class="width-100 overflow-y-auto height-100" [ngSwitch]="segment">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
<div *ngIf="parecerList.length >= 1">
|
||||
<div *ngIf="pedidosstore.listparecer.length >= 1">
|
||||
<ion-list *ngSwitchCase="'parecer'">
|
||||
<!-- *ngFor = "let task of parecerList; let i = index"
|
||||
<!-- *ngFor = "let task of pedidosstore.listparecer; let i = index"
|
||||
(click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of parecerList"
|
||||
*ngFor = "let task of pedidosstore.listparecer"
|
||||
(click)="goToPedido(task.SerialNumber)"
|
||||
>
|
||||
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||
@@ -69,11 +69,11 @@
|
||||
</ion-list>
|
||||
|
||||
</div>
|
||||
<div *ngIf="deferimentoList.length >= 1">
|
||||
<div *ngIf="pedidosstore.listdeferimento.length >= 1">
|
||||
<ion-list *ngSwitchCase="'deferimento'">
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of deferimentoList"
|
||||
*ngFor = "let task of pedidosstore.listdeferimento"
|
||||
(click)="goToPedido(task.SerialNumber)"
|
||||
>
|
||||
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
<div *ngSwitchCase="'parecer'" class="d-flex height-100 align-center justify-content-center" >
|
||||
<div
|
||||
*ngIf="!skeletonLoader && parecerList.length == 0"
|
||||
*ngIf="!skeletonLoader && pedidosstore.listparecer.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
@@ -117,14 +117,14 @@
|
||||
|
||||
<div *ngSwitchCase="'deferimento'" class="d-flex height-100 align-center justify-content-center">
|
||||
<div
|
||||
*ngIf="!skeletonLoader && deferimentoList.length == 0"
|
||||
*ngIf="!skeletonLoader && pedidosstore.listdeferimento.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && parecerList.length == 0 && skeletonLoader && deferimentoList.length == 0 ">
|
||||
<div *ngIf="skeletonLoader && pedidosstore.listparecer.length == 0 && skeletonLoader && pedidosstore.listdeferimento.length == 0 ">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -10,6 +10,8 @@ import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { PedidoPage } from 'src/app/pages/gabinete-digital/pedidos/pedido/pedido.page';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pedidos',
|
||||
@@ -38,6 +40,7 @@ export class PedidosPage implements OnInit {
|
||||
@Input() segment:string;
|
||||
@Output() openPedido:EventEmitter<any> = new EventEmitter<any>();
|
||||
skeletonLoader = true
|
||||
pedidosstore = PedidosStore;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -121,6 +124,7 @@ export class PedidosPage implements OnInit {
|
||||
}
|
||||
this.parecerList.push(task);
|
||||
});
|
||||
this.pedidosstore.resetparecer(this.parecerList);
|
||||
|
||||
}
|
||||
else if(this.segment == 'deferimento') {
|
||||
@@ -155,6 +159,7 @@ export class PedidosPage implements OnInit {
|
||||
}
|
||||
this.deferimentoList.push(task);
|
||||
});
|
||||
this.pedidosstore.resetdeferimento(this.deferimentoList);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
<div class="width-100 overflow-y-auto height-100">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
<ion-list *ngIf="pendentesList.length >= 1">
|
||||
<ion-list *ngIf="pendentesstore.list.length >= 1">
|
||||
<div
|
||||
class="expediente ion-no-padding cursor-pointer"
|
||||
*ngFor = "let task of pendentesList"
|
||||
*ngFor = "let task of pendentesstore.list"
|
||||
(click)="viewTaskDetails(task.SerialNumber, task.WorkflowName, task)"
|
||||
>
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||
@@ -55,13 +55,13 @@
|
||||
</ion-list>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && pendentesList.length == 0"
|
||||
*ngIf="!skeletonLoader && pendentesstore.list.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && pendentesList.length == 0">
|
||||
<div *ngIf="skeletonLoader && pendentesstore.list.length == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -22,6 +23,7 @@ export class PendentesPage implements OnInit {
|
||||
serialNumber:string;
|
||||
totalDocs:any;
|
||||
skeletonLoader: boolean;
|
||||
pendentesstore = PendentesStore;
|
||||
|
||||
@Input() profile:string;
|
||||
segment:string;
|
||||
@@ -96,6 +98,7 @@ export class PendentesPage implements OnInit {
|
||||
this.pendentesList = removeDuplicate( this.pendentesList)
|
||||
this.pendentesList = this.sortArrayISODate(this.pendentesList);
|
||||
});
|
||||
this.pendentesstore.reset(this.pendentesList);
|
||||
this.skeletonLoader = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
export class DespachoStoreService {
|
||||
|
||||
// main data
|
||||
private _list: Event[]
|
||||
private _list: [] = []
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
@@ -27,8 +27,9 @@ export class DespachoStoreService {
|
||||
}
|
||||
|
||||
get list() {
|
||||
return this._list
|
||||
return this._list || []
|
||||
}
|
||||
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EventoaprovacaoStoreService } from './eventoaprovacao-store.service';
|
||||
|
||||
describe('EventoaprovacaoStoreService', () => {
|
||||
let service: EventoaprovacaoStoreService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(EventoaprovacaoStoreService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,83 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { localstoreService } from './localstore.service'
|
||||
import { AES, enc, SHA1 } from 'crypto-js'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class EventoaprovacaoStoreService {
|
||||
|
||||
// main data
|
||||
private _listpr: Event[]
|
||||
private _listmd: Event[]
|
||||
// local storage keyName
|
||||
private keyNamemd: string;
|
||||
private keyNamepr: string;
|
||||
private _count = 0
|
||||
|
||||
constructor() {
|
||||
|
||||
this.keyNamemd = (SHA1(this.constructor.name+"md")).toString()
|
||||
this.keyNamepr = (SHA1(this.constructor.name+"pr")).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restoremd = localstoreService.get(this.keyNamemd, {})
|
||||
let restorepr = localstoreService.get(this.keyNamepr, {})
|
||||
this._listpr = restorepr.eventsListpr || []
|
||||
this._listmd = restoremd.eventsListmd || []
|
||||
this._count = restorepr.count + restoremd.count || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get listpr() {
|
||||
return this._listpr
|
||||
}
|
||||
|
||||
get listmd() {
|
||||
return this._listmd
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
set count(value) {
|
||||
this._count = value
|
||||
}
|
||||
|
||||
resetpr(eventsList: any) {
|
||||
this._listpr = eventsList
|
||||
|
||||
this.count = this._listpr.length
|
||||
this.savepr(this._listpr)
|
||||
}
|
||||
|
||||
resetmd(eventsList: any) {
|
||||
this._listmd = eventsList
|
||||
|
||||
this.count = this._listmd.length
|
||||
this.savemd(this._listmd)
|
||||
}
|
||||
private savemd(eventsListmd: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamemd,{
|
||||
eventsListmd,
|
||||
count: this._listmd,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
private savepr(eventsListpr: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamepr,{
|
||||
eventsListpr,
|
||||
count: this._listpr,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const EventoAprovacaoStore = new EventoaprovacaoStoreService()
|
||||
@@ -11,7 +11,7 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
class ExpedienteStorageServiceService {
|
||||
|
||||
// main data
|
||||
private _list: Event[]
|
||||
private _list: Event[] = []
|
||||
private _count = 0
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ExpedientegdStoreService } from './expedientegd-store.service';
|
||||
|
||||
describe('ExpedientegdStoreService', () => {
|
||||
let service: ExpedientegdStoreService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ExpedientegdStoreService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { localstoreService } from './localstore.service'
|
||||
import { AES, enc, SHA1 } from 'crypto-js'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ExpedientegdStoreService {
|
||||
|
||||
// main data
|
||||
private _list: Event[]
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
|
||||
constructor() {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name)).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = restore.count || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get list() {
|
||||
return this._list
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
set count(value) {
|
||||
this._count = value
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
count: this._list
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const ExpedienteGdStore = new ExpedientegdStoreService()
|
||||
@@ -6,7 +6,7 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
})
|
||||
export class LocalstoreService {
|
||||
|
||||
private prefix = 'v9-'
|
||||
private prefix = 'v10-'
|
||||
|
||||
constructor() {
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PedidosStoreService } from './pedidos-store.service';
|
||||
|
||||
describe('PedidosStoreService', () => {
|
||||
let service: PedidosStoreService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(PedidosStoreService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,82 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { localstoreService } from './localstore.service'
|
||||
import { AES, enc, SHA1 } from 'crypto-js'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PedidosStoreService {
|
||||
|
||||
private _listparecer: Event[]
|
||||
private _listdeferimento: Event[]
|
||||
// local storage keyName
|
||||
private keyNameparecer: string;
|
||||
private keyNamedeferiemnto: string;
|
||||
private _count = 0
|
||||
|
||||
constructor() {
|
||||
|
||||
this.keyNameparecer = (SHA1(this.constructor.name+"parecer")).toString()
|
||||
this.keyNamedeferiemnto = (SHA1(this.constructor.name+"deferimneto")).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restoreparecer = localstoreService.get(this.keyNameparecer, {})
|
||||
let restoredeferimento = localstoreService.get(this.keyNamedeferiemnto, {})
|
||||
this._listparecer = restoredeferimento.eventsListdeferimento || []
|
||||
this._listdeferimento = restoreparecer.eventsListparecer || []
|
||||
this._count = restoredeferimento.count + restoreparecer.count || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get listparecer() {
|
||||
return this._listparecer
|
||||
}
|
||||
|
||||
get listdeferimento() {
|
||||
return this._listdeferimento
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
set count(value) {
|
||||
this._count = value
|
||||
}
|
||||
|
||||
resetparecer(eventsList: any) {
|
||||
this._listparecer = eventsList
|
||||
|
||||
this.count = this._listparecer.length
|
||||
this.savedeferimento(this._listparecer)
|
||||
}
|
||||
|
||||
resetdeferimento(eventsList: any) {
|
||||
this._listdeferimento = eventsList
|
||||
|
||||
this.count = this._listdeferimento.length
|
||||
this.saveparecer(this._listdeferimento)
|
||||
}
|
||||
private saveparecer(eventsListparecer: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNameparecer,{
|
||||
eventsListparecer,
|
||||
count: this._listdeferimento,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
private savedeferimento(eventsListdeferimento: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamedeferiemnto,{
|
||||
eventsListdeferimento,
|
||||
count: this._listparecer,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const PedidosStore = new PedidosStoreService()
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PendestesStoreService } from './pendestes-store.service';
|
||||
|
||||
describe('PendestesStoreService', () => {
|
||||
let service: PendestesStoreService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(PendestesStoreService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { localstoreService } from './localstore.service'
|
||||
import { AES, enc, SHA1 } from 'crypto-js'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PendestesStoreService {
|
||||
|
||||
// main data
|
||||
private _list: Event[]
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
|
||||
constructor() {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name)).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = restore.count || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get list() {
|
||||
return this._list
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
set count(value) {
|
||||
this._count = value
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
count: this._list
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const PendentesStore = new PendestesStoreService()
|
||||
|
||||
@@ -10,7 +10,7 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
export class ToDayEventStorageService {
|
||||
|
||||
// main data
|
||||
private _eventsList: Event[]
|
||||
private _eventsList: Event[] = []
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
|
||||
Reference in New Issue
Block a user