This commit is contained in:
Peter Maquiran
2023-05-23 11:56:12 +01:00
parent 181a9dbd76
commit 033a6c331c
49 changed files with 832 additions and 278 deletions
@@ -10,8 +10,21 @@
<div class="header-title">
<label>Expediente <span class="lowercase" *ngIf="filterName != 'Todos' ">{{ filterName }}</span></label>
</div>
<div class="btn-refresh">
<!-- <mat-form-field class="task-filter-input" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda">
<div class="btn-refresh d-flex align-center">
<div>
<div class="d-flex" (click)="reorderList('old')" *ngIf="ordinance == 'recent' ">
<ion-icon class="mr-10 font-25" src="assets/images/theme/gov/crescente.svg" ></ion-icon>
</div>
<div class="d-flex" (click)="reorderList('recent')" *ngIf="ordinance != 'recent' ">
<ion-icon class="mr-10 font-25" src="assets/images/theme/gov/decrescente.svg" ></ion-icon>
</div>
</div>
<mat-form-field class="task-filter-input" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda">
<mat-select [(value)]="filterName">
<mat-option value="Para hoje" >
@@ -41,7 +54,8 @@
</mat-select>
</mat-form-field> -->
</mat-form-field>
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
@@ -62,7 +76,7 @@
<ion-list>
<div
class=" ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of expedientegbstore.list"
*ngFor = "let task of list"
(click)="goToExpediente(task.SerialNumber)"
>
<div class="item width-100 expediente" *ngIf="TaskService.filter(task, filterName)">
@@ -39,6 +39,7 @@ export class ExpedientePage implements OnInit {
showSearch = false
searchSubject = ''
list = []
ordinance: string = 'old'
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
constructor(
@@ -88,17 +89,29 @@ export class ExpedientePage implements OnInit {
}
reorderList(orderBy: string) {
this.ordinance = orderBy;
this.dynamicSearch();
}
async dynamicSearch() {
if(this.showSearch && this.searchSubject) {
this.list = this.TaskService.despachoStore.list.filter((task) => {
const searchedList = this.expedientegbstore.list.filter((task) => {
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
subject = subject.toLowerCase();
return subject.includes(this.searchSubject.toLowerCase())
})
this.list = this.TaskService.reorderList(this.ordinance, searchedList)
} else {
this.list = this.TaskService.AllProcess
const list = this.expedientegbstore.list
this.list = this.TaskService.reorderList(this.ordinance, list)
}
}
@@ -122,7 +135,7 @@ export class ExpedientePage implements OnInit {
this.taskslist = this.taskslist.filter(function(item) {
return item.activityInstanceName != 'Retificar Expediente'
})
this.listToPresent = this.sortService.sortDate(this.taskslist, 'taskStartDate')
this.listToPresent = this.sortService.sortDate(this.taskslist, 'TaskStartDate').reverse()
this.expedientegbstore.reset(this.listToPresent);