performance

This commit is contained in:
Peter Maquiran
2023-06-11 20:17:10 +01:00
parent e6fc2f19f2
commit 2688b1e012
37 changed files with 543 additions and 257 deletions
@@ -7,6 +7,7 @@ import { EmendMessageModalPage } from '../emend-message-modal/emend-message-moda
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service'
@Component({ @Component({
@@ -27,7 +28,8 @@ export class EventActionsPopoverPage implements OnInit {
private toastService: ToastService, private toastService: ToastService,
private RouteService: RouteService, private RouteService: RouteService,
private httpErrorHandle: HttpErrorHandle, private httpErrorHandle: HttpErrorHandle,
public ThemeService: ThemeService) { public ThemeService: ThemeService,
public TaskService: TaskService) {
this.serialNumber = this.navParams.get('serialNumber'); this.serialNumber = this.navParams.get('serialNumber');
this.instanceId = this.navParams.get('InstanceId'); this.instanceId = this.navParams.get('InstanceId');
this.activityInstanceName = this.navParams.get('InstanceId'); this.activityInstanceName = this.navParams.get('InstanceId');
@@ -58,7 +60,7 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.processes.PostTaskAction(body).toPromise() await this.processes.PostTaskAction(body).toPromise()
this.TaskService.loadEventosParaAprovacao()
this.httpErrorHandle.httpsSucessMessagge('Evento aprovação') this.httpErrorHandle.httpsSucessMessagge('Evento aprovação')
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
@@ -77,7 +79,7 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.processes.PostTaskAction(body).toPromise() await this.processes.PostTaskAction(body).toPromise()
this.TaskService.loadEventosParaAprovacao()
this.httpErrorHandle.httpsSucessMessagge('Rever') this.httpErrorHandle.httpsSucessMessagge('Rever')
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
@@ -121,6 +123,7 @@ export class EventActionsPopoverPage implements OnInit {
try { try {
await this.processes.PostTaskAction(body).toPromise(); await this.processes.PostTaskAction(body).toPromise();
this.httpErrorHandle.httpsSucessMessagge('Rever') this.httpErrorHandle.httpsSucessMessagge('Rever')
this.TaskService.loadEventosParaAprovacao()
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
this.httpErrorHandle.httpStatusHandle(error) this.httpErrorHandle.httpStatusHandle(error)
@@ -145,6 +148,7 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading(); const loader = this.toastService.loading();
try { try {
await this.processes.PostTaskAction(body).toPromise(); await this.processes.PostTaskAction(body).toPromise();
this.TaskService.loadEventosParaAprovacao()
this.httpErrorHandle.httpsSucessMessagge('Rejeitar') this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
+1 -1
View File
@@ -26,7 +26,7 @@
<div class="main-content justify-center d-flex height-100"> <div class="main-content justify-center d-flex height-100">
<div class="box-container width-100 d-flex mx-20" style="padding: 0px;overflow: hidden;"> <div class="box-container width-100 d-flex mx-20" style="padding: 0px;overflow: hidden;">
<ion-progress-bar type="indeterminate" *ngIf="loadingAllTask"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="loadingAllTask || TaskService.showLoader"></ion-progress-bar>
<div class="px-20 pb-20"> <div class="px-20 pb-20">
<p class="time ion-text-left ">{{customDate}}</p> <p class="time ion-text-left ">{{customDate}}</p>
<div class="wrap d-flex float-left"> <div class="wrap d-flex float-left">
+19 -7
View File
@@ -72,6 +72,10 @@ export class EventsPage implements OnInit {
searchSubject: string = ''; searchSubject: string = '';
AllProcess = [] AllProcess = []
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
constructor( constructor(
private eventService: EventsService, private eventService: EventsService,
@@ -87,12 +91,7 @@ export class EventsPage implements OnInit {
private changeProfileService: ChangeProfileService, private changeProfileService: ChangeProfileService,
public TaskService: TaskService public TaskService: TaskService
) { ) {
this.loadAllTask();
window['zipPhoneCallback'] = function (zipphone) { window['zipPhoneCallback'] = function (zipphone) {
var frame = document.getElementById('home-iframe'); var frame = document.getElementById('home-iframe');
if(frame) { if(frame) {
@@ -101,18 +100,30 @@ export class EventsPage implements OnInit {
} }
this.changeProfileService.registerCallback(() => { this.changeProfileService.registerCallback(() => {
this.listToPresent = []; this.listToPresent = [];
this.listToPresentexpediente = [] this.listToPresentexpediente = []
}) })
this.TaskService.registerCallback({ }
ngAfterViewInit(): void {
this.loadAllTask();
this.listSubscription = this.TaskService.registerCallback({
id: import.meta.url, id: import.meta.url,
funx:() => { funx:() => {
this.dynamicSearch() this.dynamicSearch()
} }
}) })
this.dynamicSearch()
}
ngOnDestroy() {
this.listSubscription.delete()
} }
ngOnInit() { ngOnInit() {
@@ -170,6 +181,7 @@ export class EventsPage implements OnInit {
async loadAllTask() { async loadAllTask() {
this.loadingAllTask = true this.loadingAllTask = true
await this.TaskService.LoadTask() await this.TaskService.LoadTask()
this.dynamicSearch()
this.loadingAllTask = false this.loadingAllTask = false
} }
@@ -403,7 +403,7 @@ export class DespachoPrPage implements OnInit {
} }
this.TaskService.loadDiplomas() this.TaskService.loadDiplomas()
// this.goBack(); this.goBack();
} }
}); });
} }
@@ -1,17 +1,16 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { AnimationController, ModalController, PopoverController } from '@ionic/angular'; import { ModalController, PopoverController } from '@ionic/angular';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page'; import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page'; import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { Platform } from '@ionic/angular';
import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service'; import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
@@ -47,15 +46,10 @@ export class DiplomaPage implements OnInit {
private processes: ProcessesService, private processes: ProcessesService,
public popoverController: PopoverController, public popoverController: PopoverController,
private modalController: ModalController, private modalController: ModalController,
private iab: InAppBrowser,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private router: Router,
private animationController: AnimationController,
private toastService: ToastService, private toastService: ToastService,
private RouteService: RouteService, private RouteService: RouteService,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
private platform: Platform,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle, private httpErrorHandle: HttpErrorHandle,
private despachoService: DespachoService, private despachoService: DespachoService,
@@ -1,8 +1,8 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationStart, Router } from '@angular/router'; import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { BackgroundService } from 'src/app/services/background.service'; import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { DeplomasStore } from 'src/app/store/deplomas.service'; import { DeplomasStore } from 'src/app/store/deplomas.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@@ -39,6 +39,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
private router: Router, private router: Router,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
public p: PermissionService, public p: PermissionService,
public TaskService: TaskService, public TaskService: TaskService,
private RouteService: RouteService, private RouteService: RouteService,
@@ -1,6 +1,6 @@
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular'; import { MenuController, ModalController, PopoverController } from '@ionic/angular';
import { Event } from 'src/app/models/event.model'; import { Event } from 'src/app/models/event.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page'; import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
@@ -9,13 +9,10 @@ import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edi
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { SqliteService } from '../../../../services/sqlite.service';
import { BackgroundService } from '../../../../services/background.service'; import { BackgroundService } from '../../../../services/background.service';
import { Platform } from '@ionic/angular';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { OfflineManagerService } from 'src/app/services/offline-manager.service'; import { OfflineManagerService } from 'src/app/services/offline-manager.service';
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { Storage } from '@ionic/storage';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
@@ -55,12 +52,9 @@ export class ApproveEventPage implements OnInit {
private menu: MenuController, private menu: MenuController,
private toastService: ToastService, private toastService: ToastService,
private RouteService: RouteService, private RouteService: RouteService,
private sqliteservice: SqliteService,
private platform: Platform,
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private offlineManager: OfflineManagerService, private offlineManager: OfflineManagerService,
private storage: Storage,
private httpErrorHandle: HttpErrorHandle, private httpErrorHandle: HttpErrorHandle,
public TaskService: TaskService public TaskService: TaskService
) { ) {
@@ -55,7 +55,7 @@
</div> </div>
</div> </div>
<button title="Atualizar" *ngIf="hideRefreshBtn && TaskService.loadCount" class="btn-no-color btn-refresh" (click)="doRefresh($event)"> <button title="Atualizar" *ngIf="hideRefreshBtn && TaskService.loadCount" class="btn-no-color btn-refresh" (click)="doRefreshAside($event)">
<ion-icon class="title-icon font-awesome" name="reload-circle"></ion-icon> <ion-icon class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button> </button>
<div *ngIf="!hideRefreshBtn" class="title-icons"> <div *ngIf="!hideRefreshBtn" class="title-icons">
@@ -260,7 +260,7 @@
<!-- This is the box view --> <!-- This is the box view -->
<div *ngSwitchCase="'boxview'" class="aside d-flex flex-wrap width-100 height-100"> <div *ngSwitchCase="'boxview'" class="aside d-flex flex-wrap width-100 height-100">
<div *ngIf="TaskService.loadCount" class="center-box"> <div *ngIf="TaskService.loadCount" class="center-box">
<!-- List --> <!-- List -->
<div *ngIf="hideInMobile" (click)="openAllProcessesPage()" [class.active]="selectedElement == 'allProcessesTag'" class="box-hover exp-card d-flex flex-column" > <div *ngIf="hideInMobile" (click)="openAllProcessesPage()" [class.active]="selectedElement == 'allProcessesTag'" class="box-hover exp-card d-flex flex-column" >
<div class="d-flex justify-center"> <div class="d-flex justify-center">
@@ -273,12 +273,11 @@
<span class="new-task-count" *ngIf="TaskService.new == 1">{{ TaskService.new }} correspondência novas</span> <span class="new-task-count" *ngIf="TaskService.new == 1">{{ TaskService.new }} correspondência novas</span>
</p> </p>
<p class="text-center exp-card-content" > {{ AllProcess.length }} <p class="text-center exp-card-content" > {{ AllProcess.length }}
<span class="title1" *ngIf="AllProcess.length == 0">Documento</span> <span class="title1" *ngIf="AllProcess.length == 0">correspondência</span>
<span class="title1" *ngIf="AllProcess.length == 1">Documento</span> <span class="title1" *ngIf="AllProcess.length == 1">correspondência</span>
<span class="title1" *ngIf="AllProcess.length > 1">Documentos</span> <span class="title1" *ngIf="AllProcess.length > 1">correspondências</span>
</p> </p>
</div> </div>
<!-- List --> <!-- List -->
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center"> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
<div class="center-div"> <div class="center-div">
@@ -301,9 +300,9 @@
<span class="new-task-count" *ngIf="TaskService.despachoprstore.newList.length ==1">{{ TaskService.despachoprstore.newList.length}} correspondência nova </span> <span class="new-task-count" *ngIf="TaskService.despachoprstore.newList.length ==1">{{ TaskService.despachoprstore.newList.length}} correspondência nova </span>
</p> </p>
<p class="text-center exp-card-content"> {{ TaskService.despachoprstore.count }} <p class="text-center exp-card-content"> {{ TaskService.despachoprstore.count }}
<span class="title1" *ngIf="TaskService.despachoprstore.count == 0">Documento</span> <span class="title1" *ngIf="TaskService.despachoprstore.count == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.despachoprstore.count == 1">Documento</span> <span class="title1" *ngIf="TaskService.despachoprstore.count == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.despachoprstore.count > 1">Documentos</span> <span class="title1" *ngIf="TaskService.despachoprstore.count > 1">correspondências</span>
</p> </p>
</div> </div>
</div> </div>
@@ -326,9 +325,9 @@
<span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasAssinadoListNewCount.length ==1">{{ TaskService.deplomasStore.diplomasAssinadoListNewCount.length}} correspondência nova</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasAssinadoListNewCount.length ==1">{{ TaskService.deplomasStore.diplomasAssinadoListNewCount.length}} correspondência nova</span>
</p> </p>
<p class="text-center exp-card-content"> {{ TaskService.deplomasStore.countDiplomasAssinadoListCount }} <p class="text-center exp-card-content"> {{ TaskService.deplomasStore.countDiplomasAssinadoListCount }}
<span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount == 0">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount == 1">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount > 1">Documentos</span> <span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount > 1">correspondências</span>
</div> </div>
@@ -348,9 +347,9 @@
</p> </p>
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{ TaskService.deplomasStore.diplomasParaAssinartCount }} {{ TaskService.deplomasStore.diplomasParaAssinartCount }}
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 0">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 1">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount > 1">Documentos</span> <span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount > 1">correspondências</span>
</p> </p>
</div> </div>
@@ -369,9 +368,9 @@
<!-- <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Assinar PR</p> --> <!-- <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Assinar PR</p> -->
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{ TaskService.deplomasStore.deplomasReviewCount }} {{ TaskService.deplomasStore.deplomasReviewCount }}
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount == 0">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount == 1">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount > 1">Documentos</span> <span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount > 1">correspondências</span>
</p> </p>
</div> </div>
@@ -391,9 +390,9 @@
</p> </p>
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{ TaskService.deplomasStore.diplomasParaAssinartCount }} {{ TaskService.deplomasStore.diplomasParaAssinartCount }}
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 0">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 1">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount > 1">Documentos</span> <span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount > 1">correspondências</span>
</p> </p>
</div> </div>
@@ -415,9 +414,9 @@
</p> </p>
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{ TaskService.deplomasStore.DiplomaGerarList.length }} {{ TaskService.deplomasStore.DiplomaGerarList.length }}
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length == 0">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length == 1">Documento</span> <span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length > 1">Documentos</span> <span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length > 1">correspondências</span>
</p> </p>
</div> </div>
@@ -433,14 +432,15 @@
</p> </p>
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{TaskService.eventoaprovacaostore.countAll}} {{TaskService.eventoaprovacaostore.countAll}}
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll == 0">Documento</span> <span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll == 1">Documento</span> <span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll > 1">Documentos</span> <span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll > 1">correspondências</span>
</p> </p>
</div> </div>
<!-- List --> <!-- List -->
<div (click)="openExpedientListPage(); selectedElement='Correspondence'" [class.active]="selectedElement == 'Correspondence'" class="box-hover exp-card d-flex flex-column justify-center"> {{ selectedElement }}
<div (click)="openExpedientListPage(); selectedElement='Correspondence'" [class.active]="selectedElement == 'Correspondence' || selectedElement == 'Expediente Presidente'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center"> <div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-correspondencia.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-correspondencia.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Correspondence'" src="assets/images/theme/gov/icons-correspondencia.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Correspondence'" src="assets/images/theme/gov/icons-correspondencia.svg"></ion-icon>
@@ -456,9 +456,9 @@
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{TaskService.expedientegbstore.count}} {{TaskService.expedientegbstore.count}}
<span class="title1" *ngIf="TaskService.expedientegbstore.count == 0">Documento</span> <span class="title1" *ngIf="TaskService.expedientegbstore.count == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.expedientegbstore.count == 1">Documento</span> <span class="title1" *ngIf="TaskService.expedientegbstore.count == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.expedientegbstore.count > 1">Documentos</span> <span class="title1" *ngIf="TaskService.expedientegbstore.count > 1">correspondências</span>
</p> </p>
</div> </div>
@@ -478,9 +478,9 @@
</p> </p>
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{TaskService.despachoStore.count}} {{TaskService.despachoStore.count}}
<span class="title1" *ngIf="TaskService.despachoStore.count == 0">Documento</span> <span class="title1" *ngIf="TaskService.despachoStore.count == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.despachoStore.count == 1">Documento</span> <span class="title1" *ngIf="TaskService.despachoStore.count == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.despachoStore.count > 1">Documentos</span> <span class="title1" *ngIf="TaskService.despachoStore.count > 1">correspondências</span>
</p> </p>
</div> </div>
@@ -508,9 +508,9 @@
</p> </p>
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{TaskService.pedidosstore.countparecer}} {{TaskService.pedidosstore.countparecer}}
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer == 0">Documento</span> <span class="title1" *ngIf="TaskService.pedidosstore.countparecer == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer == 1">Documento</span> <span class="title1" *ngIf="TaskService.pedidosstore.countparecer == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer > 1">Documentos</span> <span class="title1" *ngIf="TaskService.pedidosstore.countparecer > 1">correspondências</span>
</p> </p>
</div> </div>
@@ -531,9 +531,9 @@
</p> </p>
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
{{ TaskService.pedidosstore.countdeferimento}} {{ TaskService.pedidosstore.countdeferimento}}
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento == 0">Documento</span> <span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento == 1">Documento</span> <span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento > 1">Documentos</span> <span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento > 1">correspondências</span>
</p> </p>
</div> </div>
@@ -559,9 +559,9 @@
<p class="text-center exp-card-content"> <p class="text-center exp-card-content">
<span class="number">{{TaskService.pendentesstore.count}} </span> <span class="number">{{TaskService.pendentesstore.count}} </span>
<span class="title1" *ngIf="TaskService.pendentesstore.count == 0">Documento</span> <span class="title1" *ngIf="TaskService.pendentesstore.count == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.pendentesstore.count == 1">Documento</span> <span class="title1" *ngIf="TaskService.pendentesstore.count == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.pendentesstore.count > 1">Documentos</span> <span class="title1" *ngIf="TaskService.pendentesstore.count > 1">correspondências</span>
</div> </div>
@@ -665,21 +665,21 @@
<!-- Aside right --> <!-- Aside right -->
<div class="aside-content d-none flex-column height-100"> <div class="aside-content d-none flex-column height-100">
<app-empty-container [texto]="emptyTextDescription" [style.display]="showEmptyContainer ? 'flex' : 'none'" class="height-100 flex-column"></app-empty-container> <app-empty-container [texto]="emptyTextDescription" *ngIf="showEmptyContainer" [style.display]="showEmptyContainer ? 'flex' : 'none'" class="height-100 flex-column"></app-empty-container>
<app-all-processes [profile]="profile" class=" height-100 flex-column" [style.display]="showAllProcesses ? 'flex' : 'none'" ></app-all-processes> <app-all-processes [profile]="profile" class=" height-100 flex-column" *ngIf="showAllProcesses" [style.display]="showAllProcesses ? 'flex' : 'none'" ></app-all-processes>
<app-events-to-approve [profile]="'MDGPR'" [style.display]="showEventsToApprove ? 'flex' : 'none'" class=" height-100 flex-column"></app-events-to-approve> <app-events-to-approve [profile]="'MDGPR'" *ngIf="showEventsToApprove" [style.display]="showEventsToApprove ? 'flex' : 'none'" class=" height-100 flex-column"></app-events-to-approve>
<app-expedients [profile]="profile" class=" height-100 flex-column" [style.display]="showExpedients ? 'flex' : 'none'" ></app-expedients> <app-expedients [profile]="profile" class=" height-100 flex-column" *ngIf="showExpedients" [style.display]="showExpedients ? 'flex' : 'none'" ></app-expedients>
<app-pedidos [profile]="profile" [segment]="segment" [serialNumber]="serialNumber" class=" height-100 flex-column" [style.display]="showPedidos ? 'flex' : 'none'"></app-pedidos> <app-pedidos [profile]="profile" [segment]="segment" [serialNumber]="serialNumber" class=" height-100 flex-column" *ngIf="showPedidos" [style.display]="showPedidos ? 'flex' : 'none'"></app-pedidos>
<app-despachos [profile]="profile" class="height-100 flex-column" [style.display]="showDespachos ? 'flex' : 'none'" ></app-despachos> <app-despachos [profile]="profile" class="height-100 flex-column" *ngIf="showDespachos" [style.display]="showDespachos ? 'flex' : 'none'" ></app-despachos>
<app-despachos-pr [profile]="profile" class=" height-100 flex-column" [style.display]="showDespachosPr ? 'flex' : 'none'" ></app-despachos-pr> <app-despachos-pr [profile]="profile" class=" height-100 flex-column" *ngIf="showDespachosPr" [style.display]="showDespachosPr ? 'flex' : 'none'" ></app-despachos-pr>
<app-pendentes [profile]="profile" class=" height-100 flex-column" [style.display]="showPendentes ? 'flex' : 'none'" ></app-pendentes> <app-pendentes [profile]="profile" class=" height-100 flex-column" *ngIf="showPendentes" [style.display]="showPendentes ? 'flex' : 'none'" ></app-pendentes>
<app-diplomas (openExpedientDetail)="openExpedientesPrPage($event)" [profile]="profile" [segment]="segment" class=" height-100 flex-column" [style.display]="showDiplomas ? 'flex' : 'none'"></app-diplomas> <app-diplomas (openExpedientDetail)="openExpedientesPrPage($event)" [profile]="profile" [segment]="segment" class=" height-100 flex-column" *ngIf="showDiplomas" [style.display]="showDiplomas ? 'flex' : 'none'"></app-diplomas>
<app-diplomas-assinar class=" height-100 flex-column" [style.display]="showDiplomasAssinar ? 'flex' : 'none'"></app-diplomas-assinar> <app-diplomas-assinar class=" height-100 flex-column" *ngIf="showDiplomasAssinar" [style.display]="showDiplomasAssinar ? 'flex' : 'none'"></app-diplomas-assinar>
<app-expedientes-pr [profile]="profile" class=" height-100 flex-column" [style.display]="showExpedientesPr ? 'flex' : 'none'" ></app-expedientes-pr> <app-expedientes-pr [profile]="profile" class=" height-100 flex-column" *ngIf="showExpedientesPr" [style.display]="showExpedientesPr ? 'flex' : 'none'" ></app-expedientes-pr>
<app-signed-diploma [profile]="profile" class=" height-100 flex-column" [style.display]="showSignedDiploma ? 'flex' : 'none'" ></app-signed-diploma> <app-signed-diploma [profile]="profile" class=" height-100 flex-column" *ngIf="showSignedDiploma" [style.display]="showSignedDiploma ? 'flex' : 'none'" ></app-signed-diploma>
<app-diplomas-gerars [profile]="profile" class="height-100 flex-column" [style.display]="showDiplomasGerar ? 'flex' : 'none'"></app-diplomas-gerars> <app-diplomas-gerars [profile]="profile" class="height-100 flex-column" *ngIf="showDiplomasGerar" [style.display]="showDiplomasGerar ? 'flex' : 'none'"></app-diplomas-gerars>
</div> </div>
</div> </div>
</ion-content> </ion-content>
@@ -111,49 +111,21 @@ export class GabineteDigitalPage implements OnInit {
) { ) {
window.onresize = (event) => { window.onresize = (event) => {
// if not mobile remove all component
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
this.modalController.dismiss(); this.modalController.dismiss();
this.hideRefreshBtn = false;
this.hideInMobile = false;
this.segmentVista = "listview"; this.segmentVista = "listview";
} }
else { else {
this.hideRefreshBtn = true;
this.hideInMobile = true;
this.segmentVista = "boxview"; this.segmentVista = "boxview";
} }
} }
this.checkRoutes();
// fix with many timeout // fix with many timeout
setTimeout(() => {
this.dynamicSearch()
}, 2000)
// setTimeout(() => {
// this.dynamicSearch()
// }, 4000)
setTimeout(() => {
this.dynamicSearch()
}, 6000)
setTimeout(() => {
this.dynamicSearch()
}, 10000)
setTimeout(() => {
this.dynamicSearch()
}, 14000)
setTimeout(() => {
this.dynamicSearch()
}, 18000)
setTimeout(() => {
this.dynamicSearch()
this.TaskService.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
}, 20000)
} }
@@ -223,9 +195,34 @@ export class GabineteDigitalPage implements OnInit {
this.segmentVista = "boxview" this.segmentVista = "boxview"
} }
this.LoadCounts();
this.checkFilter(); this.hideRefreshButton();
}
ngAfterViewInit(): void {
// We can access the TestComponent now that this portion of the view tree has been initiated.
const element = this.scroll.nativeElement
this.scroll.nativeElement.addEventListener("scroll", (e)=> {
this.changeTab()
});
(async () => {
await this.loadAllProcesses()
this.TaskService.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
})();
this.checkFilter();
this.checkRoutes();
this.dynamicSearch()
const pathname = '/home/gabinete-digital' const pathname = '/home/gabinete-digital'
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.includes(pathname) && !event.url.includes('/home/gabinete-digital/')) { if (event instanceof NavigationEnd && event.url.includes(pathname) && !event.url.includes('/home/gabinete-digital/')) {
@@ -241,22 +238,14 @@ export class GabineteDigitalPage implements OnInit {
// this.LoadCounts(); // this.LoadCounts();
this.checkFilter() this.checkFilter()
} }
this.mobile()
} }
}) })
} }
}); });
this.checkRoutes()
this.hideRefreshButton();
}
ngAfterViewInit(): void {
// We can access the TestComponent now that this portion of the view tree has been initiated.
const element = this.scroll.nativeElement
this.scroll.nativeElement.addEventListener("scroll", (e)=> {
this.changeTab()
});
} }
functionTimer1 = null; functionTimer1 = null;
@@ -292,9 +281,6 @@ export class GabineteDigitalPage implements OnInit {
} }
async loadAllProcesses() {
this.LoadCounts();
}
goto(url) { goto(url) {
@@ -353,18 +339,7 @@ export class GabineteDigitalPage implements OnInit {
} }
hideRefreshButton() { hideRefreshButton() {
window.onresize = (event) => { console.log(this.router.url)
if (window.innerWidth < 701) {
this.hideRefreshBtn = false;
this.hideInMobile = false;
this.segmentVista = "listview";
}
else {
this.hideRefreshBtn = true;
this.hideInMobile = true;
this.segmentVista = "boxview";
}
}
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
this.hideRefreshBtn = false; this.hideRefreshBtn = false;
this.hideInMobile = false; this.hideInMobile = false;
@@ -377,6 +352,15 @@ export class GabineteDigitalPage implements OnInit {
} }
} }
mobile() {
console.log(this.router.url)
if (window.innerWidth < 701 && this.router.url.includes('filter=')) {
this.hideRefreshBtn = false;
this.hideInMobile = false;
this.segmentVista = "listview";
}
}
checkRoutes() { checkRoutes() {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
@@ -417,11 +401,13 @@ export class GabineteDigitalPage implements OnInit {
} }
else if (this.router.url == '/home/gabinete-digital?despachospr=true') { else if (this.router.url == '/home/gabinete-digital?despachospr=true') {
this.openDespachosPrPage(''); this.openDespachosPrPage('');
this.selectedElement = 'DispatchesPr' this.selectedElement = 'showDespachosPr'
} }
else if (this.router.url == '/home/gabinete-digital?diplomas=true') { else if (this.router.url == '/home/gabinete-digital?diplomas=assinados') {
this.openDiplomasPage('assinados');
}
else if (this.router.url == '/home/gabinete-digital?diplomas=validar') {
this.openDiplomasPage('validar'); this.openDiplomasPage('validar');
this.selectedElement = 'DiplomasPorValidar';
} }
else if (this.router.url == '/home/gabinete-digital?diplomasassinar=true') { else if (this.router.url == '/home/gabinete-digital?diplomasassinar=true') {
this.openDiplomasAssinarPage(); this.openDiplomasAssinarPage();
@@ -464,17 +450,26 @@ export class GabineteDigitalPage implements OnInit {
return Object.keys(this.loadProcess) return Object.keys(this.loadProcess)
} }
async LoadCounts() { async loadAllProcesses() {
// this.skeletonLoader = true // this.skeletonLoader = true
await this.TaskService.LoadTask() await this.TaskService.LoadTask()
this.dynamicSearch()
// this.skeletonLoader = false // this.skeletonLoader = false
} }
doRefreshAside() {
window['gabinete-aside-refresh']()
setTimeout(() => {
this.loadAllProcesses();
}, 1000)
}
doRefresh(event) { doRefresh(event) {
this.LoadCounts(); this.loadAllProcesses();
if (event) { if (event) {
setTimeout(() => { setTimeout(() => {
@@ -634,9 +629,11 @@ export class GabineteDigitalPage implements OnInit {
let navigationExtras: NavigationExtras; let navigationExtras: NavigationExtras;
if (segment == 'validar') { if (segment == 'validar') {
navigationExtras = { queryParams: { "validar": true, } }; navigationExtras = { queryParams: { "diplomas": 'validar', } };
this.selectedElement = 'DiplomasPorValidar';
} else if (segment == 'assinados') { } else if (segment == 'assinados') {
navigationExtras = { queryParams: { "assinados": true, } }; this.selectedElement = 'DiplomasAssinados';
navigationExtras = { queryParams: { "diplomas": 'assinados', } };
} }
this.segment = segment; this.segment = segment;
@@ -646,10 +643,10 @@ export class GabineteDigitalPage implements OnInit {
} }
else { else {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
this.segment = segment;
let navigationExtras: NavigationExtras = { queryParams: { "diplomas": true, } };
this.router.navigate(['/home/gabinete-digital'], navigationExtras); this.router.navigate(['/home/gabinete-digital'], navigationExtras);
this.showDiplomas = true; setTimeout(() => {
this.showDiplomas = true;
}, 10)
} }
} }
@@ -267,6 +267,7 @@ export class PedidoPage implements OnInit {
if (res['data'] == 'close') { if (res['data'] == 'close') {
this.goBack() this.goBack()
} }
this.TaskService.loadPedidos();
})) }))
+13 -1
View File
@@ -17,6 +17,7 @@ import { EventsService } from './events.service';
import { SortService } from './functions/sort.service'; import { SortService } from './functions/sort.service';
import { customTask } from '../models/dailyworktask.model'; import { customTask } from '../models/dailyworktask.model';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -75,10 +76,21 @@ export class TaskService {
this.updateAllProcess(); this.updateAllProcess();
this.updateCount() this.updateCount()
this.runCallback(); this.runCallback();
document.addEventListener('resume', function () {
this.loadAllTask();
});
} }
registerCallback({funx, id}) { registerCallback({funx, id = uuidv4()}) {
this.callbacks[id] = { funx, id} this.callbacks[id] = { funx, id}
return {
delete: ()=> {
delete this.callbacks[id]
}
}
} }
runCallback() { runCallback() {
@@ -29,47 +29,42 @@ export class AllProcessesPage implements OnInit {
AllProcess = [] AllProcess = []
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
constructor( constructor(
private router: Router, private router: Router,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public TaskService: TaskService, public TaskService: TaskService,
private route: ActivatedRoute
) {} ) {}
ngOnInit() { ngOnInit() {
// this.updateAllProcess() // this.updateAllProcess()
this.checkFilter(); this.checkFilter();
}
this.router.events.forEach((event) => { ngAfterViewInit(): void {
if (event instanceof NavigationEnd && event.url.includes('/home/gabinete-digital')) {
// this.refreshing();
this.checkFilter();
}
});
this.listSubscription = this.TaskService.registerCallback({
setTimeout(() => {
// this.miniSearch.addAll(this.TaskService.AllProcess)
// window['miniSearch'] = this.miniSearch
this.TaskService.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
}, 10)
this.TaskService.registerCallback({
id: import.meta.url, id: import.meta.url,
funx:() => { funx:() => {
this.dynamicSearch() this.dynamicSearch()
} }
}) })
this.dynamicSearch();
} }
ngOnDestroy() {
this.listSubscription.delete()
}
openSearch() { openSearch() {
// this.dynamicSearch() // this.dynamicSearch()
} }
@@ -33,7 +33,7 @@ export class DespachosPrPage implements OnInit {
listSubscription : { listSubscription : {
delete(): void; delete(): void;
} }
routerSubscription;
constructor ( constructor (
private router: Router, private router: Router,
@@ -54,15 +54,29 @@ constructor (
funx:() => { funx:() => {
this.dynamicSearch() this.dynamicSearch()
this.LoadList()
} }
}) })
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?despachospr=true')) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing()
} else {
this.LoadList()
}
}
});
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
} }
ngOnDestroy() { ngOnDestroy() {
this.listSubscription.delete() this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
} }
changeFilterName(filterName) { changeFilterName(filterName) {
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { customTask } from '../../../models/dailyworktask.model'; import { customTask } from '../../../models/dailyworktask.model';
import { NavigationStart, Router } from '@angular/router'; import { NavigationEnd, NavigationStart, Router, } from '@angular/router';
import { DespachoService } from 'src/app/Rules/despacho.service'; import { DespachoService } from 'src/app/Rules/despacho.service';
import { TaskService } from 'src/app/services/task.service'; import { TaskService } from 'src/app/services/task.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
@@ -20,6 +20,12 @@ export class DespachosPage implements OnInit {
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor ( constructor (
private router: Router, private router: Router,
private despachoRule: DespachoService, private despachoRule: DespachoService,
@@ -29,26 +35,34 @@ export class DespachosPage implements OnInit {
ngOnInit() { ngOnInit() {
// this.LoadList(); this.LoadList()
this.router.events.forEach((event) => { this.listSubscription = this.TaskService.despachoStore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.dynamicSearch();
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital?despachos=true')) { if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital?despachos=true')) {
this.LoadList() this.LoadList()
} }
}); });
this.TaskService.despachoStore.registerCallback({ window['gabinete-aside-refresh'] = () => {
id: import.meta.url, this.LoadList()
funx:() => { }
this.list = this.TaskService.despachoStore.list.filter(task => this.TaskService.filter(task, this.filterName)) }
}
})
this.dynamicSearch();
ngOnDestroy() {
console.log('destroy')
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
} }
reorderList(orderBy: string) { reorderList(orderBy: string) {
@@ -28,28 +28,51 @@ export class DiplomasAssinarPage implements OnInit {
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor( constructor(
private processes:ProcessesService,
private router: Router, private router: Router,
private sortService: SortService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public TaskService: TaskService public TaskService: TaskService
) {} ) {}
ngOnInit() { ngOnInit() {
// this.LoadList() this.dynamicSearch()
this.LoadList()
this.router.events.forEach((event) => {
this.listSubscription = this.deplomasStore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart && '/home/gabinete-digital?diplomasassinar=true'.startsWith(event.url)) { if (event instanceof NavigationStart && '/home/gabinete-digital?diplomasassinar=true'.startsWith(event.url)) {
this.LoadList() this.LoadList()
} }
}); });
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
this.dynamicSearch() this.dynamicSearch()
} }
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) { reorderList(orderBy: string) {
@@ -1,10 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router'; import { NavigationStart, Router } from '@angular/router';
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model'; import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { DeplomasStore } from 'src/app/store/deplomas.service'; import { DeplomasStore } from 'src/app/store/deplomas.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { SortService } from 'src/app/services/functions/sort.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
@@ -29,17 +27,35 @@ export class DiplomasGerarPage implements OnInit {
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor( constructor(
private processes:ProcessesService,
private router: Router, private router: Router,
private sortService: SortService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public TaskService: TaskService public TaskService: TaskService
) {} ) {}
ngOnInit() { ngOnInit() {
this.router.events.forEach((event) => { this.LoadList()
this.dynamicSearch()
this.listSubscription = this.deplomasStore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart && '/home/gabinete-digital/?gerarDiplomas=true'.startsWith(event.url)) { if (event instanceof NavigationStart && '/home/gabinete-digital/?gerarDiplomas=true'.startsWith(event.url)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.LoadList() this.LoadList()
@@ -51,8 +67,16 @@ export class DiplomasGerarPage implements OnInit {
} }
}); });
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
}
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
} }
goToDiploma(serialNumber:any){ goToDiploma(serialNumber:any){
@@ -1,11 +1,9 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router'; import { NavigationStart, Router } from '@angular/router';
import { DailyWorkTask } from '../../../models/dailyworktask.model'; import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { DeplomasStore } from 'src/app/store/deplomas.service'; import { DeplomasStore } from 'src/app/store/deplomas.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
@@ -36,22 +34,33 @@ export class DiplomasPage implements OnInit {
listDiplomasAssinadosPR = [] listDiplomasAssinadosPR = []
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor( constructor(
private processes:ProcessesService,
private router: Router, private router: Router,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private sortService: SortService,
public p: PermissionService, public p: PermissionService,
public TaskService: TaskService public TaskService: TaskService
) {} ) {}
ngOnInit() { ngOnInit() {
// update list
// this.LoadList()
this.router.events.forEach((event) => { this.LoadList()
if (event instanceof NavigationStart && '/home/gabinete-digital?diplomas=true'.startsWith(event.url)) { this.listSubscription = this.deplomasStore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart && ( '/home/gabinete-digital?diplomas=validar'.startsWith(event.url) || '/home/gabinete-digital?diplomas=validar'.startsWith(event.url)) ) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.LoadList() this.LoadList()
} else { } else {
@@ -59,11 +68,19 @@ export class DiplomasPage implements OnInit {
} }
} }
}); });
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
this.dynamicSearch(); this.dynamicSearch();
} }
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) { reorderList(orderBy: string) {
@@ -4,7 +4,6 @@ import { EventPerson } from 'src/app/models/eventperson.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { NavigationStart, Router } from '@angular/router'; import { NavigationStart, Router } from '@angular/router';
import { AuthService } from 'src/app/services/auth.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service'; import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
import { SortService } from 'src/app/services/functions/sort.service'; import { SortService } from 'src/app/services/functions/sort.service';
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
@@ -44,12 +43,16 @@ export class EventsToApprovePage implements OnInit {
list = [] list = []
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor( constructor(
private processes:ProcessesService, private processes:ProcessesService,
private modalController: ModalController, private modalController: ModalController,
private router: Router, private router: Router,
private userAuth: AuthService,
private sortService: SortService, private sortService: SortService,
private storage: Storage, private storage: Storage,
public eventService: EventsService, public eventService: EventsService,
@@ -66,10 +69,18 @@ export class EventsToApprovePage implements OnInit {
this.segment = this.eventService.calendarNamesAry[0].OwnerUserId this.segment = this.eventService.calendarNamesAry[0].OwnerUserId
} }
} }
this.LoadToApproveEvents()
// this.LoadToApproveEvents(); this.listSubscription = this.eventoaprovacaostore.registerCallback({
id: import.meta.url,
funx:() => {
this.router.events.forEach((event) => { this.dynamicSearch()
}
})
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
'/home/gabinete-digital?eventos=true'.startsWith(event.url)) { '/home/gabinete-digital?eventos=true'.startsWith(event.url)) {
@@ -80,10 +91,20 @@ export class EventsToApprovePage implements OnInit {
} }
} }
}); });
window['gabinete-aside-refresh'] = () => {
this.LoadToApproveEvents()
}
this.dynamicSearch()
this.dynamicSearch();
} }
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) { reorderList(orderBy: string) {
@@ -36,6 +36,13 @@ export class ExpedientesPrPage implements OnInit {
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>(); @Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
listSubscription : {
delete(): void;
}
routerSubscription;
constructor( constructor(
private processes:ProcessesService, private processes:ProcessesService,
private router: Router, private router: Router,
@@ -48,9 +55,19 @@ export class ExpedientesPrPage implements OnInit {
ngOnInit() { ngOnInit() {
// this.LoadList() this.LoadList()
this.router.events.forEach((event) => { this.listSubscription = this.expedienteGdStore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientespr=true') || event.url.startsWith('/home/gabinete-digital?expedientespr=true') ||
event instanceof NavigationStart && event instanceof NavigationStart &&
@@ -59,17 +76,21 @@ export class ExpedientesPrPage implements OnInit {
event.url.startsWith('/home/gabinete-digital?expedientes=true' )) { event.url.startsWith('/home/gabinete-digital?expedientes=true' )) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing() this.LoadList()
} else { } else {
this.LoadList() this.LoadList()
} }
} }
}); });
this.dynamicSearch() this.dynamicSearch();
} }
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) { reorderList(orderBy: string) {
@@ -30,13 +30,18 @@ export class ExpedientsPage implements OnInit {
list = [] list = []
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor( constructor(
private processes: ProcessesService, private processes: ProcessesService,
private router: Router, private router: Router,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private sortService: SortService, private sortService: SortService,
private storage: Storage,
private eventTriger: EventTrigger, private eventTriger: EventTrigger,
public TaskService: TaskService public TaskService: TaskService
) { ) {
@@ -53,20 +58,39 @@ export class ExpedientsPage implements OnInit {
ngOnInit() { ngOnInit() {
//Inicializar segment //Inicializar segment
this.segment = "expedientes"; this.segment = "expedientes";
// this.LoadList() this.LoadList()
this.router.events.forEach((event) => {
this.listSubscription = this.expedientegbstore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes=true')) { event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
this.LoadList() this.LoadList()
} }
}); });
this.dynamicSearch() window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
this.dynamicSearch();
} }
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) { reorderList(orderBy: string) {
@@ -48,6 +48,13 @@ export class PedidosPage implements OnInit {
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor( constructor(
private router: Router, private router: Router,
private processes:ProcessesService, private processes:ProcessesService,
@@ -61,7 +68,18 @@ export class PedidosPage implements OnInit {
ngOnInit() { ngOnInit() {
this.router.events.forEach((event) => { this.LoadList()
this.listSubscription = this.pedidosstore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.dynamicSearch();
this.routerSubscription = this.router.events.subscribe((event) => {
if(event instanceof NavigationStart && '/home/gabinete-digital?parecer=true'.startsWith(event.url) || if(event instanceof NavigationStart && '/home/gabinete-digital?parecer=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital?deferimento=true'.startsWith(event.url) || event instanceof NavigationStart && '/home/gabinete-digital?deferimento=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital?pedidos=true'.startsWith(event.url) event instanceof NavigationStart && '/home/gabinete-digital?pedidos=true'.startsWith(event.url)
@@ -76,11 +94,16 @@ export class PedidosPage implements OnInit {
} }
}); });
window['gabinete-aside-refresh'] = () => {
this.dynamicSearch() this.LoadList()
}
} }
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) { reorderList(orderBy: string) {
@@ -35,20 +35,36 @@ export class PendentesPage implements OnInit {
hideSearchBtn: boolean = false; hideSearchBtn: boolean = false;
ordinance: string = 'old' ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor( constructor(
private processes:ProcessesService, private processes:ProcessesService,
private router: Router, private router: Router,
private sortService: SortService, private sortService: SortService,
private storage: Storage, private storage: Storage,
public TaskService: TaskService, public TaskService: TaskService,
public ThemeService: ThemeService public ThemeService: ThemeService) {
) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
} }
ngOnInit() { ngOnInit() {
this.router.events.forEach((event) => { this.LoadList()
this.listSubscription = this.pendentesstore.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.dynamicSearch();
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?pendentes=true')) { event.url.startsWith('/home/gabinete-digital?pendentes=true')) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
@@ -60,7 +76,16 @@ export class PendentesPage implements OnInit {
}); });
this.dynamicSearch() window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
}
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
} }
reorderList(orderBy: string) { reorderList(orderBy: string) {
@@ -11,6 +11,7 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process.
import { AttachmentList } from 'src/app/models/Excludetask'; import { AttachmentList } from 'src/app/models/Excludetask';
import { DespachoService } from 'src/app/Rules/despacho.service'; import { DespachoService } from 'src/app/Rules/despacho.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service'
@Component({ @Component({
selector: 'app-deploma-options', selector: 'app-deploma-options',
@@ -35,7 +36,8 @@ export class DeplomaOptionsPage implements OnInit {
private RouteService: RouteService, private RouteService: RouteService,
public p: PermissionService, public p: PermissionService,
private despachoService: DespachoService, private despachoService: DespachoService,
private httpErroHandle: HttpErrorHandle) { private httpErroHandle: HttpErrorHandle,
public TaskService: TaskService) {
this.serialNumber = this.navParams.get('serialNumber'); this.serialNumber = this.navParams.get('serialNumber');
this.task = this.navParams.get('task'); this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask'); this.fulltask = this.navParams.get('fulltask');
@@ -319,6 +321,7 @@ export class DeplomaOptionsPage implements OnInit {
goBack() { goBack() {
this.RouteService.goBack() this.RouteService.goBack()
this.TaskService.loadDiplomas()
} }
@@ -399,6 +399,7 @@ export class DespachosPrOptionsPage implements OnInit {
goBack() { goBack() {
this.RouteService.goBack(); this.RouteService.goBack();
this.TaskService.loadDiplomas()
} }
cancle() { cancle() {
@@ -9,6 +9,8 @@ import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { customTask, fullTask } from 'src/app/models/dailyworktask.model'; import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
import { RouteService } from 'src/app/services/route.service';
import { TaskService } from 'src/app/services/task.service'
@Component({ @Component({
selector: 'app-diplomas-gerar-options', selector: 'app-diplomas-gerar-options',
@@ -30,6 +32,8 @@ export class DiplomasGerarOptionsPage implements OnInit {
private despachoService: DespachoService, private despachoService: DespachoService,
private navParams: NavParams, private navParams: NavParams,
private router: Router, private router: Router,
private RouteService: RouteService,
public TaskService: TaskService
) { } ) { }
ngOnInit() { ngOnInit() {
@@ -178,7 +182,8 @@ export class DiplomasGerarOptionsPage implements OnInit {
goBack() { goBack() {
this.popoverController.dismiss(); this.popoverController.dismiss();
this.router.navigate(['/home/gabinete-digital/diplomas-gerar']); this.RouteService.goBack();
this.TaskService.loadDespachos();
} }
} }
@@ -15,6 +15,7 @@ import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service'
@Component({ @Component({
selector: 'app-opts-expediente-pr', selector: 'app-opts-expediente-pr',
@@ -51,7 +52,8 @@ export class OptsExpedientePrPage implements OnInit {
private RouteService: RouteService, private RouteService: RouteService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public p: PermissionService, public p: PermissionService,
private httpErrorHandle: HttpErrorHandle private httpErrorHandle: HttpErrorHandle,
public TaskService: TaskService
) { ) {
@@ -333,6 +335,7 @@ export class OptsExpedientePrPage implements OnInit {
goBack() { goBack() {
this.RouteService.goBack() this.RouteService.goBack()
this.TaskService.loadExpedientes()
} }
getAttachments(serialNumber){ getAttachments(serialNumber){
@@ -89,6 +89,7 @@ export class OptsExpedientePage implements OnInit {
} }
goBack() { goBack() {
this.TaskService.loadExpedientes()
this.RouteService.goBack() this.RouteService.goBack()
} }
+9 -1
View File
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { localstoreService } from './localstore.service' import { localstoreService } from './localstore.service'
import { AES, enc, SHA1 } from 'crypto-js' import { AES, enc, SHA1 } from 'crypto-js'
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@@ -66,8 +67,15 @@ export class DeplomasService {
} }
registerCallback({funx, id}) { registerCallback({funx, id = uuidv4()}) {
this.callbacks[id] = { funx, id} this.callbacks[id] = { funx, id}
return {
delete: ()=> {
delete this.callbacks[id]
}
}
} }
runCallback() { runCallback() {
+10 -1
View File
@@ -4,6 +4,8 @@ import { SHA1 } from 'crypto-js'
import { customTask } from '../models/dailyworktask.model'; import { customTask } from '../models/dailyworktask.model';
import { ObjectQueryService } from '../services/object-query.service'; import { ObjectQueryService } from '../services/object-query.service';
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@@ -41,8 +43,15 @@ export class DespachoStoreService {
} }
registerCallback({funx, id}) { registerCallback({funx, id = uuidv4()}) {
this.callbacks[id] = { funx, id} this.callbacks[id] = { funx, id}
return {
delete: ()=> {
delete this.callbacks[id]
}
}
} }
+9 -1
View File
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { localstoreService } from './localstore.service' import { localstoreService } from './localstore.service'
import { AES, enc, SHA1 } from 'crypto-js' import { AES, enc, SHA1 } from 'crypto-js'
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -34,8 +35,15 @@ constructor() {
} }
registerCallback({funx, id}) { registerCallback({funx, id = uuidv4()}) {
this.callbacks[id] = { funx, id} this.callbacks[id] = { funx, id}
return {
delete: ()=> {
delete this.callbacks[id]
}
}
} }
runCallback() { runCallback() {
@@ -4,6 +4,7 @@ import { AES, enc, SHA1 } from 'crypto-js'
import { isArray } from 'ionic-angular/umd/util/util'; import { isArray } from 'ionic-angular/umd/util/util';
import { EventoApprovePipe } from 'src/app/pipes/evento-approve.pipe' import { EventoApprovePipe } from 'src/app/pipes/evento-approve.pipe'
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -49,8 +50,15 @@ export class EventoaprovacaoStoreService {
} }
registerCallback({funx, id}) { registerCallback({funx, id = uuidv4()}) {
this.callbacks[id] = { funx, id} this.callbacks[id] = { funx, id}
return {
delete: ()=> {
delete this.callbacks[id]
}
}
} }
runCallback() { runCallback() {
+9 -1
View File
@@ -3,6 +3,7 @@ import { localstoreService } from './localstore.service'
import { SHA1 } from 'crypto-js' import { SHA1 } from 'crypto-js'
import { ExpedienteTask } from '../models/dailyworktask.model'; import { ExpedienteTask } from '../models/dailyworktask.model';
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -38,8 +39,15 @@ export class ExpedientegdStoreService {
} }
registerCallback({funx, id}) { registerCallback({funx, id = uuidv4()}) {
this.callbacks[id] = { funx, id} this.callbacks[id] = { funx, id}
return {
delete: ()=> {
delete this.callbacks[id]
}
}
} }
runCallback() { runCallback() {
+10 -1
View File
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { localstoreService } from './localstore.service' import { localstoreService } from './localstore.service'
import { AES, enc, SHA1 } from 'crypto-js' import { AES, enc, SHA1 } from 'crypto-js'
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -47,10 +48,18 @@ export class PedidosStoreService {
} }
registerCallback({funx, id}) { registerCallback({funx, id = uuidv4()}) {
this.callbacks[id] = { funx, id} this.callbacks[id] = { funx, id}
return {
delete: ()=> {
delete this.callbacks[id]
}
}
} }
runCallback() { runCallback() {
for (const [key, value] of Object.entries(this.callbacks)) { for (const [key, value] of Object.entries(this.callbacks)) {
value.funx() value.funx()
+9 -2
View File
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { localstoreService } from './localstore.service' import { localstoreService } from './localstore.service'
import { AES, enc, SHA1 } from 'crypto-js' import { AES, enc, SHA1 } from 'crypto-js'
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@@ -38,8 +38,15 @@ export class PendestesStoreService {
} }
registerCallback({funx, id}) { registerCallback({funx, id = uuidv4()}) {
this.callbacks[id] = { funx, id} this.callbacks[id] = { funx, id}
return {
delete: ()=> {
delete this.callbacks[id]
}
}
} }
runCallback() { runCallback() {
+2 -2
View File
@@ -1,6 +1,6 @@
import { Environment } from './../app/models/envarioment' import { Environment } from './../app/models/envarioment'
import { oaprProd } from './suport/oapr' import { oaprProd } from './suport/oapr'
import { doneITProd } from './suport/doneIt' import { doneITProd } from './suport/doneIt'
import { DevDev } from './suport/dev'
export const environment: Environment = DevDev;
export const environment: Environment = doneITProd;
+2 -2
View File
@@ -9,7 +9,7 @@ export const oaprProd: Environment = {
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket',
logoLabel: 'Presidente da República', logoLabel: 'Presidente da República',
despachoLabel: 'Presidencial', despachoLabel: 'Presidencial',
despachoLabel2: 'Despachos Presidenciais', despachoLabel2: 'Despachos Presidênciais',
production: false, production: false,
domain: 'oapr.gov.ao', domain: 'oapr.gov.ao',
defaultuser: '', defaultuser: '',
@@ -21,7 +21,7 @@ export const oaprProd: Environment = {
agendaVP: 'Agenda do MD', agendaVP: 'Agenda do MD',
PR: 'PR', PR: 'PR',
VP: '', VP: '',
dispatchPR: 'Despachos Presidenciais', dispatchPR: 'Despachos Presidênciais',
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712' sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712'
}; };
File diff suppressed because one or more lines are too long