remove limites

This commit is contained in:
Peter Maquiran
2023-06-10 14:17:41 +01:00
parent de531bc550
commit 04b5373eaa
10 changed files with 146 additions and 17 deletions
+42
View File
@@ -68,6 +68,13 @@ export class EventsPage implements OnInit {
showCorrespondenciasLoader = false
loadingAllTask = false
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Não lidos'
showSearch = true;
searchSubject: string = '';
AllProcess = []
ordinance: string = 'old'
constructor(
private eventService: EventsService,
private router: Router,
@@ -102,6 +109,13 @@ export class EventsPage implements OnInit {
this.listToPresentexpediente = []
})
this.TaskService.registerCallback({
id: import.meta.url,
funx:() => {
this.dynamicSearch()
}
})
}
ngOnInit() {
@@ -128,6 +142,34 @@ export class EventsPage implements OnInit {
}
async dynamicSearch() {
const ordinance = this.ordinance
if(this.showSearch && this.searchSubject) {
const AllProcess = this.TaskService.AllProcess.filter((task) => {
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
subject = subject.toLowerCase();
return subject.includes(this.searchSubject.toLowerCase())
}).filter( task => this.TaskService.filter(task, this.filterName))
if(ordinance == this.ordinance) {
this.AllProcess = this.TaskService.reorderList(this.ordinance, AllProcess)
}
} else {
const AllProcess = this.TaskService.AllProcess
if(ordinance == this.ordinance) {
this.AllProcess = this.TaskService.reorderList(this.ordinance, AllProcess)
.filter( task => this.TaskService.filter(task, this.filterName))
}
}
}
async loadAllTask() {
this.loadingAllTask = true
await this.TaskService.LoadTask()