mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add search
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user