mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Pull made
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DocumentCounterService } from './document-counter.service';
|
||||
|
||||
describe('DocumentCounterService', () => {
|
||||
let service: DocumentCounterService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DocumentCounterService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
||||
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
||||
import { ExpedienteprStore } from 'src/app/store/expedientepr-store.service';
|
||||
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DocumentCounterService {
|
||||
|
||||
expedienteGbStore = ExpedienteGdStore;
|
||||
pendentesStore = PendentesStore;
|
||||
despachoStore = DespachoStore;
|
||||
eventoAprovacaoStore = EventoAprovacaoStore;
|
||||
pedidosStore = PedidosStore;
|
||||
expedientePrStore = ExpedienteprStore;
|
||||
despachoPrStore = DespachosprStore;
|
||||
|
||||
constructor() { }
|
||||
|
||||
// falta a contagem dos deplomas
|
||||
get mdTotalDocument() {
|
||||
return this.despachoStore.count + this.expedienteGbStore.count + this.pedidosStore.countdeferimento
|
||||
+ this.pedidosStore.countparecer + this.expedientePrStore.count + this.despachoPrStore.count + this.pendentesStore.count
|
||||
+ this.eventoAprovacaoStore.count
|
||||
}
|
||||
|
||||
get prTotalDocument() {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DespachoMdService } from './despacho-md.service';
|
||||
import { DespachoService } from './despacho.service';
|
||||
|
||||
describe('DespachoMdService', () => {
|
||||
let service: DespachoMdService;
|
||||
describe('DespachoService', () => {
|
||||
let service: DespachoService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DespachoMdService);
|
||||
service = TestBed.inject(DespachoService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
@@ -1,12 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ProcessesService } from '../services/processes.service';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DespachoMdService {
|
||||
|
||||
export class DespachoService {
|
||||
/**
|
||||
* @description para terminar o
|
||||
* 95 - signfica
|
||||
@@ -16,10 +14,10 @@ export class DespachoMdService {
|
||||
|
||||
action: "Arquivo" | "Reencaminhar"
|
||||
|
||||
constructor(
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
) { }
|
||||
|
||||
) { }
|
||||
|
||||
arquivar(note:string, documents:any, serialnumber) {
|
||||
|
||||
let body = {
|
||||
@@ -34,7 +32,7 @@ export class DespachoMdService {
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
|
||||
reencaminhar(note:string, documents:any, serialnumber) {
|
||||
|
||||
let body = {
|
||||
@@ -49,7 +47,7 @@ export class DespachoMdService {
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
|
||||
executado(note:string, documents:any , serialnumber) {
|
||||
|
||||
let body = {
|
||||
@@ -64,10 +62,9 @@ export class DespachoMdService {
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
|
||||
sendExpedienteToPending(serialnumber) {
|
||||
|
||||
return this.processes.SetTaskToPending(serialnumber)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UserService } from './user.service';
|
||||
|
||||
describe('UserService', () => {
|
||||
let service: UserService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(UserService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
changeProfilePicture(){}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,8 @@
|
||||
<ion-tab-button tab="gabinete-digital">
|
||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
||||
<ion-badge color="danger">{{totalExpediente}}</ion-badge>
|
||||
<ion-badge color="danger" *ngIf="p.userRole(['MDGPR'])" >{{documentCounterService.mdTotalDocument}}</ion-badge>
|
||||
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >0</ion-badge>
|
||||
<ion-label>Gabinete</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="publications">
|
||||
|
||||
@@ -11,6 +11,8 @@ import { ModalController, AlertController, AnimationController, Platform } from
|
||||
import { NavigationExtras, Router, ActivatedRoute } from '@angular/router';
|
||||
import { ToastService } from '../services/toast.service';
|
||||
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
|
||||
import { DocumentCounterService } from 'src/app/OtherService/document-counter.service'
|
||||
import { PermissionService } from '../OtherService/permission.service';
|
||||
|
||||
|
||||
// import * as Sentry from "@sentry/browser";
|
||||
@@ -69,7 +71,9 @@ export class HomePage implements OnInit {
|
||||
public modalCtrl: AlertController,
|
||||
private notificatinsservice: NotificationsService,
|
||||
private platform: Platform,
|
||||
private activeroute: ActivatedRoute,) {
|
||||
private activeroute: ActivatedRoute,
|
||||
public documentCounterService: DocumentCounterService,
|
||||
public p: PermissionService) {
|
||||
|
||||
this.router.events.subscribe((val) => {
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<div class="main-content d-flex height-100">
|
||||
<div *ngIf="LoadedDocument" class="content d-flex flex-column">
|
||||
<div class="main-header">
|
||||
<div class="title-content width-100">
|
||||
<div class="title-content width-100 d-flex">
|
||||
<app-btn-modal-dismiss></app-btn-modal-dismiss>
|
||||
<div class="middle">
|
||||
<ion-label class="title">{{LoadedDocument.Subject}}</ion-label>
|
||||
<ion-label class="title">{{LoadedDocument.Assunto}}</ion-label>
|
||||
</div>
|
||||
<div class="div-icon">
|
||||
<ion-menu-button >
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="upper-content">
|
||||
<div class="content-details">
|
||||
<ion-label>
|
||||
<p><span class="date">{{customDate}}</span><span class="label">{{LoadedDocument.Type}}</span></p>
|
||||
<p><span class="date">{{customDate}}</span><span class="label" *ngIf="LoadedDocument.Nature">{{LoadedDocument.Nature}}</span></p>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,7 +43,7 @@
|
||||
<ion-item class="ion-no-margin ion-no-padding">
|
||||
<ion-label
|
||||
(click)="viewDocument()">
|
||||
<p class="attach-title-item">{{LoadedDocument.Subject}}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p class="attach-title-item">{{LoadedDocument.Assunto}}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p hidden><span class="span-left">Remetente</span><span class="span-right"></span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
|
||||
@@ -6,6 +6,8 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { FromSearchDocument, SearchFolder } from 'src/app/models/search-document';
|
||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||
|
||||
@Component({
|
||||
selector: 'app-document-detail',
|
||||
@@ -23,6 +25,9 @@ export class DocumentDetailPage implements OnInit {
|
||||
applicationId:string;
|
||||
LoadedDocument:any = null;
|
||||
|
||||
folder: SearchFolder
|
||||
document: FromSearchDocument
|
||||
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
private modalController: ModalController,
|
||||
@@ -57,7 +62,6 @@ export class DocumentDetailPage implements OnInit {
|
||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -75,30 +79,33 @@ export class DocumentDetailPage implements OnInit {
|
||||
// efetuar despacho
|
||||
async openExpedientActionsModal( taskAction: any) {
|
||||
|
||||
let task;
|
||||
let task: ExpedientTaskModalPageNavParamsTask
|
||||
|
||||
let document: FromSearchDocument = this.LoadedDocument
|
||||
let folder: SearchFolder = this.LoadedDocument
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361) {
|
||||
task = {
|
||||
serialNumber: this.LoadedDocument.DispatchNumber,
|
||||
taskStartDate: this.LoadedDocument.DateDispatch,
|
||||
serialNumber: folder.DispatchNumber,
|
||||
taskStartDate: folder.DateDispatch,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
FsId: folder.ApplicationID || folder.ApplicationId,
|
||||
FolderID: null,
|
||||
DocId: this.LoadedDocument.DispatchNumber,
|
||||
Subject: this.LoadedDocument.Assunto
|
||||
DocId: folder.DispatchNumber,
|
||||
Subject: folder.Assunto
|
||||
},
|
||||
}
|
||||
} else if (this.LoadedDocument.ApplicationID == 8 || this.LoadedDocument.ApplicationId == 8) {
|
||||
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
|
||||
task = {
|
||||
serialNumber: this.LoadedDocument.DocId,
|
||||
taskStartDate: this.LoadedDocument.DocDate,
|
||||
serialNumber: document.DocId,
|
||||
taskStartDate: document.DocDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: this.LoadedDocument.ApplicationID || this.LoadedDocument.ApplicationId,
|
||||
FsId: document.ApplicationID || document.ApplicationId,
|
||||
FolderID: null,
|
||||
DocId: this.LoadedDocument.DocId,
|
||||
Subject: this.LoadedDocument.Assunto
|
||||
DocId: document.DocId || document.DocID,
|
||||
Subject: document.Assunto
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,34 +131,35 @@ export class DocumentDetailPage implements OnInit {
|
||||
|
||||
async openBookMeetingModal() {
|
||||
|
||||
let document: FromSearchDocument = this.LoadedDocument
|
||||
let folder: SearchFolder = this.LoadedDocument
|
||||
let task;
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361) {
|
||||
if(folder.ApplicationID == 361) {
|
||||
task = {
|
||||
serialNumber: this.LoadedDocument.DispatchNumber,
|
||||
taskStartDate: this.LoadedDocument.DateDispatch,
|
||||
serialNumber: folder.DispatchNumber,
|
||||
taskStartDate: folder.DateDispatch,
|
||||
isEvent: true,
|
||||
Folio: this.LoadedDocument.Assunto,
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
Folio: folder.Assunto,
|
||||
FsId: folder.ApplicationID,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
FsId: folder.ApplicationID,
|
||||
FolderID: null,
|
||||
DocId: this.LoadedDocument.DispatchNumber,
|
||||
Subject: this.LoadedDocument.Assunto
|
||||
DocId: folder.DispatchNumber,
|
||||
Subject: folder.Assunto
|
||||
},
|
||||
}
|
||||
} else if (this.LoadedDocument.ApplicationID == 8 || this.LoadedDocument.ApplicationId == 8) {
|
||||
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
|
||||
task = {
|
||||
serialNumber: this.LoadedDocument.SourceId,
|
||||
taskStartDate: this.LoadedDocument.CreateDate,
|
||||
taskStartDate: document.DocDate,
|
||||
isEvent: true,
|
||||
Folio: this.LoadedDocument.Assunto,
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
Folio: document.Assunto,
|
||||
FsId: document.ApplicationID,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
FsId: document.ApplicationID || document.ApplicationId,
|
||||
FolderID: null,
|
||||
DocId: this.LoadedDocument.SourceId,
|
||||
Subject: this.LoadedDocument.SourceName
|
||||
DocId: document.DocID || document.DocId,
|
||||
Subject: document.Assunto
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,17 +10,17 @@ export class Attachments {
|
||||
|
||||
export class DocumentSetUpMeeting {
|
||||
EventProcess: {
|
||||
"SerialNumber"?: "sample string 1",
|
||||
"SerialNumber"?: string,
|
||||
"Body": string,
|
||||
"Location": string,
|
||||
"Subject": string,
|
||||
"StartDate"?: "2021-07-28T13:22:55.031857+01:00",
|
||||
"EndDate"?: "2021-07-28T13:22:55.031857+01:00",
|
||||
"ReviewUserComment"?: "sample string 7",
|
||||
"MDName"?: "sample string 8",
|
||||
"MDEmail"?: "sample string 9",
|
||||
"StartDate"?: string,
|
||||
"EndDate"?: string,
|
||||
"ReviewUserComment"?: string,
|
||||
"MDName"?: string,
|
||||
"MDEmail"?: string,
|
||||
"IsAllDayEvent"?: boolean,
|
||||
"Status"?: "sample string 11",
|
||||
"Status"?: string,
|
||||
"EventType"?: string,
|
||||
"IsRecurring": boolean,
|
||||
"ParticipantsList"?: EventPerson[],
|
||||
@@ -30,7 +30,7 @@ export class DocumentSetUpMeeting {
|
||||
"Day"?: 1,
|
||||
"DayOfWeek"?: 0,
|
||||
"Month"?: 1,
|
||||
"LastOccurrence"?: "2021-07-28T13:22:55.031857+01:00"
|
||||
"LastOccurrence"?: string
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
export class ExpedientTaskModalPageNavParamsTask {
|
||||
serialNumber: any
|
||||
taskStartDate: string
|
||||
isEvent: boolean
|
||||
workflowInstanceDataFields: {
|
||||
FsId: any,
|
||||
FolderID: string,
|
||||
DocId: any,
|
||||
DocID?: any
|
||||
Subject: string,
|
||||
DispatchNumber?: any
|
||||
}
|
||||
}
|
||||
|
||||
export class task extends ExpedientTaskModalPageNavParamsTask {}
|
||||
@@ -1,5 +1,4 @@
|
||||
export class SearchDocument {
|
||||
|
||||
ApplicationType: number | string;
|
||||
Assunto: string;
|
||||
Data: string;
|
||||
@@ -9,3 +8,40 @@ export class SearchDocument {
|
||||
Id: string;
|
||||
appName?: string;
|
||||
}
|
||||
|
||||
export class FromSearchDocument {
|
||||
ApplicationId: number
|
||||
ApplicationID: number
|
||||
Assunto: string
|
||||
DocDate: string
|
||||
DocId: number
|
||||
DocID?: number
|
||||
Sender: string
|
||||
SenderId: number
|
||||
}
|
||||
|
||||
|
||||
export class SearchFolder {
|
||||
ApplicationID: number
|
||||
ApplicationId: number
|
||||
Assunto:string
|
||||
DateDispatch: string
|
||||
DispatchNumber: string
|
||||
Docs: string
|
||||
Documents: {
|
||||
Assunto: string
|
||||
DocDate: string
|
||||
DocId: number
|
||||
DocNumber: string
|
||||
Sender: string
|
||||
}[]
|
||||
DocumentsTotal: 2
|
||||
IntervenerList: string[]
|
||||
Interveners: string
|
||||
Nature:string
|
||||
Sender: null | string
|
||||
SenderId: null | string
|
||||
Status: string
|
||||
folderId: number
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<button class="btn-no-color" *ngIf="showCalendar" (click)="calendarHeight='75px';showCalendar=false">
|
||||
<ion-icon class="collaps btn-no-color" src="assets/images/icons-collaps-up.svg" ></ion-icon>
|
||||
</button>
|
||||
<button class="btn-no-color" *ngIf="!showCalendar" (click)="calendarHeight='317px';showCalendar=true">
|
||||
<button class="btn-no-color" *ngIf="!showCalendar" (click)="calendarHeight='320px';showCalendar=true">
|
||||
<ion-icon class="collaps btn-no-color" src="assets/images/icons-collaps-down.svg" ></ion-icon>
|
||||
</button >
|
||||
|
||||
|
||||
@@ -82,8 +82,6 @@ export class AgendaPage implements OnInit {
|
||||
/* List of events of our calendar */
|
||||
eventSource : eventSource[] = []
|
||||
|
||||
|
||||
|
||||
/* The title of the calendar */
|
||||
viewTitle: string;
|
||||
|
||||
@@ -173,7 +171,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
this.calendarHeight = "317px";
|
||||
this.calendarHeight = "320px";
|
||||
this.showCalendar = true;
|
||||
this.timelineDate = momentG(new Date(),'dd MMMM yyyy');
|
||||
|
||||
@@ -590,7 +588,6 @@ export class AgendaPage implements OnInit {
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => {
|
||||
|
||||
|
||||
this.calendarService.removeRange(startTime, endTime, 'md')
|
||||
|
||||
const eventsList = res.filter(data => data.CalendarName == "Oficial");
|
||||
|
||||
@@ -81,7 +81,7 @@ export class DespachosPrPage implements OnInit {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
@@ -109,25 +109,29 @@ export class DespachosPrPage implements OnInit {
|
||||
|
||||
async LoadList() {
|
||||
|
||||
|
||||
|
||||
this.skeletonLoader = true
|
||||
|
||||
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
this.despachoList = [];
|
||||
this.skeletonLoader = false
|
||||
|
||||
this.skeletonLoader = false;
|
||||
console.log(result);
|
||||
|
||||
let despachosPr;
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = await result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
console.log(result);
|
||||
|
||||
despachosPr = await result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
console.log(despachosPr);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
console.log(despachosPr);
|
||||
despachosPr = despachosPr.filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||
|
||||
despachosPr.forEach( (element, index) => {
|
||||
@@ -163,11 +167,11 @@ export class DespachosPrPage implements OnInit {
|
||||
}
|
||||
|
||||
doRefresh() {
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
this.LoadList();
|
||||
}, 1000)
|
||||
|
||||
|
||||
}
|
||||
|
||||
async viewExpedientDetail(serialNumber:any) {
|
||||
|
||||
@@ -15,8 +15,7 @@ import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { DespachoMdService } from 'src/app/Rules/despacho-md.service'
|
||||
import { NavigationService } from 'src/app/services/navigation.service';
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||
import { Location } from '@angular/common'
|
||||
|
||||
@Component({
|
||||
@@ -47,14 +46,10 @@ export class DespachoPage implements OnInit {
|
||||
private events: EventsService,
|
||||
private menu: MenuController,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private despachoMdService: DespachoMdService,
|
||||
private navigationService: NavigationService,
|
||||
private despachoService: DespachoService,
|
||||
private location: Location
|
||||
|
||||
) {
|
||||
@@ -204,7 +199,7 @@ export class DespachoPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.despachoMdService.executado(note, documents, this.serialnumber)
|
||||
await this.despachoService.executado(note, documents, this.serialnumber)
|
||||
this.toastService.successMessage('Processo criado')
|
||||
this.close();
|
||||
} catch(error) {
|
||||
@@ -300,7 +295,7 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
async sendExpedienteToPending() {
|
||||
|
||||
this.despachoMdService.sendExpedienteToPending(this.serialnumber).subscribe(res=>{
|
||||
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res=>{
|
||||
this.goBack();
|
||||
this.toastService.successMessage('Processo enviado para despacho')
|
||||
},
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.pag
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { task } from 'src/app/models/ExpedientTaskModalPage';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -49,7 +50,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
'Solicitar Deferimento'
|
||||
];
|
||||
taskType:string;
|
||||
task: any;
|
||||
task: task;
|
||||
|
||||
taskParticipants: any = [];
|
||||
taskParticipantsCc: any = [];
|
||||
|
||||
@@ -7,6 +7,8 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -22,6 +24,7 @@ export class PendentesPage implements OnInit {
|
||||
serialNumber:string;
|
||||
totalDocs:any;
|
||||
showLoader: boolean;
|
||||
loggeduser: User;
|
||||
|
||||
@Input() profile:string;
|
||||
segment:string;
|
||||
@@ -32,8 +35,10 @@ export class PendentesPage implements OnInit {
|
||||
private processes:ProcessesService,
|
||||
private alertService: AlertService,
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.profile = 'mdgpr';
|
||||
}
|
||||
|
||||
@@ -43,7 +48,7 @@ export class PendentesPage implements OnInit {
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
@@ -69,12 +74,12 @@ export class PendentesPage implements OnInit {
|
||||
}
|
||||
|
||||
async LoadList(){
|
||||
|
||||
|
||||
this.skeletonLoader = true
|
||||
|
||||
|
||||
let pendentes = await this.processes.GetPendingTasks(false).toPromise();
|
||||
this.pendentesList = [];
|
||||
|
||||
|
||||
pendentes.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
@@ -100,7 +105,7 @@ export class PendentesPage implements OnInit {
|
||||
});
|
||||
this.pendentesstore.reset(this.pendentesList);
|
||||
this.skeletonLoader = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any){
|
||||
@@ -133,6 +138,9 @@ export class PendentesPage implements OnInit {
|
||||
else if(workflowName == 'Expediente'){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
else if(workflowName == 'Expediente do Presidente' && this.loggeduser.Profile == 'PR') {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -422,10 +422,8 @@ export class EditEventPage implements OnInit {
|
||||
this.loadedEventAttachments[index]['remove'] = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
async getDoc() {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-content" [ngSwitch]="segment" *ngIf="eventsMDGPRList">
|
||||
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment" *ngIf="eventsMDGPRList">
|
||||
<!-- <div class="header-content width-100"> -->
|
||||
|
||||
<!-- </div> -->
|
||||
|
||||
@@ -57,7 +57,7 @@ skeletonLoader = true
|
||||
}
|
||||
|
||||
doRefresh() {
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
//event.target.complete();
|
||||
@@ -88,7 +88,7 @@ skeletonLoader = true
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.originator.email,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
|
||||
@@ -8,6 +8,7 @@ import { ModalController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -24,6 +25,7 @@ export class PendentesPage implements OnInit {
|
||||
totalDocs:any;
|
||||
skeletonLoader: boolean;
|
||||
pendentesstore = PendentesStore;
|
||||
loggeduser: User;
|
||||
|
||||
@Input() profile:string;
|
||||
segment:string;
|
||||
@@ -37,6 +39,7 @@ export class PendentesPage implements OnInit {
|
||||
private router: Router,
|
||||
) {
|
||||
this.profile = 'mdgpr';
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -46,7 +49,7 @@ export class PendentesPage implements OnInit {
|
||||
this.LoadList();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart &&
|
||||
if (event instanceof NavigationStart &&
|
||||
event.url.startsWith('/home/gabinete-digital?pendentes=true')) {
|
||||
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
@@ -58,7 +61,7 @@ export class PendentesPage implements OnInit {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
@@ -72,10 +75,10 @@ export class PendentesPage implements OnInit {
|
||||
|
||||
async LoadList(){
|
||||
this.skeletonLoader = true;
|
||||
|
||||
|
||||
let pendentes = await this.processes.GetPendingTasks(false).toPromise();
|
||||
this.pendentesList = [];
|
||||
|
||||
|
||||
pendentes.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
@@ -114,7 +117,7 @@ export class PendentesPage implements OnInit {
|
||||
setTimeout(()=>{
|
||||
this.LoadList();
|
||||
}, 1000)
|
||||
|
||||
|
||||
}
|
||||
|
||||
async viewTaskDetails(serialNumber:string, workflowName:string , task) {
|
||||
@@ -127,14 +130,20 @@ export class PendentesPage implements OnInit {
|
||||
}
|
||||
else if(workflowName == 'Expediente') {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
|
||||
} else if (task.activityInstanceName == "Tarefa de Parecer") {
|
||||
}
|
||||
else if(workflowName == 'Expediente do Presidente' && this.loggeduser.Profile == 'PR') {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
else if (task.activityInstanceName == "Tarefa de Parecer") {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
|
||||
} else if(task.activityInstanceName == "Tarefa de Despacho") {
|
||||
}
|
||||
else if(task.activityInstanceName == "Tarefa de Despacho") {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
console.log('cant find page for this task', task)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<button (click)="openSearch();showSearch=true" *ngIf="!showSearch" class="btn-no-color">
|
||||
<ion-icon class="font-45" src='assets/images/icons-search.svg'></ion-icon>
|
||||
</button>
|
||||
<button class="btn-no-color" (click)="closeSearch();showSearch=false" *ngIf="showSearch" >
|
||||
<button class="btn-no-color" (click)="closeSearch();showSearch=false;searchSubject=''" *ngIf="showSearch" >
|
||||
<ion-icon class="font-40" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</button>
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ export class HeaderPage implements OnInit {
|
||||
window['dynamicSearch'](this.searchSubject)
|
||||
}
|
||||
|
||||
async basicSearch(){
|
||||
async basicSearch() {
|
||||
window['searchTriger']()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ export class DespachoStoreService {
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = this._list.length || 0
|
||||
this._list = restore.list || []
|
||||
this._count = parseInt(restore.count) || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -36,20 +36,21 @@ export class DespachoStoreService {
|
||||
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
this.save()
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
private save() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
count: this._list.length
|
||||
list: this._list,
|
||||
count: this._count
|
||||
})
|
||||
}, 10)
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ export class DespachosPageStoreService {
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = this._list.length || 0
|
||||
this._list = restore.list || []
|
||||
this._count = parseInt(restore.count) || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -35,23 +35,23 @@ export class DespachosPageStoreService {
|
||||
}
|
||||
set count(value) {
|
||||
this._count = value
|
||||
this.save()
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
setTimeout(()=>{
|
||||
private save() {
|
||||
setTimeout(()=> {
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
count: this._list.length
|
||||
list: this._list,
|
||||
count: this._count
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ constructor() {
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = this._list.length || 0
|
||||
this._list = restore.list || []
|
||||
this._count = parseInt(restore.count) || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -30,25 +30,24 @@ get list() {
|
||||
return this._list || []
|
||||
}
|
||||
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
get count() { return this._count }
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
this.save()
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
private save() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
count: this._list
|
||||
list: this._list,
|
||||
count:this._count
|
||||
})
|
||||
}, 10)
|
||||
|
||||
|
||||
@@ -8,12 +8,14 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
export class EventoaprovacaoStoreService {
|
||||
|
||||
// main data
|
||||
private _listpr: Event[] = []
|
||||
private _listmd: Event[] = []
|
||||
private _listPr: any[] = []
|
||||
private _listMd: any[] = []
|
||||
// local storage keyName
|
||||
private keyNamemd: string;
|
||||
private keyNamepr: string;
|
||||
private _count = 0
|
||||
_countPr = 0
|
||||
_countMd = 0
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -22,59 +24,67 @@ export class EventoaprovacaoStoreService {
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restoremd = localstoreService.get(this.keyNamemd, {})
|
||||
let restorepr = localstoreService.get(this.keyNamepr, {})
|
||||
let restoreMd = localstoreService.get(this.keyNamemd, {})
|
||||
let restorePr = localstoreService.get(this.keyNamepr, {})
|
||||
|
||||
this._listpr = restorepr.eventsListpr || []
|
||||
this._listmd = restoremd.eventsListmd || []
|
||||
this._count = this._listpr.length + this._listmd.length || 0
|
||||
this._listPr = restorePr.lisMd || []
|
||||
this._listMd = restoreMd.listPr || []
|
||||
this._countMd = parseInt(restoreMd.countListMd) || 0
|
||||
this._countPr = parseInt(restoreMd.countListPr) || 0
|
||||
this._count = (this._countMd + this._countPr) || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get listpr() {
|
||||
return this._listpr
|
||||
}
|
||||
|
||||
get listmd() {
|
||||
return this._listmd
|
||||
}
|
||||
get listpr() { return this._listPr }
|
||||
get listmd() { return this._listMd }
|
||||
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
|
||||
get count() { return this._count }
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
}
|
||||
|
||||
resetpr(eventsList: any) {
|
||||
this._listpr = eventsList
|
||||
get countPr() { return this._countPr }
|
||||
set countPr (value) {
|
||||
this._countPr = value
|
||||
}
|
||||
|
||||
this.count = this._listmd.length + this.listpr.length
|
||||
this.savepr(this._listpr)
|
||||
get countMd() { return this._countMd }
|
||||
set countMd (value) {
|
||||
this._countMd = value
|
||||
}
|
||||
|
||||
resetpr(eventsList: any) {
|
||||
this._listPr = eventsList
|
||||
|
||||
this.countPr = this._listPr.length
|
||||
this.count = this.countPr + this.countMd
|
||||
|
||||
this.savePr()
|
||||
}
|
||||
|
||||
resetmd(eventsList: any) {
|
||||
this._listmd = eventsList
|
||||
this._listMd = eventsList
|
||||
|
||||
this.count = this._listmd.length + this.listpr.length
|
||||
this.savemd(this._listmd)
|
||||
this.countMd = this._listMd.length
|
||||
this.count = this.countPr + this.countMd
|
||||
this.saveMd()
|
||||
}
|
||||
|
||||
private savemd(eventsListmd: any) {
|
||||
private saveMd() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamemd,{
|
||||
eventsListmd,
|
||||
lisMd: this._listMd,
|
||||
countListMd: this._countMd
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
private savepr(eventsListpr: any) {
|
||||
private savePr() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamepr,{
|
||||
eventsListpr,
|
||||
listPr: this._listPr,
|
||||
countListPr: this._countPr
|
||||
})
|
||||
}, 10)
|
||||
|
||||
|
||||
@@ -37,20 +37,21 @@ class ExpedienteStorageServiceService {
|
||||
}
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
this.save()
|
||||
}
|
||||
|
||||
reset(list: any) {
|
||||
this._list = list
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save(list: any) {
|
||||
private save() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName, {
|
||||
list: list,
|
||||
count: this.count
|
||||
list: this._list,
|
||||
count: this._count
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ export class ExpedientegdStoreService {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name)).toString()
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(()=> {
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = this._list.length || 0
|
||||
this._list = restore.list || []
|
||||
this._count = parseInt(restore.count) || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -33,19 +33,21 @@ export class ExpedientegdStoreService {
|
||||
}
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
this.save()
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
private save() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
list: this._list,
|
||||
count: this._count
|
||||
})
|
||||
}, 10)
|
||||
|
||||
|
||||
@@ -6,51 +6,48 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ExpedienteprStoreService {
|
||||
// main data
|
||||
private _list: [] = []
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
// main data
|
||||
private _list: [] = []
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
|
||||
constructor() {
|
||||
constructor() {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name)).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = this._list.length || 0
|
||||
}, 10)
|
||||
this.keyName = (SHA1(this.constructor.name)).toString()
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.list || []
|
||||
this._count = parseInt(restore.count) || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
get list() {
|
||||
return this._list || []
|
||||
}
|
||||
get list() { return this._list || [] }
|
||||
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
}
|
||||
get count() { return this._count }
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
this.save()
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
}
|
||||
this.count = this._list.length
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
private save() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
list: this._list,
|
||||
count: this._count
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
})
|
||||
export class LocalstoreService {
|
||||
|
||||
private prefix = 'v13-'
|
||||
private prefix = 'v14-'
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -59,18 +59,16 @@ export class LocalstoreService {
|
||||
|
||||
export const localstoreService = new LocalstoreService()
|
||||
|
||||
// // Create WebSocket connection.
|
||||
// const socket = new WebSocket('ws://localhost:8080');
|
||||
|
||||
|
||||
// Create WebSocket connection.
|
||||
const socket = new WebSocket('ws://localhost:8080');
|
||||
|
||||
// Listen for messages
|
||||
socket.addEventListener('message', function (event) {
|
||||
console.log('Message from server ', event.data); // Message from server mobile first é fraco
|
||||
// // Listen for messages
|
||||
// socket.addEventListener('message', function (event) {
|
||||
// console.log('Message from server ', event.data); // Message from server mobile first é fraco
|
||||
|
||||
var p = Promise.resolve(event.data);
|
||||
p.then(function(v) {
|
||||
console.log(v); // mobile first é fraco
|
||||
});
|
||||
// var p = Promise.resolve(event.data);
|
||||
// p.then(function(v) {
|
||||
// console.log(v); // mobile first é fraco
|
||||
// });
|
||||
|
||||
});
|
||||
// });
|
||||
@@ -7,86 +7,89 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
})
|
||||
export class PedidosStoreService {
|
||||
|
||||
private _listparecer: Event[] = []
|
||||
private _listdeferimento: Event[] = []
|
||||
private _listParecer: Event[] = []
|
||||
private _listDeferimento: Event[] = []
|
||||
// local storage keyName
|
||||
private keyNameparecer: string;
|
||||
private keyNamedeferiemnto: string;
|
||||
private _countparecer = 0
|
||||
private _countdeferiemnto = 0
|
||||
private _countDeferiemnto = 0
|
||||
|
||||
constructor() {
|
||||
|
||||
this.keyNameparecer = (SHA1(this.constructor.name+"parecer")).toString()
|
||||
this.keyNamedeferiemnto = (SHA1(this.constructor.name+"deferimneto")).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restoreparecer = localstoreService.get(this.keyNameparecer, {})
|
||||
let restoredeferimento = localstoreService.get(this.keyNamedeferiemnto, {})
|
||||
let restoreParecer = localstoreService.get(this.keyNameparecer, {})
|
||||
let restoreDeferimento = localstoreService.get(this.keyNamedeferiemnto, {})
|
||||
|
||||
this._listparecer = restoredeferimento.eventsListdeferimento || []
|
||||
this._listdeferimento = restoreparecer.eventsListparecer || []
|
||||
this._countparecer = this._listparecer.length || 0
|
||||
this._countdeferiemnto = this._listdeferimento.length || 0
|
||||
this._listParecer = restoreDeferimento.listDeferimento || []
|
||||
this._listDeferimento = restoreParecer.listParecer || []
|
||||
this._countparecer = parseInt(restoreParecer.count) || 0
|
||||
this._countDeferiemnto = parseInt(restoreDeferimento.count) || 0
|
||||
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get listparecer() {
|
||||
return this._listparecer
|
||||
return this._listParecer
|
||||
}
|
||||
|
||||
get listdeferimento() {
|
||||
return this._listdeferimento
|
||||
}
|
||||
return this._listDeferimento
|
||||
}
|
||||
|
||||
get countparecer() {
|
||||
return this._countparecer
|
||||
}
|
||||
set countparecer(value: number) {
|
||||
this._countparecer = value
|
||||
this.saveParecer()
|
||||
}
|
||||
|
||||
get countdeferimento() {
|
||||
return this._countdeferiemnto
|
||||
return this._countDeferiemnto
|
||||
}
|
||||
set countdeferimento(value: number ) {
|
||||
this._countdeferiemnto = value
|
||||
this._countDeferiemnto = value
|
||||
this.saveDeferimento()
|
||||
}
|
||||
|
||||
resetparecer(eventsList: any) {
|
||||
this._listparecer = eventsList
|
||||
this._listParecer = eventsList
|
||||
|
||||
this.countparecer = this._listparecer.length
|
||||
this.savedeferimento(this._listparecer)
|
||||
this.countparecer = this._listParecer.length
|
||||
this.saveDeferimento()
|
||||
}
|
||||
|
||||
resetdeferimento(eventsList: any) {
|
||||
this._listdeferimento = eventsList
|
||||
resetdeferimento(list: any) {
|
||||
this._listDeferimento = list
|
||||
|
||||
this.countdeferimento =this._listdeferimento.length
|
||||
this.saveparecer(this._listdeferimento)
|
||||
}
|
||||
private saveparecer(eventsListparecer: any) {
|
||||
this.countdeferimento =this._listDeferimento.length
|
||||
this.saveParecer()
|
||||
}
|
||||
|
||||
private saveParecer() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNameparecer,{
|
||||
eventsListparecer,
|
||||
count: this._listparecer,
|
||||
listParecer: this._listParecer,
|
||||
count: this._countparecer,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
private savedeferimento(eventsListdeferimento: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamedeferiemnto,{
|
||||
eventsListdeferimento,
|
||||
count: this._listdeferimento,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
private saveDeferimento() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamedeferiemnto,{
|
||||
listDeferimento: this._listParecer,
|
||||
count: this._countDeferiemnto,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,52 +8,53 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
export class PendestesStoreService {
|
||||
|
||||
// main data
|
||||
private _list = []
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
private _list = []
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
|
||||
constructor() {
|
||||
constructor() {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name)).toString()
|
||||
this.keyName = (SHA1(this.constructor.name)).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.list || []
|
||||
this._count = parseInt(restore.count) || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = this._list.length || 0
|
||||
}, 10)
|
||||
get list() {
|
||||
return this._list
|
||||
}
|
||||
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
this.save()
|
||||
}
|
||||
set count(value) {
|
||||
this._count = value
|
||||
}
|
||||
|
||||
get list() {
|
||||
return this._list
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
set count(value) {
|
||||
this._count = value
|
||||
}
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
this.count = this._list.length
|
||||
this.save()
|
||||
}
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
count: this._list.length
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
private save() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
list: this._list,
|
||||
count: this._list.length
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const PendentesStore = new PendestesStoreService()
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ export class PresidentialActionsStoreService {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name+ 'presidentialActions/local')).toString()
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, [])
|
||||
this._list = restore
|
||||
this._list = restore.list
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -36,7 +36,9 @@ export class PresidentialActionsStoreService {
|
||||
|
||||
private save(list: Publication[]) {
|
||||
setTimeout(()=> {
|
||||
localstoreService.set(this.keyName, list)
|
||||
localstoreService.set(this.keyName, {
|
||||
list: this._list
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export class PublicationEventFolderService {
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, [])
|
||||
this._list = restore
|
||||
this._list = restore.list
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -30,12 +30,14 @@ export class PublicationEventFolderService {
|
||||
reset(list: PublicationFolder[]) {
|
||||
this._list = list
|
||||
|
||||
this.save(this._list)
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save(list: PublicationFolder[]) {
|
||||
private save() {
|
||||
setTimeout(()=> {
|
||||
localstoreService.set(this.keyName, list)
|
||||
localstoreService.set(this.keyName, {
|
||||
list: this._list
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export class PublicationListService {
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, [])
|
||||
this._document = restore
|
||||
this._document = restore.document
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -36,7 +36,9 @@ export class PublicationListService {
|
||||
this._document[folderId] = document
|
||||
|
||||
setTimeout(()=> {
|
||||
localstoreService.set(this.keyName, this._document)
|
||||
localstoreService.set(this.keyName, {
|
||||
document: this._document
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export class PublicationTravelFolderService {
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, [])
|
||||
this._list = restore
|
||||
this._list = restore.list
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -37,7 +37,9 @@ export class PublicationTravelFolderService {
|
||||
|
||||
private save(list: PublicationFolder[]) {
|
||||
setTimeout(()=> {
|
||||
localstoreService.set(this.keyName, list)
|
||||
localstoreService.set(this.keyName, {
|
||||
list: this._list
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ export class ToDayEventStorageService {
|
||||
this.keyName = (SHA1(this.constructor.name+ 'home/eventSource')).toString()
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._eventsList = restore.eventsList || []
|
||||
this._count = this._eventsList.length || 0
|
||||
this._count = parseInt(restore.count) || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -36,19 +36,20 @@ export class ToDayEventStorageService {
|
||||
}
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
this.save()
|
||||
}
|
||||
|
||||
reset(eventsList: Event[]) {
|
||||
this._eventsList = eventsList
|
||||
|
||||
this.count = this._eventsList.length
|
||||
this.save(this._eventsList)
|
||||
this.save()
|
||||
}
|
||||
|
||||
private save(eventsList: Event[]) {
|
||||
private save() {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
eventsList :this._eventsList,
|
||||
count: this._eventsList
|
||||
})
|
||||
}, 10)
|
||||
|
||||
Reference in New Issue
Block a user