add search

This commit is contained in:
Peter Maquiran
2023-05-04 09:48:04 +01:00
parent bd8b3c3501
commit 9208b055f2
41 changed files with 957 additions and 98 deletions
@@ -41,6 +41,11 @@ export class PedidosPage implements OnInit {
customTaskPipe = new CustomTaskPipe()
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
showSearch = false
searchSubject = ''
list = []
hideSearchBtn: boolean = false;
constructor(
private router: Router,
private processes:ProcessesService,
@@ -71,6 +76,37 @@ export class PedidosPage implements OnInit {
}
async dynamicSearch() {
if(this.showSearch && this.searchSubject) {
this.list = this.TaskService.despachoStore.list.filter((task) => {
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
subject = subject.toLowerCase();
return subject.includes(this.searchSubject.toLowerCase())
})
} else {
this.list = this.TaskService.AllProcess
}
}
openSearch() {
this.dynamicSearch()
}
async closeSearch() {
this.searchSubject = ''
this.dynamicSearch()
}
async basicSearch() {
this.dynamicSearch()
}
segmentChanged(ev: any) {
this.LoadList();
}