add seach button

This commit is contained in:
Peter Maquiran
2023-04-20 11:45:46 +01:00
parent 15276dfc1a
commit 47dd1b2bc8
12 changed files with 274 additions and 165 deletions
+11
View File
@@ -145,6 +145,7 @@
"jest-puppeteer": "^7.0.1", "jest-puppeteer": "^7.0.1",
"jetifier": "^1.6.8", "jetifier": "^1.6.8",
"lite-server": "^2.6.1", "lite-server": "^2.6.1",
"minisearch": "^6.0.1",
"moment": "^2.29.3", "moment": "^2.29.3",
"ng-lazyload-image": "^9.1.2", "ng-lazyload-image": "^9.1.2",
"ng2-pdf-viewer": "^3.0.8", "ng2-pdf-viewer": "^3.0.8",
@@ -22855,6 +22856,11 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/minisearch": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/minisearch/-/minisearch-6.0.1.tgz",
"integrity": "sha512-Ly1w0nHKnlhAAh6/BF/+9NgzXfoJxaJ8nhopFhQ3NcvFJrFIL+iCg9gw9e9UMBD+XIsp/RyznJ/o5UIe5Kw+kg=="
},
"node_modules/minizlib": { "node_modules/minizlib": {
"version": "2.1.2", "version": "2.1.2",
"license": "MIT", "license": "MIT",
@@ -55206,6 +55212,11 @@
"minipass": "^3.0.0" "minipass": "^3.0.0"
} }
}, },
"minisearch": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/minisearch/-/minisearch-6.0.1.tgz",
"integrity": "sha512-Ly1w0nHKnlhAAh6/BF/+9NgzXfoJxaJ8nhopFhQ3NcvFJrFIL+iCg9gw9e9UMBD+XIsp/RyznJ/o5UIe5Kw+kg=="
},
"minizlib": { "minizlib": {
"version": "2.1.2", "version": "2.1.2",
"requires": { "requires": {
+1
View File
@@ -155,6 +155,7 @@
"jest-puppeteer": "^7.0.1", "jest-puppeteer": "^7.0.1",
"jetifier": "^1.6.8", "jetifier": "^1.6.8",
"lite-server": "^2.6.1", "lite-server": "^2.6.1",
"minisearch": "^6.0.1",
"moment": "^2.29.3", "moment": "^2.29.3",
"ng-lazyload-image": "^9.1.2", "ng-lazyload-image": "^9.1.2",
"ng2-pdf-viewer": "^3.0.8", "ng2-pdf-viewer": "^3.0.8",
@@ -27,40 +27,79 @@
</ion-segment-button> </ion-segment-button>
</ion-segment> </ion-segment>
<div *ngIf="segmentVista == 'listview' ">
<mat-form-field class="task-filter-input" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda">
<mat-select [(value)]="filterName">
<mat-option value="Para hoje" >
Para hoje
</mat-option>
<mat-option value="Novos" >
Novos
</mat-option>
<mat-option value="Lidos" >
Lidos
</mat-option>
<mat-option value="Não lidos" >
Não lidos
</mat-option>
<mat-option value="OverdueTasks">
Em atraso
</mat-option>
<mat-option value="Todos" >
Todos
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div> </div>
</div> </div>
<div *ngIf="segmentVista == 'listview' " class="d-flex px-30 justify-content-end">
<div title="Pesquisa" *ngIf="!hideSearchBtn" class="mr-20 d-flex align-center cursor-pointer">
<div (click)="openSearch();showSearch=true" *ngIf="!showSearch" class="d-flex">
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-35" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'default' " class="font-35" src='assets/images/icons-search.svg'></ion-icon>
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'gov' " class="font-35" src='assets/images/theme/gov/icons-search.svg'></ion-icon>
</div>
<button title="Fechar" class="btn-no-color d-flex" (click)="closeSearch();showSearch=false;searchSubject=''" *ngIf="showSearch">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-35" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-35" name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</button>
<div *ngIf="showSearch">
<div class="d-flex search-input-container ml-10 justify-between" *ngIf="showSearch">
<!-- <div class="icon" (click)="basicSearch()">
<ion-icon class="icon-z" slot="end" name="search"></ion-icon>
</div> -->
<div class="input-text d-flex ion-align-items-center">
<ion-input (keyup.enter)="basicSearch()" [(ngModel)]='searchSubject' (ngModelChange)="dynamicSearch()"
class="search-input text-black" type="search" placeholder="Pesquisar"></ion-input>
</div>
<!-- <div class="icon" (click)="clearSearchInput()">
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'default' "name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'doneIt' "name="restaurant-outline" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'gov' " name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</div> -->
<div (click)="basicSearch()" class="d-flex align-center icon">
<ion-icon class="icon-z" slot="end" src="assets/images/theme/gov/search.svg"></ion-icon>
</div>
</div>
</div>
</div>
<div>
<mat-form-field class="task-filter-input" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda">
<mat-select [(value)]="filterName">
<mat-option value="Para hoje" >
Para hoje
</mat-option>
<mat-option value="Novos" >
Novos
</mat-option>
<mat-option value="Lidos" >
Lidos
</mat-option>
<mat-option value="Não lidos" >
Não lidos
</mat-option>
<mat-option value="OverdueTasks">
Em atraso
</mat-option>
<mat-option value="Todos" >
Todos
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<div [ngSwitch]="segmentVista" class="overflow-y-auto"> <div [ngSwitch]="segmentVista" class="overflow-y-auto">
<!-- This is the list view --> <!-- This is the list view -->
@@ -693,4 +693,27 @@ ion-content{
.new-task-count{ .new-task-count{
color: red; color: red;
font-size: 13px; font-size: 13px;
} }
.search-input-container{
background-color: white;
border-radius: 27.5px;
border: solid 1px #ebebeb;
font-size: 14px;
.icon{
color: #797979;
width: 41px;
height: 41px;
display: flex;
justify-content: center;
font-size: 25px;
align-items: center;
}
.input-text{
width: 100%;
}
.icon-z{
width: 20px;
}
}
@@ -7,17 +7,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page'; import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page'; import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page';
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page'; import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
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 { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { WaitForDomService } from 'src/app/services/dom/wait-for-dom.service'; import { WaitForDomService } from 'src/app/services/dom/wait-for-dom.service';
import { TotalDocumentStore } from 'src/app/store/total-document.service';
import { DeplomasStore } from 'src/app/store/deplomas.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { DespachoService } from 'src/app/Rules/despacho.service'; import { DespachoService } from 'src/app/Rules/despacho.service';
@@ -106,6 +96,11 @@ export class GabineteDigitalPage implements OnInit {
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos' filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
hideSearchBtn: boolean = false;
showSearch = false;
searchSubject: string = '';
constructor( constructor(
private processesbackend: ProcessesService, private processesbackend: ProcessesService,
private modalController: ModalController, private modalController: ModalController,
@@ -153,6 +148,11 @@ export class GabineteDigitalPage implements OnInit {
} }
openSearch() {}
async closeSearch() {}
async basicSearch() {}
async dynamicSearch() {}
ngOnInit() { ngOnInit() {
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
@@ -173,11 +173,11 @@ export class GabineteDigitalPage implements OnInit {
callback: () => { callback: () => {
if(this.NotificationsService.active === false) { if(this.NotificationsService.active === false) {
this.checkRoutes(); this.checkRoutes();
this.LoadCounts(); // this.LoadCounts();
this.checkFilter() this.checkFilter()
} else { } else {
this.checkRoutes(); this.checkRoutes();
this.LoadCounts(); // this.LoadCounts();
this.checkFilter() this.checkFilter()
} }
} }
+24 -22
View File
@@ -5,33 +5,35 @@ import { Pipe, PipeTransform } from '@angular/core';
}) })
export class EventoApprovePipe implements PipeTransform { export class EventoApprovePipe implements PipeTransform {
transform(fullTask): unknown { transform(fullTask, obj): any {
let date = new Date(fullTask.taskStartDate); let date = new Date(fullTask.taskStartDate);
let month = date.getMonth() + 1; let month = date.getMonth() + 1;
let taskDate = date.getFullYear() + "-" + month +"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds(); let taskDate = date.getFullYear() + "-" + month +"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
return { return Object.assign({
"SerialNumber": fullTask.serialNumber, "SerialNumber": fullTask.serialNumber,
"Folio": fullTask.workflowInstanceDataFields.Subject, "Folio": fullTask.workflowInstanceDataFields.Subject,
"Event": { "Event": {
StartDate: '', StartDate: '',
EndDate: '', EndDate: '',
Agenda: '', Agenda: '',
Location: '' Location: ''
},
"CreateDate": taskDate,
"TaskStartDate": fullTask.taskStartDate,
"DocumentURL": fullTask.workflowInstanceDataFields.ViewerRequest,
"Remetente": fullTask.workflowInstanceDataFields.Remetente,
"DocumentsQty": fullTask.totalDocuments,
"DocId": fullTask.workflowInstanceDataFields.DispatchDocId,
"FolderID": fullTask.workflowInstanceDataFields.FolderID,
"WorkflowName": fullTask.workflowDisplayName,
"activityInstanceName": fullTask.activityInstanceName,
"Status": fullTask.workflowInstanceDataFields.Status,
"Deadline": fullTask.deadline,
"TaskStatus": fullTask.taskStatus,
}, },
"CreateDate": taskDate, obj
"TaskStartDate": fullTask.taskStartDate, )
"DocumentURL": fullTask.workflowInstanceDataFields.ViewerRequest,
"Remetente": fullTask.workflowInstanceDataFields.Remetente,
"DocumentsQty": fullTask.totalDocuments,
"DocId": fullTask.workflowInstanceDataFields.DispatchDocId,
"FolderID": fullTask.workflowInstanceDataFields.FolderID,
"WorkflowName": fullTask.workflowDisplayName,
"activityInstanceName": fullTask.activityInstanceName,
"Status": fullTask.workflowInstanceDataFields.Status,
"Deadline": fullTask.deadline,
"TaskStatus": fullTask.taskStatus
}
} }
} }
+23
View File
@@ -47,6 +47,14 @@ export class TaskService {
expedienteTaskPipe = new ExpedienteTaskPipe(); expedienteTaskPipe = new ExpedienteTaskPipe();
customTaskPipe = new CustomTaskPipe() customTaskPipe = new CustomTaskPipe()
callbacks: {
[key: string]: {
funx: Function
id: string
}
} = {}
constructor( constructor(
private processesbackend: ProcessesService, private processesbackend: ProcessesService,
private despachoRule: DespachoService, private despachoRule: DespachoService,
@@ -61,6 +69,17 @@ export class TaskService {
} }
registerCallback({funx, id}) {
this.callbacks[id] = { funx, id}
}
runCallback() {
for (const [key, value] of Object.entries(this.callbacks)) {
value.funx()
}
}
deadlineIsToday(isoDateString:string) { deadlineIsToday(isoDateString:string) {
if(!isoDateString) { if(!isoDateString) {
@@ -111,6 +130,8 @@ export class TaskService {
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) 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.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() .concat(this.pendentesstore.list as any)).reverse()
this.runCallback();
} }
sortArrayISODate(myArray: any): any[] { sortArrayISODate(myArray: any): any[] {
@@ -208,6 +229,8 @@ export class TaskService {
} }
this.runCallback();
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma"); let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
diplomasValidar = diplomasValidar.filter(data => data.activityInstanceName != "Tarefa de Despacho"); diplomasValidar = diplomasValidar.filter(data => data.activityInstanceName != "Tarefa de Despacho");
@@ -3,7 +3,43 @@
<div class="title"> <div class="title">
<div class="thetitle"><ion-label >Todas as tarefas</ion-label></div> <div class="thetitle"><ion-label >Todas as tarefas</ion-label></div>
<div class="theicon"> <div class="theicon d-flex">
<div>
<div title="Pesquisa" *ngIf="!hideSearchBtn" class="mr-20 d-flex align-center cursor-pointer">
<div style="padding-top: 5px;" (click)="openSearch();showSearch=true" *ngIf="!showSearch">
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-35" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'default' " class="font-35" src='assets/images/icons-search.svg'></ion-icon>
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'gov' " class="font-35" src='assets/images/theme/gov/icons-search.svg'></ion-icon>
</div>
<button title="Fechar" class="btn-no-color d-flex" (click)="closeSearch();showSearch=false;searchSubject=''" *ngIf="showSearch">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-35" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-35" name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</button>
<div *ngIf="showSearch">
<div class="d-flex search-input-container ml-10 justify-between" *ngIf="showSearch">
<!-- <div class="icon" (click)="basicSearch()">
<ion-icon class="icon-z" slot="end" name="search"></ion-icon>
</div> -->
<div class="input-text d-flex ion-align-items-center">
<ion-input (keyup.enter)="basicSearch()" [(ngModel)]='searchSubject' (ngModelChange)="dynamicSearch()"
class="search-input text-black" type="search" placeholder="Pesquisar"></ion-input>
</div>
<!-- <div class="icon" (click)="clearSearchInput()">
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'default' "name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'doneIt' "name="restaurant-outline" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'gov' " name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</div> -->
<div (click)="basicSearch()" class="d-flex align-center icon">
<ion-icon class="icon-z" slot="end" src="assets/images/theme/gov/search.svg"></ion-icon>
</div>
</div>
</div>
</div>
</div>
<div> <div>
<mat-form-field class="task-filter-input" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda"> <mat-form-field class="task-filter-input" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda">
<mat-select [(value)]="filterName"> <mat-select [(value)]="filterName">
@@ -42,7 +78,7 @@
</div> </div>
</ion-header> </ion-header>
<ion-content> <ion-content>
<!--
<ion-refresher name="refresher" slot="fixed" > <ion-refresher name="refresher" slot="fixed" >
<ion-refresher-content <ion-refresher-content
pullingIcon="chevron-down-circle-outline" pullingIcon="chevron-down-circle-outline"
@@ -51,7 +87,7 @@
refreshingText="A actualizar..."> refreshingText="A actualizar...">
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher> -->
<div class="overflow-y-auto height-100 width-100"> <div class="overflow-y-auto height-100 width-100">
@@ -167,4 +167,29 @@ ion-list{
.new-task { .new-task {
height: 23px; height: 23px;
} }
.search-input-container{
background-color: white;
border-radius: 27.5px;
border: solid 1px #ebebeb;
font-size: 14px;
.icon{
color: #797979;
width: 41px;
height: 41px;
display: flex;
justify-content: center;
font-size: 25px;
align-items: center;
}
.input-text{
width: 100%;
}
.icon-z{
width: 20px;
}
}
@@ -1,17 +1,10 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationEnd, NavigationStart, Router } from '@angular/router'; import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { LoginUserRespose } from 'src/app/models/user.model'; import { LoginUserRespose } from 'src/app/models/user.model';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { DeplomasStore } from 'src/app/store/deplomas.service';
import { PendentesStore } from 'src/app/store/pendestes-store.service';
import { DespachoStore } from 'src/app/store/despacho-store.service';
import { TotalDocumentStore } from 'src/app/store/total-document.service';
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
import { PedidosStore } from 'src/app/store/pedidos-store.service';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import MiniSearch from 'minisearch'
@Component({ @Component({
selector: 'app-all-processes', selector: 'app-all-processes',
@@ -21,29 +14,24 @@ import { TaskService } from 'src/app/services/task.service'
export class AllProcessesPage implements OnInit { export class AllProcessesPage implements OnInit {
skeletonLoader = false; skeletonLoader = false;
allProcessesList: any[] = [];
loggeduser: LoginUserRespose; loggeduser: LoginUserRespose;
hideSearchBtn: boolean = false;
showSearch = false;
expedientegbstore = ExpedienteGdStore; searchSubject: string = '';
pendentesstore = PendentesStore;
despachoStore = DespachoStore;
eventoaprovacaostore = EventoAprovacaoStore;
pedidosstore = PedidosStore;
despachoprstore = DespachosprStore;
totalDocumentStore = TotalDocumentStore
deplomasStore = DeplomasStore
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos' filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
miniSearch = new MiniSearch({
fields: ['Folio', 'Senders'], // fields to index for full-text search
idField: 'DocId'
})
constructor( constructor(
private router: Router, private router: Router,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public TaskService: TaskService, public TaskService: TaskService,
private route: ActivatedRoute private route: ActivatedRoute
) { ) {}
this.loggeduser = SessionStore.user;
}
ngOnInit() { ngOnInit() {
// this.updateAllProcess() // this.updateAllProcess()
@@ -51,14 +39,32 @@ export class AllProcessesPage implements OnInit {
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.includes('/home/gabinete-digital')) { if (event instanceof NavigationEnd && event.url.includes('/home/gabinete-digital')) {
this.refreshing(); // this.refreshing();
this.checkFilter(); this.checkFilter();
} }
}); });
setTimeout(() => {
console.log('this.TaskService.AllProcess', this.TaskService.AllProcess)
this.miniSearch.addAll(this.TaskService.AllProcess)
window['miniSearch'] = this.miniSearch
}, 5000)
this.TaskService.registerCallback({
id: import.meta.url,
funx:() => {
}
})
} }
openSearch() {}
async closeSearch() {}
async basicSearch() {}
async dynamicSearch() {}
checkFilter() { checkFilter() {
if(this.router.url.includes('ForToDay')) { if(this.router.url.includes('ForToDay')) {
@@ -72,69 +78,6 @@ export class AllProcessesPage implements OnInit {
} }
} }
doRefresh(event) {
if (event) {
setTimeout(() => {
try {
event?.target?.complete();
} catch(error) {}
}, 2000);
}
setTimeout(() => {
// this.updateAllProcess();
}, 1000);
}
refreshing() {
setTimeout(() => {
// this.updateAllProcess();
}, 1000);
}
setFormatDate(start: any, end: any, allday: boolean) {
let customDate;
const totalSeconds = Math.floor((end - (start)) / 1000);;
const totalMinutes = Math.floor(totalSeconds / 60);
const totalHours = Math.floor(totalMinutes / 60);
const totalDays = Math.floor(totalHours / 24);
const hours = totalHours - (totalDays * 24);
const minutes = totalMinutes - (totalDays * 24 * 60) - (hours * 60);
const seconds = totalSeconds - (totalDays * 24 * 60 * 60) - (hours * 60 * 60) - (minutes * 60);
if (totalDays == 0) {
if (allday) {
customDate = this.getCustomDate(start) + ", " + this.getCustomHours(start) + " (todo dia)";
return customDate;
}
else {
//customDate = this.getCustomDate(start)+","+this.getCustomHours(start)+" ("+minutes+" mins)";
customDate = this.getCustomDate(start) + ", " + this.getCustomHours(start) + " | " + this.getCustomHours(end);
return customDate;
}
}
else {
customDate = this.getCustomDate(start) + "," + this.getCustomHours(start) +
" (termina:" + this.getCustomDate(end) + "," + this.getCustomHours(end) + ")";
return customDate;
}
}
getCustomDate(thedate: Date) {
return (thedate.getDay() + 1) + "/" +
(thedate.getMonth() + 1) + "/" +
thedate.getFullYear();
}
getCustomHours(thedate: Date) {
return thedate.getHours() + ":" +
thedate.getMinutes();
}
goToProcess(serialNumber: string, workflowName: string, activityName: string) { goToProcess(serialNumber: string, workflowName: string, activityName: string) {
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { localstoreService } from './localstore.service' import { localstoreService } from './localstore.service'
import { AES, enc, SHA1 } from 'crypto-js' import { AES, enc, SHA1 } from 'crypto-js'
import { isArray } from 'ionic-angular/umd/util/util'; import { isArray } from 'ionic-angular/umd/util/util';
import { EventoApprovePipe } from 'src/app/pipes/evento-approve.pipe'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -19,6 +20,8 @@ export class EventoaprovacaoStoreService {
private _countsAll = 0 private _countsAll = 0
EventoApprovePipe = new EventoApprovePipe()
callbacks: { callbacks: {
[key: string]: { [key: string]: {
funx: Function funx: Function
@@ -64,7 +67,7 @@ export class EventoaprovacaoStoreService {
} }
save(segment: string, value: []) { save(segment: string, value: any[]) {
if(typeof segment == 'object') { if(typeof segment == 'object') {
throw("segment most be userId") throw("segment most be userId")
@@ -75,6 +78,9 @@ export class EventoaprovacaoStoreService {
this._counts[segment] = 0 this._counts[segment] = 0
} }
value = value.map( e => this.EventoApprovePipe.transform(e, e))
this._list[segment] = value this._list[segment] = value
this._counts[segment] = value.length this._counts[segment] = value.length
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "9c304e23d", "shortSHA": "15276dfc1",
"SHA": "9c304e23d7f19029c7bb11093b1aea253abf4af3", "SHA": "15276dfc1a04fd46c5acb95f0c4df5c80cd97e35",
"branch": "feature/gabineteLabels", "branch": "feature/gabineteLabels",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Wed Apr 19 09:35:47 2023 +0100'", "lastCommitTime": "'Wed Apr 19 12:34:28 2023 +0100'",
"lastCommitMessage": "another one", "lastCommitMessage": "add search",
"lastCommitNumber": "4922", "lastCommitNumber": "4923",
"change": "", "change": "",
"changeStatus": "On branch feature/gabineteLabels\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.module.ts\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.html\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despachos.module.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despachos.page.html\n\tmodified: src/app/pages/gabinete-digital/despachos/despachos.page.ts\n\tmodified: src/app/shared/gabinete-digital/despachos/despachos.page.html\n\tmodified: src/app/shared/gabinete-digital/despachos/despachos.page.ts\n\tmodified: src/app/store/deplomas.service.ts\n\tmodified: src/app/store/despacho-store.service.ts\n\tmodified: src/app/store/despachospr-store.service.ts\n\tmodified: src/app/store/eventoaprovacao-store.service.ts\n\tmodified: src/app/store/expedientegd-store.service.ts\n\tmodified: src/app/store/pedidos-store.service.ts\n\tmodified: src/app/store/pendestes-store.service.ts", "changeStatus": "On branch feature/gabineteLabels\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: package-lock.json\n\tmodified: package.json\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.scss\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/pipes/evento-approve.pipe.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.html\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.scss\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.ts\n\tmodified: src/app/store/eventoaprovacao-store.service.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }