add counting

This commit is contained in:
Peter Maquiran
2021-08-25 08:51:52 +01:00
parent 49eef76e6b
commit 7c2a2152e9
12 changed files with 34 additions and 23 deletions
@@ -25,15 +25,15 @@ export class DocumentCounterService {
constructor() { }
// falta a contagem dos deplomas
get mdTotalDocument() {
get mdTotalDocument(): number {
return this.despachoStore.count + this.expedienteGbStore.count + this.pedidosStore.countdeferimento
+ this.pedidosStore.countparecer + this.expedientePrStore.count + this.despachoPrStore.count + this.pendentesStore.count
+ this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasListCount
+ this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasAssinadoListCount + this.deplomasStore.deplomasReviewCount
}
get prTotalDocument() {
get prTotalDocument(): number {
return this.despachoStore.count + this.expedienteGbStore.count + this.pedidosStore.countdeferimento
+ this.pedidosStore.countparecer + this.expedientePrStore.count + this.despachoPrStore.count + this.pendentesStore.count
+ this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasListCount
+ this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasAssinadoListCount + this.deplomasStore.deplomasReviewCount
}
}
+2 -2
View File
@@ -15,8 +15,8 @@
<ion-tab-button tab="gabinete-digital">
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
<ion-badge color="danger" *ngIf="p.userRole(['MDGPR'])" >{{ totalDocumentStore.count }}</ion-badge>
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ totalDocumentStore.count }}</ion-badge>
<ion-badge color="danger" *ngIf="!p.userRole(['PR'])" >{{ documentCounterService.mdTotalDocument }}</ion-badge>
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge>
<ion-label>Gabinete</ion-label>
</ion-tab-button>
<ion-tab-button tab="publications">
+2 -2
View File
@@ -73,9 +73,9 @@ export class HomePage implements OnInit {
private notificatinsservice: NotificationsService,
private platform: Platform,
private activeroute: ActivatedRoute,
public documentCounterService: DocumentCounterService,
// private network: NetworkService,
public p: PermissionService) {
public p: PermissionService,
public documentCounterService: DocumentCounterService) {
this.router.events.subscribe((val) => {
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
@@ -103,7 +103,7 @@
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Eventos para Aprovação</p>
<p class="text-center exp-card-content">{{eventoaprovacaostore.count}} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content">{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
</div>
<div [class.active]="selectedElement == 'Correspondence'" (click)="openExpedientListPage(); selectedElement='Correspondence'" class="exp-card d-flex flex-column justify-center" *ngIf="loggeduser.Profile == 'MDGPR'">
@@ -501,6 +501,18 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
break;
}
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
let mdEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
const eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
this.eventoaprovacaostore.resetmd(eventsMDGPRList);
let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR', false).toPromise();
let prEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal PR', false).toPromise();
const eventsPRList = prEventsOficial.concat(prEventsPessoal);
this.eventoaprovacaostore.resetpr(eventsPRList);
let diplomasValidar = despachospr.filter(data => data.activityInstanceName == "Revisar Diploma");
this.count_dip_pv = Object.keys(diplomasValidar).length;
this.deplomasStore.resetDiplomasReview(diplomasValidar)
@@ -518,7 +530,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.processesbackend.GetToApprovedEvents('Agenda','true').subscribe(res=>{
this.count_ev_apr = res;
});
this.eventoaprovacaostore.count;
this.showLoader = false;
+1 -1
View File
@@ -31,7 +31,7 @@ export class DespachoStoreService {
}
get count() {
return this._count
return this._count || 0
}
set count(value: number) {
+1 -1
View File
@@ -30,7 +30,7 @@ get list() {
return this._list || []
}
get count() { return this._count }
get count() { return this._count || 0 }
set count(value: number) {
this._count = value
this.save()
@@ -39,17 +39,17 @@ export class EventoaprovacaoStoreService {
get listpr() { return this._listPr }
get listmd() { return this._listMd }
get count() { return this._count }
get count() { return this._count || 0 }
set count(value: number) {
this._count = value
}
get countPr() { return this._countPr }
set countPr (value) {
get countPr() { return this._countPr || 0 }
set countPr (value: number) {
this._countPr = value
}
get countMd() { return this._countMd }
get countMd() { return this._countMd || 0 }
set countMd (value) {
this._countMd = value
}
@@ -72,7 +72,7 @@ export class EventoaprovacaoStoreService {
}
private saveMd() {
setTimeout(()=>{
setTimeout(()=>{
localstoreService.set(this.keyNamemd,{
lisMd: this._listMd,
countListMd: this._countMd
@@ -80,6 +80,7 @@ export class EventoaprovacaoStoreService {
}, 10)
}
private savePr() {
setTimeout(()=>{
localstoreService.set(this.keyNamepr,{
+1 -1
View File
@@ -29,7 +29,7 @@ export class ExpedientegdStoreService {
return this._list
}
get count() {
return this._count
return this._count || 0
}
set count(value: number) {
this._count = value
+1 -1
View File
@@ -26,7 +26,7 @@ export class ExpedienteprStoreService {
get list() { return this._list || [] }
get count() { return this._count }
get count() { return this._count || 0 }
set count(value: number) {
this._count = value
this.save()
+2 -2
View File
@@ -42,7 +42,7 @@ export class PedidosStoreService {
}
get countparecer() {
return this._countparecer
return this._countparecer || 0
}
set countparecer(value: number) {
this._countparecer = value
@@ -50,7 +50,7 @@ export class PedidosStoreService {
}
get countdeferimento() {
return this._countDeferiemnto
return this._countDeferiemnto || 0
}
set countdeferimento(value: number ) {
this._countDeferiemnto = value
+1 -2
View File
@@ -31,8 +31,7 @@ export class PendestesStoreService {
}
get count() {
return this._count
this.save()
return this._count || 0
}
set count(value) {
this._count = value