This commit is contained in:
tiago.kayaya
2021-08-04 16:40:28 +01:00
parent 697cf803f2
commit a911f8a4e9
7 changed files with 198 additions and 23 deletions
@@ -1,6 +1,28 @@
<ion-header class="ion-no-border">
<app-header></app-header>
</ion-header>
<ion-header *ngIf="!hideRefreshBtn" class="ion-no-border">
<div class="title-container d-flex">
<div class="title">
<ion-label>Gabinete Digital</ion-label>
</div>
<button *ngIf="hideRefreshBtn" class="btn-no-color btn-refresh" (click)="doRefresh($event)">
<ion-icon class="title-icon" name="reload-circle"></ion-icon>
</button>
<div class="title-icons">
<!-- <ion-toolbar> -->
<ion-segment [(ngModel)]="segmentVista" (ionChange)="onSegmentVistaChange()">
<ion-segment-button value="listview">
<fa-icon icon="stream"></fa-icon>
</ion-segment-button>
<ion-segment-button value="boxview">
<fa-icon icon="th-large"></fa-icon>
</ion-segment-button>
</ion-segment>
<!-- </ion-toolbar> -->
</div>
</div>
</ion-header>
<ion-content class="height-100">
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
@@ -8,20 +30,19 @@
</ion-refresher-content>
</ion-refresher>
<div class="main-content d-flex height-100 ">
<div class="main-content d-flex height-100">
<!-- Aside left -->
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1 ">
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<div class="title-container">
<div *ngIf="hideRefreshBtn" class="title-container">
<div class="title">
<ion-label>Gabinete Digital</ion-label>
</div>
<button *ngIf="hideRefreshBtn" class="btn-no-color btn-refresh" (click)="doRefresh($event)">
<ion-icon class="title-icon" name="reload-circle"></ion-icon>
</button>
<div class="title-icons">
<!-- <ion-toolbar> -->
<!-- <div class="title-icons">
<ion-segment [(ngModel)]="segmentVista" (ionChange)="onSegmentVistaChange()">
<ion-segment-button value="listview">
<fa-icon icon="stream"></fa-icon>
@@ -30,10 +51,8 @@
<fa-icon icon="th-large"></fa-icon>
</ion-segment-button>
</ion-segment>
<!-- </ion-toolbar> -->
</div>
</div> -->
</div>
<div [ngSwitch]="segmentVista">
<!-- This is the list view -->
<div *ngSwitchCase="'listview'">
@@ -58,9 +77,19 @@
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div class="item-middle-detail-extra">
<div *ngIf="task.Agenda" class="item-middle-detail">
<div class="item-remetente">
<ion-label>{{task.customDate}}</ion-label>
</div>
</div>
<div *ngIf="task.Agenda" class="item-middle-detail-extra">
<div class="item-middle-detail-extra-text">
<ion-label>Data</ion-label>
<ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial PR' || task.WorkflowName == 'Agenda Pessoal PR'">
Agenda {{task.Agenda}} do Presidente da República
</ion-label>
<ion-label *ngIf=" task.WorkflowName == 'Agenda Oficial MDGPR' || task.WorkflowName == 'Agenda Pessoal MDGPR'">
A sua agenda {{task.Agenda}}
</ion-label>
</div>
</div>
<div class="item-bottom-detail d-flex align-items-center">
@@ -4,7 +4,7 @@ ion-content{
--padding-start:15px; */
/* --padding-bottom:15px; */
/* --background:#ecf8ff; */
--background: transparent;
--background: #ecf8ff;
}
ion-segment{
overflow: auto;
@@ -27,8 +27,12 @@ ion-segment-button{
text-align: center;
}
.title-container{
background:#ecf8ff;
padding: 30px 20px 15px 20px !important;
//margin-bottom: 15px;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
.title{
width: fit-content;
font-size: 25px !important;
@@ -118,11 +122,7 @@ ion-segment-button{
overflow:auto;
padding: 0 !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
.aside-wrapper{
//border: 1px solid red;
overflow: auto;
.listview{
width: 100%t;
@@ -269,6 +269,11 @@ ion-list{
.item-subject{
width: 84%;
float: left;
ion-label{
margin: 0 !important;
padding: 2.5px 10.5px 2.5px 10.5px;
}
}
.item-icon{
@@ -386,11 +391,17 @@ ion-list{
@media only screen and (min-width: 701px) {
ion-content{
--background: transparent;
}
.title{
font-size: 15px !important;
}
.main-content{
border-top-left-radius: 25px;
border-top-right-radius: 25px;
.aside-wrapper{
display: flex;
width: 35%;
@@ -108,7 +108,7 @@ export class GabineteDigitalPage implements OnInit {
authService: AuthService,
public p: PermissionService
) {
this.segmentVista = "listview";
this.loggeduser = authService.ValidatedUser;
window.onresize = (event) => {
// if not mobile remove all component
@@ -130,6 +130,13 @@ export class GabineteDigitalPage implements OnInit {
ngOnInit() {
if( window.innerWidth < 701) {
this.segmentVista = "listview";
}
else{
this.segmentVista = "boxview";
}
const pathname = window.location.pathname
this.LoadCounts();
@@ -173,10 +180,12 @@ export class GabineteDigitalPage implements OnInit {
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
"Agenda": element.workflowInstanceDataFields.Agenda,
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
}
this.allProcessesList.push(task);
this.allProcessesList = removeDuplicate( this.allProcessesList)
this.allProcessesList = this.sortArrayISODate(this.allProcessesList);
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
});
//this.pendentesstore.reset(this.allProcessesList);
this.skeletonLoader = false;
@@ -189,7 +198,58 @@ export class GabineteDigitalPage implements OnInit {
});
}
viewProcessDetails(){}
setFormatDate(start:any, end:any, allday:boolean){
let customDate;
/* start = new Date();
end= new Date("2021-08-04T18:01:04.753Z"); */
//end = new Date("2021-09-04T18:01:04.753Z");
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 );
let diffDays = totalDays;
let diffMinutes = minutes;
console.log(allday);
if(totalDays == 0){
if(allday){
customDate = this.getCustomDate(start)+", "+this.getCustomHours(start)+" (todo dia)";
console.log(customDate);
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();
}
viewProcessDetails(){
}
onSegmentVistaChange(){