mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
improve
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user