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
@@ -29,47 +29,42 @@ export class AllProcessesPage implements OnInit {
AllProcess = []
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
constructor(
private router: Router,
public ThemeService: ThemeService,
public TaskService: TaskService,
private route: ActivatedRoute
) {}
ngOnInit() {
// this.updateAllProcess()
this.checkFilter();
}
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.includes('/home/gabinete-digital')) {
// this.refreshing();
this.checkFilter();
}
});
ngAfterViewInit(): void {
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({
this.listSubscription = this.TaskService.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
this.dynamicSearch();
}
ngOnDestroy() {
this.listSubscription.delete()
}
openSearch() {
// this.dynamicSearch()
}
@@ -33,7 +33,7 @@ export class DespachosPrPage implements OnInit {
listSubscription : {
delete(): void;
}
routerSubscription;
constructor (
private router: Router,
@@ -54,15 +54,29 @@ constructor (
funx:() => {
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() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
changeFilterName(filterName) {
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
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 { TaskService } from 'src/app/services/task.service';
import { ThemeService } from 'src/app/services/theme.service'
@@ -20,6 +20,12 @@ export class DespachosPage implements OnInit {
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor (
private router: Router,
private despachoRule: DespachoService,
@@ -29,26 +35,34 @@ export class DespachosPage implements OnInit {
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')) {
this.LoadList()
}
});
this.TaskService.despachoStore.registerCallback({
id: import.meta.url,
funx:() => {
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
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) {
@@ -28,28 +28,51 @@ export class DiplomasAssinarPage implements OnInit {
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private processes:ProcessesService,
private router: Router,
private sortService: SortService,
public ThemeService: ThemeService,
public TaskService: TaskService
) {}
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)) {
this.LoadList()
}
});
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
this.dynamicSearch()
}
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) {
@@ -1,10 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { DeplomasStore } from 'src/app/store/deplomas.service';
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 { TaskService } from 'src/app/services/task.service'
@@ -29,17 +27,35 @@ export class DiplomasGerarPage implements OnInit {
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private processes:ProcessesService,
private router: Router,
private sortService: SortService,
public ThemeService: ThemeService,
public TaskService: TaskService
) {}
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(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
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){
@@ -1,11 +1,9 @@
import { Component, Input, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { DeplomasStore } from 'src/app/store/deplomas.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 { TaskService } from 'src/app/services/task.service'
@@ -36,22 +34,33 @@ export class DiplomasPage implements OnInit {
listDiplomasAssinadosPR = []
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private processes:ProcessesService,
private router: Router,
public ThemeService: ThemeService,
private sortService: SortService,
public p: PermissionService,
public TaskService: TaskService
) {}
ngOnInit() {
// update list
// this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && '/home/gabinete-digital?diplomas=true'.startsWith(event.url)) {
this.LoadList()
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')) {
this.LoadList()
} else {
@@ -59,11 +68,19 @@ export class DiplomasPage implements OnInit {
}
}
});
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
this.dynamicSearch();
}
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) {
@@ -4,7 +4,6 @@ import { EventPerson } from 'src/app/models/eventperson.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular';
import { NavigationStart, Router } from '@angular/router';
import { AuthService } from 'src/app/services/auth.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
import { SortService } from 'src/app/services/functions/sort.service';
import { Storage } from '@ionic/storage';
@@ -44,12 +43,16 @@ export class EventsToApprovePage implements OnInit {
list = []
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private processes:ProcessesService,
private modalController: ModalController,
private router: Router,
private userAuth: AuthService,
private sortService: SortService,
private storage: Storage,
public eventService: EventsService,
@@ -66,10 +69,18 @@ export class EventsToApprovePage implements OnInit {
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 &&
'/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) {
@@ -36,6 +36,13 @@ export class ExpedientesPrPage implements OnInit {
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private processes:ProcessesService,
private router: Router,
@@ -48,9 +55,19 @@ export class ExpedientesPrPage implements OnInit {
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 &&
event.url.startsWith('/home/gabinete-digital?expedientespr=true') ||
event instanceof NavigationStart &&
@@ -59,17 +76,21 @@ export class ExpedientesPrPage implements OnInit {
event.url.startsWith('/home/gabinete-digital?expedientes=true' )) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing()
this.LoadList()
} else {
this.LoadList()
}
}
});
this.dynamicSearch()
this.dynamicSearch();
}
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) {
@@ -30,13 +30,18 @@ export class ExpedientsPage implements OnInit {
list = []
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private processes: ProcessesService,
private router: Router,
public ThemeService: ThemeService,
private sortService: SortService,
private storage: Storage,
private eventTriger: EventTrigger,
public TaskService: TaskService
) {
@@ -53,20 +58,39 @@ export class ExpedientsPage implements OnInit {
ngOnInit() {
//Inicializar segment
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 &&
event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
this.LoadList()
}
});
this.dynamicSearch()
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
this.dynamicSearch();
}
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) {
@@ -48,6 +48,13 @@ export class PedidosPage implements OnInit {
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private router: Router,
private processes:ProcessesService,
@@ -61,7 +68,18 @@ export class PedidosPage implements OnInit {
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) ||
event instanceof NavigationStart && '/home/gabinete-digital?deferimento=true'.startsWith(event.url) ||
event instanceof NavigationStart && '/home/gabinete-digital?pedidos=true'.startsWith(event.url)
@@ -76,11 +94,16 @@ export class PedidosPage implements OnInit {
}
});
this.dynamicSearch()
window['gabinete-aside-refresh'] = () => {
this.LoadList()
}
}
ngOnDestroy() {
this.listSubscription.delete()
this.routerSubscription?.unsubscribe();
}
reorderList(orderBy: string) {
@@ -35,20 +35,36 @@ export class PendentesPage implements OnInit {
hideSearchBtn: boolean = false;
ordinance: string = 'old'
listSubscription : {
delete(): void;
}
routerSubscription;
constructor(
private processes:ProcessesService,
private router: Router,
private sortService: SortService,
private storage: Storage,
public TaskService: TaskService,
public ThemeService: ThemeService
) {
public ThemeService: ThemeService) {
this.loggeduser = SessionStore.user;
}
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 &&
event.url.startsWith('/home/gabinete-digital?pendentes=true')) {
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) {