This commit is contained in:
Peter Maquiran
2022-09-26 23:14:19 +01:00
parent 6158e9a40e
commit efd35bced5
9 changed files with 450 additions and 25 deletions
@@ -16,8 +16,5 @@
"sound"
]
}
},
"server": {
"url": "http://192.168.0.37:8101"
}
}
+4 -3
View File
@@ -751,13 +751,14 @@ export class RoomService {
this.hasLoadHistoryMessageRF.includes(message?.localReference)
);
await this.messages.forEach( async (message, i) => {
let i = 0
for(let message of this.messages) {
if(this.hasLoadHistoryMessageRF.includes(message?.localReference)) {
this.messages.splice(i, 1)
}
})
i++;
}
this.hasLoadHistoryMessageRF = [];
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ExpedientsPage } from './expedients.page';
const routes: Routes = [
{
path: '',
component: ExpedientsPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ExpedientsPageRoutingModule {}
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { ExpedientsPageRoutingModule } from './expedients-routing.module';
import { ExpedientsPage } from './expedients.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ExpedientsPageRoutingModule
],
exports: [ExpedientsPage],
declarations: [ExpedientsPage]
})
export class ExpedientsPageModule {}
@@ -0,0 +1,95 @@
<ion-header class="ion-no-border">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div class="title">
<div class="thetitle"><ion-label >Expediente</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<div class="content width-100 overflow-y-auto height-100" >
<div >
<ion-list *ngIf="expedientegbstore.list.length >=0">
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of expedientegbstore.list"
(click)="goToExpediente(task.SerialNumber)"
>
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Subject }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-expediente-attachment.svg"></ion-icon>
<label *ngIf="task.DocumentsQty != 0">{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div class="exp-middle-detail">
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
</div>
</div>
</div>
</ion-list>
</div>
<div
*ngIf="!skeletonLoader && taskslist.length == 0 && taskslist.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && taskslist.length == 0">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,161 @@
@import '~src/function.scss';
//CONTENT
:host{
margin: 0;
}
.title{
font-family: Roboto;
font-size: 25px;
color:#000;
overflow: auto;
padding: 30px 20px 0 20px !important;
.thetitle{
width: fit-content;
float: left;
}
.theicon{
width: fit-content;
float: right;
}
}
//DIV
ion-item{
--background: none;
}
.item {
//border-radius: 15px;
//box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
//Sborder: solid 1px #e9e9e9;
//background-color: var(--white);
margin: 0 auto;
//padding: 10px;
overflow: auto;
}
/* New CSS */
.content{
padding: 0px 20px 0 20px !important;
}
.expediente{
border-radius: 15px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
border:1px solid #e9e9e9 !important;
//background-color: transparent;
margin-bottom: 10px !important;
padding: 15px;
}
.exp-list-item{
//width: 368px;
overflow: auto;
//border-bottom: 1px solid gray;
margin: 10px auto;
}
.exp-top-detail{
width: 100%;
float: left;
font-family: Roboto;
font-size: 12pt;
font-weight: 700;
color: var(--title-text-color);
padding-left: 3px;
.subject{
width: 84%;
float: left;
}
.exp-icon{
width: fit-content;
float: right;
//font-size: 13px;
margin: 0 !important;
padding: 0 !important;
ion-icon{
font-size: 12pt;
color: #42b9fe;
float: left;
}
label{
font-size: 10pt;
}
}
}
.exp-middle-detail, .exp-bottom-detail{
margin-bottom: 5px;
}
.exp-middle-detail{
font-size: 12pt;
width: 100%;
overflow: auto;
.exp-workflow{
float: left;
margin: 0 !important;
.label{
border-radius: 15px;
background: #ffb703;
//font-size: 12px;
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
color: #fff;
}
}
.exp-date{
width: auto;
font-family: Roboto;
font-size: 10pt;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #797979;
float: right;
}
}
.exp-bottom-detail{
font-size: 8pt;
width: 100%;
overflow: auto;
padding-left: 3px;
.exp-remetente{
//width: 200px;
font-family: Roboto;
//font-size: 13px;
font-weight: normal;
color: #000000;
float: left;
//border: 1px solid red;
}
}
.div-top-header{
width: 400px;
margin: 6px auto;
background-color: #0782c9;
overflow: auto;
}
.div-search{
font-size: 45px;
float: left;
margin: 0 0 0 10px
}
.div-logo{
background: transparent;
width: 150px;
margin: 2.5px 0 2.5px 71px;
float: left;
}
.div-logo img{
width: 100%;
}
.div-profile{
font-size: 45px;
float: right;
margin-right: 10px;
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ExpedientsPage } from './expedients.page';
describe('ExpedientsPage', () => {
let component: ExpedientsPage;
let fixture: ComponentFixture<ExpedientsPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ExpedientsPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ExpedientsPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,109 @@
import { Component, Input, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { ProcessesService } from 'src/app/services/processes.service';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
import { Storage } from '@ionic/storage';
@Component({
selector: 'app-expedients',
templateUrl: './expedients.page.html',
styleUrls: ['./expedients.page.scss'],
})
export class ExpedientsPage implements OnInit {
segment: string;
taskslist = [];
serialNumber: string;
@Input() profile: string;
skeletonLoader = true
expedientegbstore = ExpedienteGdStore
expedienteTaskPipe = new ExpedienteTaskPipe()
constructor(
private processes: ProcessesService,
private router: Router,
public ThemeService: ThemeService,
private sortService: SortService,
private storage: Storage
) {
this.profile = 'mdgpr';
}
ngOnInit() {
//Inicializar segment
this.segment = "expedientes";
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
} else {
this.LoadList()
}
}
});
}
segmentChanged() {
this.LoadList();
}
LoadList() {
this.skeletonLoader = true
this.processes.GetTaskListExpediente(false).subscribe(result => {
this.taskslist = [];
this.skeletonLoader = false
let res = result.filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => {
let task = this.expedienteTaskPipe.transform(element)
this.taskslist.push(task);
});
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
this.addProcessTODb(this.taskslist);
this.taskslist = this.taskslist.filter(function(item) {
return item.activityInstanceName != 'Retificar Expediente'
})
this.expedientegbstore.reset(this.taskslist);
}, (error) => {
this.getEventsFromLocalDb();
});
}
addProcessTODb(task) {
this.storage.set('gabinete-expediente', task).then(() => {
})
}
getEventsFromLocalDb() {
this.storage.get('gabinete-expediente').then((expediente) => {
this.taskslist = expediente
})
}
doRefresh() {
setTimeout(() => {
this.LoadList();
}, 1000)
}
goToExpediente(serialNumber: any) {
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
}
}