mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Gabinete digital offline complete
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
</div>
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of expedienteGdStore.list"
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of listToPresentexpediente"
|
||||
(click)="goToExpediente(task.SerialNumber)">
|
||||
<div class="item-exp d-flex">
|
||||
<div class="schedule-date">
|
||||
|
||||
@@ -67,7 +67,8 @@ export class EventsPage implements OnInit {
|
||||
toDayEventStorage = ToDayEventStorage
|
||||
expedienteGdStore = ExpedienteGdStore
|
||||
|
||||
listToPresent
|
||||
listToPresent = [];
|
||||
listToPresentexpediente =[]
|
||||
|
||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||
|
||||
@@ -118,18 +119,6 @@ export class EventsPage implements OnInit {
|
||||
this.segment = "Combinada";
|
||||
this.profile = "mdgpr";
|
||||
|
||||
this.showGreeting();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
||||
this.RefreshEvents();
|
||||
setTimeout(()=>{
|
||||
this.LoadList();
|
||||
}, 1500)
|
||||
}
|
||||
});
|
||||
this.hideSearch();
|
||||
|
||||
this.getEventsFromLocalDb();
|
||||
|
||||
//this.checkScreenOrientation();
|
||||
@@ -196,17 +185,16 @@ export class EventsPage implements OnInit {
|
||||
const list = mdOficialEvents.concat(mdPessoalEvents);
|
||||
console.log("getAllMdOficialPessoalEvents", list)
|
||||
this.SqliteAddEvent(list);
|
||||
this.listToPresent = this.toDayEventStorage.eventsList
|
||||
this.toDayEventStorage.reset(list)
|
||||
this.listToPresent = list
|
||||
|
||||
|
||||
|
||||
if (this.toDayEventStorage.eventsList.length > 0) {
|
||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
||||
if (list.length > 0) {
|
||||
this.currentEvent = list[0].Subject;
|
||||
this.currentHoursMinutes = list[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
||||
this.totalEvent = list.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
@@ -218,15 +206,14 @@ export class EventsPage implements OnInit {
|
||||
const list = prOficialEvents.concat(prPessoalEvents);
|
||||
console.log("getAllPrOficialPessoalEvents", list)
|
||||
this.SqliteAddEvent(list);
|
||||
this.toDayEventStorage.reset(list)
|
||||
|
||||
if (this.toDayEventStorage.eventsList.length > 0) {
|
||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
||||
if (list.length > 0) {
|
||||
this.currentEvent = list[0].Subject;
|
||||
this.currentHoursMinutes = list[0].StartDate;
|
||||
}
|
||||
|
||||
this.listToPresent = this.toDayEventStorage.eventsList;
|
||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
||||
this.listToPresent = list;
|
||||
this.totalEvent = list.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
@@ -326,7 +313,7 @@ export class EventsPage implements OnInit {
|
||||
Body: ""
|
||||
}
|
||||
|
||||
if(!event.Organizer){
|
||||
if (!event.Organizer) {
|
||||
this.sqliteservice.addEvent(data);
|
||||
console.log("Events page add event sqllite")
|
||||
}
|
||||
@@ -336,31 +323,49 @@ export class EventsPage implements OnInit {
|
||||
|
||||
getEventsFromLocalDb() {
|
||||
|
||||
synchro.registerCallback('Online', () => {
|
||||
if (synchro.connected === true) {
|
||||
this.showGreeting();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
||||
this.RefreshEvents();
|
||||
this.LoadList();
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
}, 1500)
|
||||
}
|
||||
});
|
||||
console.log('Onlineee')
|
||||
|
||||
})
|
||||
|
||||
|
||||
synchro.registerCallback('Offline', () => {
|
||||
this.platform.ready().then(() => {
|
||||
this.sqliteservice.getAllEvents().then((event) => {
|
||||
this.listToPresent = event
|
||||
this.totalEvent = this.listToPresent.length
|
||||
this.currentEvent = this.listToPresent[0].Subject
|
||||
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
||||
console.log("All events from local,", event)
|
||||
})
|
||||
console.log('Offlineee')
|
||||
this.hideSearch();
|
||||
} else {
|
||||
this.sqliteservice.getAllEvents().then((event:any[]) => {
|
||||
this.listToPresent = event
|
||||
this.totalEvent = this.listToPresent.length
|
||||
this.currentEvent = this.listToPresent[0].Subject
|
||||
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
||||
console.log("All events from local,", event)
|
||||
})
|
||||
|
||||
})
|
||||
this.sqliteservice.getprocessByworkflow("Expediente").then((process: any[]) => {
|
||||
var expedientlist = [];
|
||||
process.forEach((element) => {
|
||||
let task = {
|
||||
CreateDate: element.taskStartDate,
|
||||
DocumentsQty: element.totalDocuments,
|
||||
Senders: JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||
SerialNumber: element.serialNumber,
|
||||
Status: JSON.parse(element.workflowInstanceDataFields).Status,
|
||||
Subject: JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||
WorkflowName: element.workflowDisplayName,
|
||||
activityInstanceName: element.activityInstanceName,
|
||||
taskStartDate: element.taskStartDate,
|
||||
}
|
||||
expedientlist.push(task);
|
||||
})
|
||||
const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e))
|
||||
this.listToPresentexpediente = ExpedienteTask;
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -418,10 +423,13 @@ export class EventsPage implements OnInit {
|
||||
LoadList() {
|
||||
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
||||
console.log("Expediente", result);
|
||||
this.sqliteservice.addProcess(result)
|
||||
|
||||
const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
|
||||
|
||||
this.expedienteGdStore.reset(ExpedienteTask)
|
||||
console.log("Expediente 2", ExpedienteTask);
|
||||
|
||||
this.listToPresentexpediente = ExpedienteTask;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -444,9 +452,9 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
viewExpedientListPage(){
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
if( window.innerWidth < 701){
|
||||
viewExpedientListPage() {
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
else {
|
||||
@@ -454,8 +462,8 @@ export class EventsPage implements OnInit {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
if( window.innerWidth < 701){
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user