mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
centralize service
This commit is contained in:
@@ -34,7 +34,6 @@ export class AllProcessesPage implements OnInit {
|
||||
totalDocumentStore = TotalDocumentStore
|
||||
deplomasStore = DeplomasStore
|
||||
|
||||
AllProcess = []
|
||||
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
|
||||
|
||||
constructor(
|
||||
@@ -43,16 +42,10 @@ export class AllProcessesPage implements OnInit {
|
||||
public TaskService: TaskService
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
|
||||
window['all-process'] = () => {
|
||||
if(window.location.href.includes('?processes=true')) {
|
||||
this.updateAllProcess()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.updateAllProcess()
|
||||
// this.updateAllProcess()
|
||||
this.checkFilter();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
@@ -95,44 +88,18 @@ export class AllProcessesPage implements OnInit {
|
||||
}, 2000);
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.updateAllProcess();
|
||||
// this.updateAllProcess();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
refreshing() {
|
||||
|
||||
setTimeout(() => {
|
||||
this.updateAllProcess();
|
||||
// this.updateAllProcess();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
functionTimer = null
|
||||
|
||||
updateAllProcess = () => {
|
||||
|
||||
this.AllProcess = this.sortArrayISODate(this.despachoprstore.list.concat(this.deplomasStore.diplomasAssinadoList as any).concat(this.deplomasStore.diplomasParaAssinarList as any).concat(this.deplomasStore.DiplomaGerarList as any)
|
||||
.concat(this.eventoaprovacaostore.contactList as any).concat(this.expedientegbstore.list as any).concat(this.despachoStore.list as any).concat(this.pedidosstore.listparecer as any).concat(this.pedidosstore.listdeferimento as any)
|
||||
.concat(this.pendentesstore.list as any)).reverse()
|
||||
|
||||
clearTimeout(this.functionTimer);
|
||||
this.functionTimer = setTimeout(() => {
|
||||
|
||||
this.TaskService.updateCount()
|
||||
|
||||
}, 1000); // time is in milliseconds
|
||||
}
|
||||
|
||||
get getAllProcessCount() {
|
||||
return this.AllProcess.length
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any): any[] {
|
||||
// return myArray.sort(function (a, b) {
|
||||
// return (a.CreateDate || a.taskStartDate < b.CreateDate || b.taskStartDate) ? -1 : ((a.CreateDate || a.taskStartDate > b.CreateDate || b.taskStartDate) ? 1 : 0);
|
||||
// });
|
||||
|
||||
return myArray.sort((a,b) => Date.parse(b.CreateDate || b.taskStartDate || b.TaskStartDate) - Date.parse(a.CreateDate || a.taskStartDate || a.TaskStartDate))
|
||||
}
|
||||
|
||||
setFormatDate(start: any, end: any, allday: boolean) {
|
||||
let customDate;
|
||||
|
||||
Reference in New Issue
Block a user