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 { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service'
@Component({
@@ -27,7 +28,8 @@ export class EventActionsPopoverPage implements OnInit {
private toastService: ToastService,
private RouteService: RouteService,
private httpErrorHandle: HttpErrorHandle,
public ThemeService: ThemeService) {
public ThemeService: ThemeService,
public TaskService: TaskService) {
this.serialNumber = this.navParams.get('serialNumber');
this.instanceId = this.navParams.get('InstanceId');
this.activityInstanceName = this.navParams.get('InstanceId');
@@ -58,7 +60,7 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise()
this.TaskService.loadEventosParaAprovacao()
this.httpErrorHandle.httpsSucessMessagge('Evento aprovação')
this.goBack();
} catch (error) {
@@ -77,7 +79,7 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise()
this.TaskService.loadEventosParaAprovacao()
this.httpErrorHandle.httpsSucessMessagge('Rever')
this.goBack();
} catch (error) {
@@ -121,6 +123,7 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise();
this.httpErrorHandle.httpsSucessMessagge('Rever')
this.TaskService.loadEventosParaAprovacao()
this.goBack();
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
@@ -145,6 +148,7 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
this.TaskService.loadEventosParaAprovacao()
this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
this.goBack();
} catch (error) {
+1 -1
View File
@@ -26,7 +26,7 @@
<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;">
<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">
<p class="time ion-text-left ">{{customDate}}</p>
<div class="wrap d-flex float-left">
+19 -7
View File
@@ -72,6 +72,10 @@ export class EventsPage implements OnInit {
searchSubject: string = '';
AllProcess = []
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
constructor(
private eventService: EventsService,
@@ -87,12 +91,7 @@ export class EventsPage implements OnInit {
private changeProfileService: ChangeProfileService,
public TaskService: TaskService
) {
this.loadAllTask();
window['zipPhoneCallback'] = function (zipphone) {
var frame = document.getElementById('home-iframe');
if(frame) {
@@ -101,18 +100,30 @@ export class EventsPage implements OnInit {
}
this.changeProfileService.registerCallback(() => {
this.listToPresent = [];
this.listToPresentexpediente = []
})
this.TaskService.registerCallback({
}
ngAfterViewInit(): void {
this.loadAllTask();
this.listSubscription = this.TaskService.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.dynamicSearch()
}
ngOnDestroy() {
this.listSubscription.delete()
}
ngOnInit() {
@@ -170,6 +181,7 @@ export class EventsPage implements OnInit {
async loadAllTask() {
this.loadingAllTask = true
await this.TaskService.LoadTask()
this.dynamicSearch()
this.loadingAllTask = false
}
@@ -403,7 +403,7 @@ export class DespachoPrPage implements OnInit {
}
this.TaskService.loadDiplomas()
// this.goBack();
this.goBack();
}
});
}
@@ -1,17 +1,16 @@
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 { ProcessesService } from 'src/app/services/processes.service';
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 { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
import { ToastService } from 'src/app/services/toast.service';
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 { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
@@ -47,15 +46,10 @@ export class DiplomaPage implements OnInit {
private processes: ProcessesService,
public popoverController: PopoverController,
private modalController: ModalController,
private iab: InAppBrowser,
private activatedRoute: ActivatedRoute,
private router: Router,
private animationController: AnimationController,
private toastService: ToastService,
private RouteService: RouteService,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
private platform: Platform,
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle,
private despachoService: DespachoService,
@@ -1,8 +1,8 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
import { ProcessesService } from 'src/app/services/processes.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 { DeplomasStore } from 'src/app/store/deplomas.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@@ -39,6 +39,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
private router: Router,
private activatedRoute: ActivatedRoute,
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
public p: PermissionService,
public TaskService: TaskService,
private RouteService: RouteService,
@@ -1,6 +1,6 @@
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
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 { ProcessesService } from 'src/app/services/processes.service';
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 { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { SqliteService } from '../../../../services/sqlite.service';
import { BackgroundService } from '../../../../services/background.service';
import { Platform } from '@ionic/angular';
import { ThemeService } from 'src/app/services/theme.service'
import { OfflineManagerService } from 'src/app/services/offline-manager.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 { TaskService } from 'src/app/services/task.service'
@@ -55,12 +52,9 @@ export class ApproveEventPage implements OnInit {
private menu: MenuController,
private toastService: ToastService,
private RouteService: RouteService,
private sqliteservice: SqliteService,
private platform: Platform,
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
private offlineManager: OfflineManagerService,
private storage: Storage,
private httpErrorHandle: HttpErrorHandle,
public TaskService: TaskService
) {
@@ -55,7 +55,7 @@
</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>
</button>
<div *ngIf="!hideRefreshBtn" class="title-icons">
@@ -260,7 +260,7 @@
<!-- This is the box view -->
<div *ngSwitchCase="'boxview'" class="aside d-flex flex-wrap width-100 height-100">
<div *ngIf="TaskService.loadCount" class="center-box">
<!-- List -->
<div *ngIf="hideInMobile" (click)="openAllProcessesPage()" [class.active]="selectedElement == 'allProcessesTag'" class="box-hover exp-card d-flex flex-column" >
<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>
</p>
<p class="text-center exp-card-content" > {{ AllProcess.length }}
<span class="title1" *ngIf="AllProcess.length == 0">Documento</span>
<span class="title1" *ngIf="AllProcess.length == 1">Documento</span>
<span class="title1" *ngIf="AllProcess.length > 1">Documentos</span>
<span class="title1" *ngIf="AllProcess.length == 0">correspondência</span>
<span class="title1" *ngIf="AllProcess.length == 1">correspondência</span>
<span class="title1" *ngIf="AllProcess.length > 1">correspondências</span>
</p>
</div>
<!-- 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 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>
</p>
<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 == 1">Documento</span>
<span class="title1" *ngIf="TaskService.despachoprstore.count > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.despachoprstore.count == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.despachoprstore.count == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.despachoprstore.count > 1">correspondências</span>
</p>
</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>
</p>
<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 == 1">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.countDiplomasAssinadoListCount > 1">correspondências</span>
</div>
@@ -348,9 +347,9 @@
</p>
<p class="text-center exp-card-content">
{{ TaskService.deplomasStore.diplomasParaAssinartCount }}
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 0">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 1">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount > 1">correspondências</span>
</p>
</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-content">
{{ TaskService.deplomasStore.deplomasReviewCount }}
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount == 0">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount == 1">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.deplomasReviewCount > 1">correspondências</span>
</p>
</div>
@@ -391,9 +390,9 @@
</p>
<p class="text-center exp-card-content">
{{ TaskService.deplomasStore.diplomasParaAssinartCount }}
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 0">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 1">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.diplomasParaAssinartCount > 1">correspondências</span>
</p>
</div>
@@ -415,9 +414,9 @@
</p>
<p class="text-center exp-card-content">
{{ TaskService.deplomasStore.DiplomaGerarList.length }}
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length == 0">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length == 1">Documento</span>
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.deplomasStore.DiplomaGerarList.length > 1">correspondências</span>
</p>
</div>
@@ -433,14 +432,15 @@
</p>
<p class="text-center exp-card-content">
{{TaskService.eventoaprovacaostore.countAll}}
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll == 0">Documento</span>
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll == 1">Documento</span>
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.eventoaprovacaostore.countAll > 1">correspondências</span>
</p>
</div>
<!-- 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">
<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>
@@ -456,9 +456,9 @@
<p class="text-center exp-card-content">
{{TaskService.expedientegbstore.count}}
<span class="title1" *ngIf="TaskService.expedientegbstore.count == 0">Documento</span>
<span class="title1" *ngIf="TaskService.expedientegbstore.count == 1">Documento</span>
<span class="title1" *ngIf="TaskService.expedientegbstore.count > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.expedientegbstore.count == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.expedientegbstore.count == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.expedientegbstore.count > 1">correspondências</span>
</p>
</div>
@@ -478,9 +478,9 @@
</p>
<p class="text-center exp-card-content">
{{TaskService.despachoStore.count}}
<span class="title1" *ngIf="TaskService.despachoStore.count == 0">Documento</span>
<span class="title1" *ngIf="TaskService.despachoStore.count == 1">Documento</span>
<span class="title1" *ngIf="TaskService.despachoStore.count > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.despachoStore.count == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.despachoStore.count == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.despachoStore.count > 1">correspondências</span>
</p>
</div>
@@ -508,9 +508,9 @@
</p>
<p class="text-center exp-card-content">
{{TaskService.pedidosstore.countparecer}}
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer == 0">Documento</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer == 1">Documento</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countparecer > 1">correspondências</span>
</p>
</div>
@@ -531,9 +531,9 @@
</p>
<p class="text-center exp-card-content">
{{ TaskService.pedidosstore.countdeferimento}}
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento == 0">Documento</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento == 1">Documento</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.pedidosstore.countdeferimento > 1">correspondências</span>
</p>
</div>
@@ -559,9 +559,9 @@
<p class="text-center exp-card-content">
<span class="number">{{TaskService.pendentesstore.count}} </span>
<span class="title1" *ngIf="TaskService.pendentesstore.count == 0">Documento</span>
<span class="title1" *ngIf="TaskService.pendentesstore.count == 1">Documento</span>
<span class="title1" *ngIf="TaskService.pendentesstore.count > 1">Documentos</span>
<span class="title1" *ngIf="TaskService.pendentesstore.count == 0">correspondência</span>
<span class="title1" *ngIf="TaskService.pendentesstore.count == 1">correspondência</span>
<span class="title1" *ngIf="TaskService.pendentesstore.count > 1">correspondências</span>
</div>
@@ -665,21 +665,21 @@
<!-- Aside right -->
<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-all-processes [profile]="profile" class=" height-100 flex-column" [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-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" *ngIf="showAllProcesses" [style.display]="showAllProcesses ? 'flex' : 'none'" ></app-all-processes>
<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-pedidos [profile]="profile" [segment]="segment" [serialNumber]="serialNumber" class=" height-100 flex-column" [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-pr [profile]="profile" class=" height-100 flex-column" [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-diplomas (openExpedientDetail)="openExpedientesPrPage($event)" [profile]="profile" [segment]="segment" class=" height-100 flex-column" [style.display]="showDiplomas ? 'flex' : 'none'"></app-diplomas>
<app-diplomas-assinar class=" height-100 flex-column" [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-signed-diploma [profile]="profile" class=" height-100 flex-column" [style.display]="showSignedDiploma ? 'flex' : 'none'" ></app-signed-diploma>
<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" *ngIf="showPedidos" [style.display]="showPedidos ? 'flex' : 'none'"></app-pedidos>
<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" *ngIf="showDespachosPr" [style.display]="showDespachosPr ? 'flex' : 'none'" ></app-despachos-pr>
<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" *ngIf="showDiplomas" [style.display]="showDiplomas ? 'flex' : 'none'"></app-diplomas>
<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" *ngIf="showExpedientesPr" [style.display]="showExpedientesPr ? 'flex' : 'none'" ></app-expedientes-pr>
<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>
</ion-content>
@@ -111,49 +111,21 @@ export class GabineteDigitalPage implements OnInit {
) {
window.onresize = (event) => {
// if not mobile remove all component
if (window.innerWidth < 701) {
this.modalController.dismiss();
this.hideRefreshBtn = false;
this.hideInMobile = false;
this.segmentVista = "listview";
}
else {
this.hideRefreshBtn = true;
this.hideInMobile = true;
this.segmentVista = "boxview";
}
}
this.checkRoutes();
// 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.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'
this.router.events.forEach((event) => {
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.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;
@@ -292,9 +281,6 @@ export class GabineteDigitalPage implements OnInit {
}
async loadAllProcesses() {
this.LoadCounts();
}
goto(url) {
@@ -353,18 +339,7 @@ export class GabineteDigitalPage implements OnInit {
}
hideRefreshButton() {
window.onresize = (event) => {
if (window.innerWidth < 701) {
this.hideRefreshBtn = false;
this.hideInMobile = false;
this.segmentVista = "listview";
}
else {
this.hideRefreshBtn = true;
this.hideInMobile = true;
this.segmentVista = "boxview";
}
}
console.log(this.router.url)
if (window.innerWidth < 701) {
this.hideRefreshBtn = 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() {
this.closeAllDesktopComponents();
@@ -417,11 +401,13 @@ export class GabineteDigitalPage implements OnInit {
}
else if (this.router.url == '/home/gabinete-digital?despachospr=true') {
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.selectedElement = 'DiplomasPorValidar';
}
else if (this.router.url == '/home/gabinete-digital?diplomasassinar=true') {
this.openDiplomasAssinarPage();
@@ -464,17 +450,26 @@ export class GabineteDigitalPage implements OnInit {
return Object.keys(this.loadProcess)
}
async LoadCounts() {
async loadAllProcesses() {
// this.skeletonLoader = true
await this.TaskService.LoadTask()
this.dynamicSearch()
// this.skeletonLoader = false
}
doRefreshAside() {
window['gabinete-aside-refresh']()
setTimeout(() => {
this.loadAllProcesses();
}, 1000)
}
doRefresh(event) {
this.LoadCounts();
this.loadAllProcesses();
if (event) {
setTimeout(() => {
@@ -634,9 +629,11 @@ export class GabineteDigitalPage implements OnInit {
let navigationExtras: NavigationExtras;
if (segment == 'validar') {
navigationExtras = { queryParams: { "validar": true, } };
navigationExtras = { queryParams: { "diplomas": 'validar', } };
this.selectedElement = 'DiplomasPorValidar';
} else if (segment == 'assinados') {
navigationExtras = { queryParams: { "assinados": true, } };
this.selectedElement = 'DiplomasAssinados';
navigationExtras = { queryParams: { "diplomas": 'assinados', } };
}
this.segment = segment;
@@ -646,10 +643,10 @@ export class GabineteDigitalPage implements OnInit {
}
else {
this.closeAllDesktopComponents();
this.segment = segment;
let navigationExtras: NavigationExtras = { queryParams: { "diplomas": true, } };
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') {
this.goBack()
}
this.TaskService.loadPedidos();
}))