centralize service

This commit is contained in:
Peter Maquiran
2023-04-17 16:00:30 +01:00
parent 9c835cde28
commit 955640e42e
8 changed files with 269 additions and 306 deletions
+2 -1
View File
@@ -83,7 +83,8 @@ export class EventsPage implements OnInit {
public TaskService: TaskService public TaskService: TaskService
) { ) {
this.TaskService.updateCount() // this.TaskService.updateCount()
this.TaskService.LoadTask()
window['zipPhoneCallback'] = function (zipphone) { window['zipPhoneCallback'] = function (zipphone) {
@@ -9,12 +9,12 @@
<!-- Aside left --> <!-- Aside left -->
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1"> <div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="TaskService.showLoader"></ion-progress-bar>
<div class="title-container"> <div class="title-container">
<div class="title"> <div class="title">
<ion-label>Gabinete Digital</ion-label> <ion-label>Gabinete Digital</ion-label>
</div> </div>
<button title="Atualizar" *ngIf="hideRefreshBtn && loadCount" class="btn-no-color btn-refresh" (click)="doRefresh($event)"> <button title="Atualizar" *ngIf="hideRefreshBtn && TaskService.loadCount" class="btn-no-color btn-refresh" (click)="doRefresh($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">
@@ -67,12 +67,12 @@
<div *ngSwitchCase="'listview'"> <div *ngSwitchCase="'listview'">
<ion-item-sliding *ngIf="loadCount || (getAllProcessCount >= 1 && loadNum >= 1)"> <ion-item-sliding *ngIf="TaskService.loadCount || (TaskService.AllProcess.length >= 1 && TaskService.loadNum >= 1)">
<div class="listview" > <div class="listview" >
<ion-list *ngIf="AllProcess"> <ion-list *ngIf="TaskService.AllProcess">
<div <div
class=" box-hover ion-no-padding cursor-pointer" class=" box-hover ion-no-padding cursor-pointer"
*ngFor = "let task of AllProcess" *ngFor = "let task of TaskService.AllProcess"
(click)="goToProcess(task.SerialNumber || task.serialNumber, task.WorkflowName || task.workflowName || task.workflowDisplayName || task.workflowName, task.activityInstanceName)"> (click)="goToProcess(task.SerialNumber || task.serialNumber, task.WorkflowName || task.workflowName || task.workflowDisplayName || task.workflowName, task.activityInstanceName)">
<div class="item-wrapper" *ngIf="TaskService.filter(task, filterName)"> <div class="item-wrapper" *ngIf="TaskService.filter(task, filterName)">
<div class="item width-100"> <div class="item width-100">
@@ -128,7 +128,7 @@
</ion-item-sliding> </ion-item-sliding>
<ion-item-sliding *ngIf="!loadCount" class="width-100"> <ion-item-sliding *ngIf="!TaskService.loadCount" class="width-100">
<ion-item lines="none" <ion-item lines="none"
class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding"> class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding">
@@ -174,7 +174,7 @@
<!-- This is the box view --> <!-- This is the box view -->
<div *ngSwitchCase="'boxview'" class="aside overflow-y-auto d-flex flex-wrap width-100 height-100"> <div *ngSwitchCase="'boxview'" class="aside overflow-y-auto d-flex flex-wrap width-100 height-100">
<div *ngIf="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" >
@@ -183,7 +183,7 @@
<fa-icon class="icon-selected" icon="align-justify"></fa-icon> <fa-icon class="icon-selected" icon="align-justify"></fa-icon>
</div> </div>
<p class="text-center exp-card-title ">Todas as tarefas</p> <p class="text-center exp-card-title ">Todas as tarefas</p>
<p class="text-center exp-card-content"> {{ getAllProcessCount }} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"> {{ TaskService.AllProcess.length }} <span class="title1">Documentos</span></p>
</div> </div>
<!-- List --> <!-- List -->
@@ -198,16 +198,16 @@
<!-- <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p> --> <!-- <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p> -->
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])"> <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">
Despachos {{ environment.despachoLabel }} <br> Despachos {{ environment.despachoLabel }} <br>
<span class="new-task-count" *ngIf="despachoprstore.newList.length >=2">{{ despachoprstore.newList.length}} Despachos {{ environment.despachoLabel }} novos </span> <span class="new-task-count" *ngIf="TaskService.despachoprstore.newList.length >=2">{{ TaskService.despachoprstore.newList.length}} Despachos {{ environment.despachoLabel }} novos </span>
<span class="new-task-count" *ngIf="despachoprstore.newList.length == 1">{{ despachoprstore.newList.length}} Despacho {{ environment.despachoLabel }} novo </span> <span class="new-task-count" *ngIf="TaskService.despachoprstore.newList.length == 1">{{ TaskService.despachoprstore.newList.length}} Despacho {{ environment.despachoLabel }} novo </span>
</p> </p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && !p.userPermission([p.permissionList.Gabinete.md_tasks])"> <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && !p.userPermission([p.permissionList.Gabinete.md_tasks])">
Despachos criados por mim<br> Despachos criados por mim<br>
<span class="new-task-count" *ngIf="despachoprstore.newList.length >=2">{{ despachoprstore.newList.length}} Despachos {{ environment.despachoLabel }} novos </span> <span class="new-task-count" *ngIf="TaskService.despachoprstore.newList.length >=2">{{ TaskService.despachoprstore.newList.length}} Despachos {{ environment.despachoLabel }} novos </span>
<span class="new-task-count" *ngIf="despachoprstore.newList.length ==1">{{ despachoprstore.newList.length}} Despacho {{ environment.despachoLabel }} novo </span> <span class="new-task-count" *ngIf="TaskService.despachoprstore.newList.length ==1">{{ TaskService.despachoprstore.newList.length}} Despacho {{ environment.despachoLabel }} novo </span>
</p> </p>
<p class="text-center exp-card-content"> {{ despachoprstore.count }} <p class="text-center exp-card-content"> {{ TaskService.despachoprstore.count }}
<span class="title1">Documentos</span> <span class="title1">Documentos</span>
</p> </p>
</div> </div>
@@ -223,14 +223,14 @@
</div> </div>
<p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])"> <p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">
Diplomas assinados PR <br> Diplomas assinados PR <br>
<span class="new-task-count" *ngIf="deplomasStore.diplomasAssinadoListNewCount.length >=2">{{ deplomasStore.diplomasAssinadoListNewCount.length}} Diplomas por Assinar PR novos</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasAssinadoListNewCount.length >=2">{{ TaskService.deplomasStore.diplomasAssinadoListNewCount.length}} Diplomas por Assinar PR novos</span>
<span class="new-task-count" *ngIf="deplomasStore.diplomasAssinadoListNewCount.length ==1">{{ deplomasStore.diplomasAssinadoListNewCount.length}} Diploma por Assinar PR novo</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasAssinadoListNewCount.length ==1">{{ TaskService.deplomasStore.diplomasAssinadoListNewCount.length}} Diploma por Assinar PR novo</span>
</p> </p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" >Diplomas <br> <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" >Diplomas <br>
<span class="new-task-count" *ngIf="deplomasStore.diplomasAssinadoListNewCount.length >=2">{{ deplomasStore.diplomasAssinadoListNewCount.length}} Diplomas novo</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasAssinadoListNewCount.length >=2">{{ TaskService.deplomasStore.diplomasAssinadoListNewCount.length}} Diplomas novo</span>
<span class="new-task-count" *ngIf="deplomasStore.diplomasAssinadoListNewCount.length ==1">{{ deplomasStore.diplomasAssinadoListNewCount.length}} Diploma novo</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasAssinadoListNewCount.length ==1">{{ TaskService.deplomasStore.diplomasAssinadoListNewCount.length}} Diploma novo</span>
</p> </p>
<p class="text-center exp-card-content"> {{ deplomasStore.countDiplomasAssinadoListCount }} <p class="text-center exp-card-content"> {{ TaskService.deplomasStore.countDiplomasAssinadoListCount }}
<span class="title1">Documentos</span></p> <span class="title1">Documentos</span></p>
</div> </div>
@@ -246,10 +246,10 @@
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon> <ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon>
</div> </div>
<p class="text-center exp-card-title">Diplomas por Assinar {{ environment.PR}} <br> <p class="text-center exp-card-title">Diplomas por Assinar {{ environment.PR}} <br>
<span class="new-task-count" *ngIf="deplomasStore.diplomasParaAssinarNewCount.length >=2">{{ deplomasStore.diplomasParaAssinarNewCount.length}} Diplomas por Assinar {{ environment.PR}} novos</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasParaAssinarNewCount.length >=2">{{ TaskService.deplomasStore.diplomasParaAssinarNewCount.length}} Diplomas por Assinar {{ environment.PR}} novos</span>
<span class="new-task-count" *ngIf="deplomasStore.diplomasParaAssinarNewCount.length ==1">{{ deplomasStore.diplomasParaAssinarNewCount.length}} Diploma por Assinar {{ environment.PR}} novo</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasParaAssinarNewCount.length ==1">{{ TaskService.deplomasStore.diplomasParaAssinarNewCount.length}} Diploma por Assinar {{ environment.PR}} novo</span>
</p> </p>
<p class="text-center exp-card-content"> {{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"> {{ TaskService.deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
</div> </div>
<!-- List --> <!-- List -->
@@ -261,11 +261,11 @@
</div> </div>
<p class="text-center exp-card-title " > <p class="text-center exp-card-title " >
Diplomas por Validar<br> Diplomas por Validar<br>
<span class="new-task-count" *ngIf="deplomasStore.diplomasReviewListNewCount.length >=2">{{ deplomasStore.diplomasReviewListNewCount.length}} Diplomas por validar novos</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasReviewListNewCount.length >=2">{{ TaskService.deplomasStore.diplomasReviewListNewCount.length}} Diplomas por validar novos</span>
<span class="new-task-count" *ngIf="deplomasStore.diplomasReviewListNewCount.length ==1">{{ deplomasStore.diplomasReviewListNewCount.length}} Diploma por validar novo</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasReviewListNewCount.length ==1">{{ TaskService.deplomasStore.diplomasReviewListNewCount.length}} Diploma por validar novo</span>
</p> </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-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Assinar PR</p> -->
<p class="text-center exp-card-content"> {{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p> <p class="text-center exp-card-content"> {{ TaskService.deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
</div> </div>
@@ -279,10 +279,10 @@
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon> <ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon>
</div> </div>
<p class="text-center exp-card-title">Diplomas para Assinar<br> <p class="text-center exp-card-title">Diplomas para Assinar<br>
<span class="new-task-count" *ngIf="deplomasStore.diplomasParaAssinarNewCount.length >= 2">{{ deplomasStore.diplomasParaAssinarNewCount.length}} Diplomas para assinar novos</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasParaAssinarNewCount.length >= 2">{{ TaskService.deplomasStore.diplomasParaAssinarNewCount.length}} Diplomas para assinar novos</span>
<span class="new-task-count " *ngIf="deplomasStore.diplomasParaAssinarNewCount.length == 1">{{ deplomasStore.diplomasParaAssinarNewCount.length}} Diploma para assinar novo</span> <span class="new-task-count " *ngIf="TaskService.deplomasStore.diplomasParaAssinarNewCount.length == 1">{{ TaskService.deplomasStore.diplomasParaAssinarNewCount.length}} Diploma para assinar novo</span>
</p> </p>
<p class="text-center exp-card-content"> {{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"> {{ TaskService.deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
</div> </div>
@@ -298,10 +298,10 @@
<p class="text-center exp-card-title" > <p class="text-center exp-card-title" >
Diplomas por elaborar <br> Diplomas por elaborar <br>
<span class="new-task-count" *ngIf="deplomasStore.diplomasGerarListNewCount.length >=2">{{ deplomasStore.diplomasGerarListNewCount.length}} Diplomas por elaborar novos</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasGerarListNewCount.length >=2">{{ TaskService.deplomasStore.diplomasGerarListNewCount.length}} Diplomas por elaborar novos</span>
<span class="new-task-count" *ngIf="deplomasStore.diplomasGerarListNewCount.length ==1">{{ deplomasStore.diplomasGerarListNewCount.length}} Diploma por elaborar novo</span> <span class="new-task-count" *ngIf="TaskService.deplomasStore.diplomasGerarListNewCount.length ==1">{{ TaskService.deplomasStore.diplomasGerarListNewCount.length}} Diploma por elaborar novo</span>
</p> </p>
<p class="text-center exp-card-content"> {{ deplomasStore.DiplomaGerarList.length }} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"> {{ TaskService.deplomasStore.DiplomaGerarList.length }} <span class="title1">Documentos</span></p>
</div> </div>
@@ -310,8 +310,10 @@
<div class="d-flex justify-center"> <div class="d-flex justify-center">
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon> <ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
</div> </div>
<p class="text-center exp-card-title ">Eventos para Aprovação</p> <p class="text-center exp-card-title ">Eventos para Aprovação <br>
<p class="text-center exp-card-content"> {{eventoaprovacaostore.countAll}} <span class="title1">Documentos</span></p> <span class="new-task-count" *ngIf="TaskService.eventoaprovacaostore.newList.length >=2">{{ TaskService.eventoaprovacaostore.newList.length}} Eventos para aprovação</span>
<span class="new-task-count" *ngIf="TaskService.eventoaprovacaostore.newList.length ==1">{{ TaskService.eventoaprovacaostore.newList.length}} Evento para aprovação</span></p>
<p class="text-center exp-card-content"> {{TaskService.eventoaprovacaostore.countAll}} <span class="title1">Documentos</span></p>
</div> </div>
<!-- List --> <!-- List -->
@@ -325,11 +327,11 @@
</div> </div>
<p class="text-center exp-card-title ">Expediente <br> <p class="text-center exp-card-title ">Expediente <br>
<span *ngIf="expedientegbstore.newList.length == 1" class="new-task-count">{{ expedientegbstore.newList.length}} Expediente novo</span> <span *ngIf="TaskService.expedientegbstore.newList.length == 1" class="new-task-count">{{ TaskService.expedientegbstore.newList.length}} Expediente novo</span>
<span *ngIf="expedientegbstore.newList.length >= 2" class="new-task-count">{{ expedientegbstore.newList.length}} Expedientes novos</span> <span *ngIf="TaskService.expedientegbstore.newList.length >= 2" class="new-task-count">{{ TaskService.expedientegbstore.newList.length}} Expedientes novos</span>
</p> </p>
<p class="text-center exp-card-content"> {{expedientegbstore.count}} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"> {{TaskService.expedientegbstore.count}} <span class="title1">Documentos</span></p>
</div> </div>
@@ -343,10 +345,10 @@
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Dispatches'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-despachos-presidente-hover.svg"></ion-icon> <ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Dispatches'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-despachos-presidente-hover.svg"></ion-icon>
</div> </div>
<p class="text-center exp-card-title ">Despachos<br> <p class="text-center exp-card-title ">Despachos<br>
<span class="new-task-count" *ngIf="despachoStore.newList.length >=2">{{ despachoStore.newList.length}} Despachos novos</span> <span class="new-task-count" *ngIf="TaskService.despachoStore.newList.length >=2">{{ TaskService.despachoStore.newList.length}} Despachos novos</span>
<span class="new-task-count" *ngIf="despachoStore.newList.length ==1">{{ despachoStore.newList.length}} Despacho novo</span> <span class="new-task-count" *ngIf="TaskService.despachoStore.newList.length ==1">{{ TaskService.despachoStore.newList.length}} Despacho novo</span>
</p> </p>
<p class="text-center exp-card-content"> {{despachoStore.count}} <span class="title1">Documentos</span> </p> <p class="text-center exp-card-content"> {{TaskService.despachoStore.count}} <span class="title1">Documentos</span> </p>
</div> </div>
@@ -363,15 +365,15 @@
</div> </div>
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title "> <p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">
Pedidos de Parecer<br> Pedidos de Parecer<br>
<span class="new-task-count" *ngIf="pedidosstore.listParecerCount.length >=2" >{{ pedidosstore.listParecerCount.length}} Pedidos de Parecer</span> <span class="new-task-count" *ngIf="TaskService.pedidosstore.listParecerCount.length >=2" >{{ TaskService.pedidosstore.listParecerCount.length}} Pedidos de Parecer</span>
<span class="new-task-count" *ngIf="pedidosstore.listParecerCount.length ==1" >{{ pedidosstore.listParecerCount.length}} Pedido de Parecer</span> <span class="new-task-count" *ngIf="TaskService.pedidosstore.listParecerCount.length ==1" >{{ TaskService.pedidosstore.listParecerCount.length}} Pedido de Parecer</span>
</p> </p>
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title "> <p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">
Pedidos de Parecer solicitados por mim <br> Pedidos de Parecer solicitados por mim <br>
<span class="new-task-count" *ngIf="pedidosstore.listParecerCount.length >=2">{{ pedidosstore.listParecerCount.length}} Pedido de Parecer solicitados por mim</span> <span class="new-task-count" *ngIf="TaskService.pedidosstore.listParecerCount.length >=2">{{ TaskService.pedidosstore.listParecerCount.length}} Pedido de Parecer solicitados por mim</span>
<span class="new-task-count" *ngIf="pedidosstore.listParecerCount.length ==1">{{ pedidosstore.listParecerCount.length}} Pedidos de Parecer solicitados por mim</span> <span class="new-task-count" *ngIf="TaskService.pedidosstore.listParecerCount.length ==1">{{ TaskService.pedidosstore.listParecerCount.length}} Pedidos de Parecer solicitados por mim</span>
</p> </p>
<p class="text-center exp-card-content"> {{pedidosstore.countparecer}} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"> {{TaskService.pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
</div> </div>
<!-- List --> <!-- List -->
@@ -386,10 +388,10 @@
</div> </div>
<p class="text-center exp-card-title "> <p class="text-center exp-card-title ">
Pedidos de Deferimento<br> Pedidos de Deferimento<br>
<span class="new-task-count" *ngIf="pedidosstore.listDeferimentoCount.length >=2">{{ pedidosstore.listDeferimentoCount.length}} Pedidos de Deferimento</span> <span class="new-task-count" *ngIf="TaskService.pedidosstore.listDeferimentoCount.length >=2">{{ TaskService.pedidosstore.listDeferimentoCount.length}} Pedidos de Deferimento</span>
<span class="new-task-count" *ngIf="pedidosstore.listDeferimentoCount.length ==1">{{ pedidosstore.listDeferimentoCount.length}} Pedidos de Deferimento</span> <span class="new-task-count" *ngIf="TaskService.pedidosstore.listDeferimentoCount.length ==1">{{ TaskService.pedidosstore.listDeferimentoCount.length}} Pedidos de Deferimento</span>
</p> </p>
<p class="text-center exp-card-content"> {{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"> {{TaskService.pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
</div> </div>
<!-- List --> <!-- List -->
@@ -403,23 +405,23 @@
</div> </div>
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title "> <p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">
Pendentes<br> Pendentes<br>
<span class="new-task-count" *ngIf="pendentesstore.newList.length >=2">{{ pendentesstore.newList.length}} Pendentes novos</span> <span class="new-task-count" *ngIf="TaskService.pendentesstore.newList.length >=2">{{ TaskService.pendentesstore.newList.length}} Pendentes novos</span>
<span class="new-task-count" *ngIf="pendentesstore.newList.length >=2">{{ pendentesstore.newList.length}} Pendente novo</span> <span class="new-task-count" *ngIf="TaskService.pendentesstore.newList.length >=2">{{ TaskService.pendentesstore.newList.length}} Pendente novo</span>
</p> </p>
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Meus Pendentes<br> <p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Meus Pendentes<br>
<span class="new-task-count" *ngIf="pendentesstore.newList.length >=2">{{ pendentesstore.newList.length}} Meus Pendente</span> <span class="new-task-count" *ngIf="TaskService.pendentesstore.newList.length >=2">{{ TaskService.pendentesstore.newList.length}} Meus Pendente</span>
<span class="new-task-count" *ngIf="pendentesstore.newList.length ==1">{{ pendentesstore.newList.length}} Meu Pendent</span> <span class="new-task-count" *ngIf="TaskService.pendentesstore.newList.length ==1">{{ TaskService.pendentesstore.newList.length}} Meu Pendent</span>
</p> </p>
<p class="text-center exp-card-content"> <span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p> <p class="text-center exp-card-content"> <span class="number">{{TaskService.pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
</div> </div>
</div> </div>
<div *ngIf="!loadCount" class="width-100"> <div *ngIf="!TaskService.loadCount" class="width-100">
<ion-item-sliding class="width-100"> <ion-item-sliding class="width-100">
<ion-item lines="none" <ion-item lines="none"
@@ -47,7 +47,6 @@ export class GabineteDigitalPage implements OnInit {
segment: string; segment: string;
segmentVista: string; segmentVista: string;
showLoader: boolean = false
public profile: string; public profile: string;
allProcessesList: any = new Array(); allProcessesList: any = new Array();
@@ -84,16 +83,6 @@ export class GabineteDigitalPage implements OnInit {
hideRefreshBtn = true; hideRefreshBtn = true;
hideInMobile = true; hideInMobile = true;
expedientegbstore = ExpedienteGdStore;
pendentesstore = PendentesStore;
despachoStore = DespachoStore;
eventoaprovacaostore = EventoAprovacaoStore;
pedidosstore = PedidosStore;
despachoprstore = DespachosprStore;
totalDocumentStore = TotalDocumentStore
deplomasStore = DeplomasStore
showDiplomasGerar = false showDiplomasGerar = false
// //
// pipe // pipe
@@ -101,7 +90,6 @@ export class GabineteDigitalPage implements OnInit {
SessionStore = SessionStore SessionStore = SessionStore
expedienteTaskPipe = new ExpedienteTaskPipe(); expedienteTaskPipe = new ExpedienteTaskPipe();
loadCount = false
customTaskPipe = new CustomTaskPipe() customTaskPipe = new CustomTaskPipe()
@@ -109,8 +97,6 @@ export class GabineteDigitalPage implements OnInit {
Agenda: 530 Agenda: 530
} }
AllProcess = []
// workerList : Worker // workerList : Worker
environment = environment environment = environment
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage; @ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
@@ -158,8 +144,6 @@ export class GabineteDigitalPage implements OnInit {
this.checkRoutes(); this.checkRoutes();
window['all-process-gabinete'] = this.updateAllProcess
} }
closeAllDesktopComponent() { closeAllDesktopComponent() {
this.desktopComponent = { this.desktopComponent = {
@@ -179,7 +163,6 @@ export class GabineteDigitalPage implements OnInit {
} }
this.LoadCounts(); this.LoadCounts();
this.updateAllProcess()
this.checkFilter(); this.checkFilter();
const pathname = window.location.pathname const pathname = window.location.pathname
@@ -536,195 +519,15 @@ export class GabineteDigitalPage implements OnInit {
functionTimer = null functionTimer = null
updateAllProcess = () => {
this.AllProcess = this.sortArrayISODate(this.despachoprstore.list.concat(this.deplomasStore.diplomasAssinadoList as any).concat(this.deplomasStore.diplomasParaAssinarList as any).concat(this.deplomasStore.DiplomaGerarList as any)
.concat(this.eventoaprovacaostore.contactList as any).concat(this.expedientegbstore.list as any).concat(this.despachoStore.list as any).concat(this.pedidosstore.listparecer as any).concat(this.pedidosstore.listdeferimento as any)
.concat(this.pendentesstore.list as any)).reverse()
// try{
// this.workerList.postMessage([
// this.expedientegbstore.list,this.pedidosstore.listparecer,this.pedidosstore.listdeferimento,
// this.despachoprstore.list, this.eventoaprovacaostore.listmd, this.eventoaprovacaostore.listpr, this.despachoStore.list,
// this.deplomasStore.diplomasParaAssinarList, this.deplomasStore.diplomasAssinadoList, this.deplomasStore.DiplomaGerarList
// ])
// } catch (e) {
// this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
// .concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
// .concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
// }
clearTimeout(this.functionTimer);
this.functionTimer = setTimeout(() => {
if(window['all-process']) {
window['all-process']()
} else {
this.TaskService.updateCount()
}
}, 1000); // time is in milliseconds
}
get getAllProcessCount() {
return this.AllProcess.length
}
loadProcess = {} loadProcess = {}
get getloadKeys() { get getloadKeys() {
return Object.keys(this.loadProcess) return Object.keys(this.loadProcess)
} }
loadNum = 0
async LoadCounts() { async LoadCounts() {
this.updateAllProcess()
let expedientes;
this.showLoader = true
try {
expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise()
this.loadCount = true;
this.showLoader = false;
} catch(error) {
this.showLoader = false
this.loadCount = true;
}
this.loadNum++;
expedientes = (expedientes || [] ).filter(data => data.workflowInstanceDataFields.Status == "" || data.workflowInstanceDataFields.Status == "Active")
expedientes = expedientes.filter((item) => {
return item.activityInstanceName != 'Retificar Expediente'
});
expedientes = expedientes.map((element) => this.expedienteTaskPipe.transform(element));
this.expedientegbstore.reset(expedientes);
let despachos = await this.despachoRule.getList({ updateStore: true })
if (despachos) {
this.despachoStore.reset(despachos)
}
let pareceres = await this.processesbackend.GetTasksList("Pedido de Parecer", false).toPromise();
let pareceresPr = await this.processesbackend.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
let allParecer = pareceres.concat(pareceresPr);
this.pedidosstore.countparecer = Object.keys(allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active")).length;
this.pedidosstore.resetparecer(allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active").map((element) => {
return this.customTaskPipe.transform(element)
}));
let deferimentos = await this.processesbackend.GetTasksList("Pedido de Deferimento", false).toPromise();
this.pedidosstore.countdeferimento = Object.keys(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active")).length
this.pedidosstore.resetdeferimento(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active").map((element) => {
return this.customTaskPipe.transform(element)
}));
let pendentes = await this.processesbackend.GetPendingTasks(false).toPromise();
this.pendentesstore.count = Object.keys(pendentes).length;
pendentes = pendentes.map((element)=> this.customTaskPipe.transform(element))
this.pendentesstore.reset(pendentes);
let depachoAPI = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
await this.TaskService.LoadTask()
if(SessionStore.user.Profile != 'PR') {
let depacho: any = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
depacho = depacho.filter(data => data.workflowInstanceDataFields.Status == "Active");
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
this.despachoprstore.reset(depacho)
} else if(SessionStore.user.Profile == 'PR') {
let depacho: any = depachoAPI.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
this.despachoprstore.reset(depacho)
}
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
diplomasValidar = diplomasValidar.filter(data => data.activityInstanceName != "Tarefa de Despacho");
this.deplomasStore.resetDiplomasReview(diplomasValidar.map((element)=> {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
return this.customTaskPipe.transform(element)
}))
let diplomasAssinar: any = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma");
diplomasAssinar = diplomasAssinar.map((element) => this.expedienteTaskPipe.transform(element))
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
let diplomasAssinados: any = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
diplomasAssinados = diplomasAssinados.map((element) => this.expedienteTaskPipe.transform(element))
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
for(let calendar of this.eventService.calendarNamesAry) {
if(calendar == 'Meu calendario') {
// color
let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise();
let eventsList
try {
eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
} catch (error) {
eventsList = [];
}
this.eventoaprovacaostore.save(calendar, eventsList)
} else {
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise()
let eventsList
try {
eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
} catch(error) {
eventsList = []
}
this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList)
}
}
// let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
// let eventsMDGPRList = mdEventsOficial
// eventsMDGPRList = eventsMDGPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
// this.eventoaprovacaostore.countMd = eventsMDGPRList.length
// this.eventoaprovacaostore.resetmd(eventsMDGPRList);
// this.updateAllProcess()
// let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
// let eventsPRList = prEventsOficial
// eventsPRList = eventsPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
// this.eventoaprovacaostore.countPr = eventsPRList.length
// this.eventoaprovacaostore.resetpr(eventsPRList);
this.loadCount = true
} }
doRefresh(event) { doRefresh(event) {
+178 -7
View File
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { ProcessesService } from 'src/app/services/processes.service';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service'; import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { DeplomasStore } from 'src/app/store/deplomas.service'; import { DeplomasStore } from 'src/app/store/deplomas.service';
import { PendentesStore } from 'src/app/store/pendestes-store.service'; import { PendentesStore } from 'src/app/store/pendestes-store.service';
@@ -9,6 +9,12 @@ import { TotalDocumentStore } from 'src/app/store/total-document.service';
import { DespachosprStore } from 'src/app/store/despachospr-store.service'; import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service'; import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
import { PedidosStore } from 'src/app/store/pedidos-store.service'; import { PedidosStore } from 'src/app/store/pedidos-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { DespachoService } from 'src/app/Rules/despacho.service';
import { CustomTaskPipe } from '../pipes/custom-task.pipe';
import { SessionStore } from 'src/app/store/session.service';
import { EventsService } from './events.service';
import { SortService } from './functions/sort.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -30,10 +36,30 @@ export class TaskService {
despachoprstore = DespachosprStore; despachoprstore = DespachosprStore;
totalDocumentStore = TotalDocumentStore totalDocumentStore = TotalDocumentStore
deplomasStore = DeplomasStore deplomasStore = DeplomasStore
SessionStore = SessionStore
AllProcess = [] AllProcess = []
showLoader: boolean = false
loadCount = false
loadNum = 0
constructor() { } expedienteTaskPipe = new ExpedienteTaskPipe();
customTaskPipe = new CustomTaskPipe()
constructor(
private processesbackend: ProcessesService,
private despachoRule: DespachoService,
public eventService: EventsService,
private sortService: SortService,
) {
window['all-process-gabinete'] = () => {
this.updateCount()
this.updateAllProcess()
}
}
deadlineIsToday(isoDateString:string) { deadlineIsToday(isoDateString:string) {
@@ -88,21 +114,166 @@ export class TaskService {
} }
sortArrayISODate(myArray: any): any[] { sortArrayISODate(myArray: any): any[] {
// return myArray.sort(function (a, b) {
// return (a.CreateDate || a.taskStartDate < b.CreateDate || b.taskStartDate) ? -1 : ((a.CreateDate || a.taskStartDate > b.CreateDate || b.taskStartDate) ? 1 : 0);
// });
return myArray.sort((a,b) => Date.parse(b.CreateDate || b.taskStartDate || b.TaskStartDate) - Date.parse(a.CreateDate || a.taskStartDate || a.TaskStartDate)) return myArray.sort((a,b) => Date.parse(b.CreateDate || b.taskStartDate || b.TaskStartDate) - Date.parse(a.CreateDate || a.taskStartDate || a.TaskStartDate))
} }
updateCount() { updateCount = () => {
this.updateAllProcess()
this.read = this.AllProcess.filter((item) => this.filter(item,'Lidos')).length this.read = this.AllProcess.filter((item) => this.filter(item,'Lidos')).length
this.unread = this.AllProcess.filter((item) => this.filter(item,'Não lidos')).length this.unread = this.AllProcess.filter((item) => this.filter(item,'Não lidos')).length
this.deadline = this.AllProcess.filter((task) => this.deadlineIsToday(task.Deadline || task.deadline)).length this.deadline = this.AllProcess.filter((task) => this.deadlineIsToday(task.Deadline || task.deadline)).length
this.new = this.AllProcess.filter((task) => this.lessThen24Hours(task.TaskStartDate || task.taskStartDate)).length this.new = this.AllProcess.filter((task) => this.lessThen24Hours(task.TaskStartDate || task.taskStartDate)).length
this.overdueTasks = this.AllProcess.filter((task) => this.overdueTask(task.Deadline || task.deadline)).length this.overdueTasks = this.AllProcess.filter((task) => this.overdueTask(task.Deadline || task.deadline)).length
} }
async LoadTask() {
let expedientes;
this.showLoader = true
try {
expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise()
this.loadCount = true;
this.showLoader = false;
} catch(error) {
this.showLoader = false
this.loadCount = true;
}
this.loadNum++;
expedientes = (expedientes || [] ).filter(data => data.workflowInstanceDataFields.Status == "" || data.workflowInstanceDataFields.Status == "Active")
expedientes = expedientes.filter((item) => {
return item.activityInstanceName != 'Retificar Expediente'
});
expedientes = expedientes.map((element) => this.expedienteTaskPipe.transform(element));
this.expedientegbstore.reset(expedientes);
let despachos = await this.despachoRule.getList({ updateStore: true })
if (despachos) {
this.despachoStore.reset(despachos)
}
let pareceres = await this.processesbackend.GetTasksList("Pedido de Parecer", false).toPromise();
let pareceresPr = await this.processesbackend.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
let allParecer = pareceres.concat(pareceresPr);
this.pedidosstore.countparecer = Object.keys(allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active")).length;
this.pedidosstore.resetparecer(allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active").map((element) => {
return this.customTaskPipe.transform(element)
}));
let deferimentos = await this.processesbackend.GetTasksList("Pedido de Deferimento", false).toPromise();
this.pedidosstore.countdeferimento = Object.keys(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active")).length
this.pedidosstore.resetdeferimento(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active").map((element) => {
return this.customTaskPipe.transform(element)
}));
let pendentes = await this.processesbackend.GetPendingTasks(false).toPromise();
this.pendentesstore.count = Object.keys(pendentes).length;
pendentes = pendentes.map((element)=> this.customTaskPipe.transform(element))
this.pendentesstore.reset(pendentes);
let depachoAPI = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
if(SessionStore.user.Profile != 'PR') {
let depacho: any = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
depacho = depacho.filter(data => data.workflowInstanceDataFields.Status == "Active");
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
this.despachoprstore.reset(depacho)
} else if(SessionStore.user.Profile == 'PR') {
let depacho: any = depachoAPI.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
this.despachoprstore.reset(depacho)
}
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
diplomasValidar = diplomasValidar.filter(data => data.activityInstanceName != "Tarefa de Despacho");
this.deplomasStore.resetDiplomasReview(diplomasValidar.map((element)=> {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
return this.customTaskPipe.transform(element)
}))
let diplomasAssinar: any = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma");
diplomasAssinar = diplomasAssinar.map((element) => this.expedienteTaskPipe.transform(element))
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
let diplomasAssinados: any = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
diplomasAssinados = diplomasAssinados.map((element) => this.expedienteTaskPipe.transform(element))
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
for(let calendar of this.eventService.calendarNamesAry) {
if(calendar == 'Meu calendario') {
// color
let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise();
let eventsList
try {
eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
} catch (error) {
eventsList = [];
}
this.eventoaprovacaostore.save(calendar, eventsList)
} else {
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise()
let eventsList
try {
eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
} catch(error) {
eventsList = []
}
this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList)
}
}
// let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
// let eventsMDGPRList = mdEventsOficial
// eventsMDGPRList = eventsMDGPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
// this.eventoaprovacaostore.countMd = eventsMDGPRList.length
// this.eventoaprovacaostore.resetmd(eventsMDGPRList);
// this.updateAllProcess()
// let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
// let eventsPRList = prEventsOficial
// eventsPRList = eventsPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
// this.eventoaprovacaostore.countPr = eventsPRList.length
// this.eventoaprovacaostore.resetpr(eventsPRList);
this.loadCount = true
}
} }
@@ -1,5 +1,5 @@
<ion-header class="ion-no-border"> <ion-header class="ion-no-border">
<!-- <ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar> --> <!-- <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> -->
<div class="title"> <div class="title">
<div class="thetitle"><ion-label >Todas as tarefas</ion-label></div> <div class="thetitle"><ion-label >Todas as tarefas</ion-label></div>
@@ -55,13 +55,13 @@
<div class="overflow-y-auto height-100 width-100"> <div class="overflow-y-auto height-100 width-100">
<div *ngIf="AllProcess.length >= 0"> <div *ngIf="TaskService.AllProcess.length >= 0">
<ion-item-sliding class="overflow-y-auto height-100"> <ion-item-sliding class="overflow-y-auto height-100">
<div class="listview"> <div class="listview">
<ion-list *ngIf="AllProcess"> <ion-list *ngIf="TaskService.AllProcess">
<div <div
class="item-hover ion-no-padding cursor-pointer" class="item-hover ion-no-padding cursor-pointer"
*ngFor = "let task of AllProcess" *ngFor = "let task of TaskService.AllProcess"
(click)="goToProcess(task.SerialNumber || task.serialNumber, task.WorkflowName || task.workflowName|| task.workflowDisplayName , task.activityInstanceName)"> (click)="goToProcess(task.SerialNumber || task.serialNumber, task.WorkflowName || task.workflowName|| task.workflowDisplayName , task.activityInstanceName)">
<div class="item-wrapper" *ngIf="TaskService.filter(task, filterName)"> <div class="item-wrapper" *ngIf="TaskService.filter(task, filterName)">
<div class="item width-100 " > <div class="item width-100 " >
@@ -120,13 +120,13 @@
</div> </div>
<div <div
*ngIf="!skeletonLoader && getAllProcessCount == 0" *ngIf="!TaskService.showLoader && TaskService.AllProcess.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center" class="empty-list d-flex height-100 align-center justify-content-center"
> >
<span>Lista vazia</span> <span>Lista vazia</span>
</div> </div>
<div *ngIf="skeletonLoader && getAllProcessCount == 0"> <div *ngIf="TaskService.showLoader && TaskService.AllProcess.length == 0">
<ion-list> <ion-list>
<ion-item> <ion-item>
@@ -34,7 +34,6 @@ export class AllProcessesPage implements OnInit {
totalDocumentStore = TotalDocumentStore totalDocumentStore = TotalDocumentStore
deplomasStore = DeplomasStore deplomasStore = DeplomasStore
AllProcess = []
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos' filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
constructor( constructor(
@@ -43,16 +42,10 @@ export class AllProcessesPage implements OnInit {
public TaskService: TaskService public TaskService: TaskService
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
window['all-process'] = () => {
if(window.location.href.includes('?processes=true')) {
this.updateAllProcess()
}
}
} }
ngOnInit() { ngOnInit() {
this.updateAllProcess() // this.updateAllProcess()
this.checkFilter(); this.checkFilter();
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
@@ -95,44 +88,18 @@ export class AllProcessesPage implements OnInit {
}, 2000); }, 2000);
} }
setTimeout(() => { setTimeout(() => {
this.updateAllProcess(); // this.updateAllProcess();
}, 1000); }, 1000);
} }
refreshing() { refreshing() {
setTimeout(() => { setTimeout(() => {
this.updateAllProcess(); // this.updateAllProcess();
}, 1000); }, 1000);
} }
functionTimer = null
updateAllProcess = () => {
this.AllProcess = this.sortArrayISODate(this.despachoprstore.list.concat(this.deplomasStore.diplomasAssinadoList as any).concat(this.deplomasStore.diplomasParaAssinarList as any).concat(this.deplomasStore.DiplomaGerarList as any)
.concat(this.eventoaprovacaostore.contactList as any).concat(this.expedientegbstore.list as any).concat(this.despachoStore.list as any).concat(this.pedidosstore.listparecer as any).concat(this.pedidosstore.listdeferimento as any)
.concat(this.pendentesstore.list as any)).reverse()
clearTimeout(this.functionTimer);
this.functionTimer = setTimeout(() => {
this.TaskService.updateCount()
}, 1000); // time is in milliseconds
}
get getAllProcessCount() {
return this.AllProcess.length
}
sortArrayISODate(myArray: any): any[] {
// return myArray.sort(function (a, b) {
// return (a.CreateDate || a.taskStartDate < b.CreateDate || b.taskStartDate) ? -1 : ((a.CreateDate || a.taskStartDate > b.CreateDate || b.taskStartDate) ? 1 : 0);
// });
return myArray.sort((a,b) => Date.parse(b.CreateDate || b.taskStartDate || b.TaskStartDate) - Date.parse(a.CreateDate || a.taskStartDate || a.TaskStartDate))
}
setFormatDate(start: any, end: any, allday: boolean) { setFormatDate(start: any, end: any, allday: boolean) {
let customDate; let customDate;
@@ -18,6 +18,9 @@ export class EventoaprovacaoStoreService {
private _counts : {[key: string]: number} = {} private _counts : {[key: string]: number} = {}
private _countsAll = 0 private _countsAll = 0
newList = []
constructor() { constructor() {
this.keyNameAll = (SHA1("EventoaprovacaoStoreService"+"all")).toString() this.keyNameAll = (SHA1("EventoaprovacaoStoreService"+"all")).toString()
@@ -96,9 +99,25 @@ export class EventoaprovacaoStoreService {
this._countsAll = allList.length this._countsAll = allList.length
this._concatList = allList this._concatList = allList
this.newList = this._concatList.filter((e) =>{
return this.lessthen24Hours(e.TaskStartDate || e.taskStartDate)
})
} }
lessthen24Hours(isoDateString:string) {
const creationDate = new Date(isoDateString)
const creationDatePlus24h = new Date(creationDate)
creationDatePlus24h.setHours((creationDate.getHours() + 24))
const currentDate = new Date()
return creationDatePlus24h.getTime() > currentDate.getTime()
}
} }
export const EventoAprovacaoStore = new EventoaprovacaoStoreService() export const EventoAprovacaoStore = new EventoaprovacaoStoreService()
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "f8f5a0074", "shortSHA": "9c835cde2",
"SHA": "f8f5a0074f42904edc428799667ae44fe8517be8", "SHA": "9c835cde286868d69e7585bb06516f10519455fe",
"branch": "feature/gabineteLabels", "branch": "feature/gabineteLabels",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Mon Apr 17 14:57:08 2023 +0100'", "lastCommitTime": "'Mon Apr 17 15:13:44 2023 +0100'",
"lastCommitMessage": "improve links", "lastCommitMessage": "remove button form mobile",
"lastCommitNumber": "4910", "lastCommitNumber": "4911",
"change": "", "change": "",
"changeStatus": "On branch feature/gabineteLabels\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.html", "changeStatus": "On branch feature/gabineteLabels\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/events/events.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.html\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.ts\n\tmodified: src/app/store/eventoaprovacao-store.service.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }