-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat_api(fe):Added the page of average consumption
- Loading branch information
1 parent
d17cd4b
commit 5b2a3e7
Showing
6 changed files
with
155 additions
and
83 deletions.
There are no files selected for viewing
68 changes: 26 additions & 42 deletions
68
frontend/src/app/modules/office/components/equipment/equipment.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,29 @@ | ||
.grid-container { | ||
display: grid; /* Define un contenedor de grid */ | ||
grid-template-columns: 250px 250px auto; /* Dos columnas de igual tamaño y una tercera columna para el botón */ | ||
grid-template-rows: auto; /* Filas automáticas */ | ||
grid-template-areas: | ||
"select1 select2 button" | ||
"table table table"; /* Área para la tabla ocupa las tres columnas */ | ||
gap: 10px; /* Espacio entre los elementos del grid */ | ||
} | ||
|
||
/* Estilo específico para el primer selector */ | ||
.selector1 { | ||
grid-area: select1; /* Asigna el área de grid para el primer selector */ | ||
justify-self: start; /* Alinea a la izquierda dentro de su celda */ | ||
margin-left: 10px; | ||
} | ||
|
||
/* Estilo específico para el segundo selector */ | ||
.selector2 { | ||
grid-area: select2; /* Asigna el área de grid para el segundo selector */ | ||
justify-self: start; /* Alinea a la izquierda dentro de su celda */ | ||
} | ||
|
||
/* Estilo específico para el contenedor de la tabla */ | ||
.table-container { | ||
grid-area: table; /* Asigna el área de grid para la tabla */ | ||
} | ||
|
||
/* Estilo específico para el botón */ | ||
.export-button { | ||
grid-area: button; | ||
justify-self: end; | ||
margin-top: 8px; | ||
} | ||
.custom-button { | ||
background-color: #00203b; /* Cambia este valor por el color deseado */ | ||
color: white; /* Cambia el color del texto si es necesario */ | ||
border-color:#00203b ; | ||
transition: transform 0.3s ease-in-out; /* Añade una transición suave para la transformación */ | ||
} | ||
|
||
.custom-button:hover { | ||
.form-container { | ||
display: flex; | ||
flex-wrap: wrap; /* Permite que los elementos se ajusten en varias líneas si es necesario */ | ||
justify-content: space-between; /* Separación uniforme */ | ||
} | ||
|
||
.form-autocomplete { | ||
display: flex; | ||
flex: 1; /* Todos los elementos ocupan el mismo espacio por defecto */ | ||
justify-items: left; | ||
flex-direction: row; | ||
gap:30px; | ||
} | ||
|
||
.form-buttons { | ||
width: 18%; | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: space-between; | ||
position:relative; | ||
top: 3px; | ||
left: 0; | ||
margin-top: 5px; | ||
} | ||
|
||
.buttons-container:hover { | ||
transform: scale(1.05); /* Aumenta el tamaño del botón al 105% */ | ||
} | ||
|
48 changes: 29 additions & 19 deletions
48
frontend/src/app/modules/office/components/equipment/equipment.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,41 @@ | ||
<div class="grid-container" [formGroup]="form"> | ||
<!-- Selector de Centro de Trabajo --> | ||
<app-autocomplete | ||
[label]="'Centro de Trabajo'" | ||
[options]="centerOptions" | ||
(optionSelected)="onCenterChange($event)" | ||
> | ||
</app-autocomplete> | ||
<!-- Selector de Oficina --> | ||
<app-autocomplete | ||
[label]="'Oficinas'" | ||
[options]="officeOptions" | ||
(optionSelected)="handleOptionSelected($event)" | ||
> | ||
</app-autocomplete> | ||
<div class="form-container" [formGroup]="form"> | ||
<!-- Contenedor de Autocompletes --> | ||
<div class="form-autocomplete"> | ||
<div class="form-autocomplete-item"> | ||
<app-autocomplete | ||
[label]="'Centro de Trabajo'" | ||
[options]="centerOptions" | ||
(optionSelected)="onCenterChange($event)"> | ||
</app-autocomplete> | ||
</div> | ||
<div class="form-autocomplete-item"> | ||
<app-autocomplete | ||
[label]="'Oficinas'" | ||
[options]="officeOptions" | ||
(optionSelected)="handleOptionSelected($event)"> | ||
</app-autocomplete> | ||
</div> | ||
</div> | ||
|
||
<div class="grid-item export-button"> | ||
<!-- Botones --> | ||
<div class="form-buttons"> | ||
<app-button | ||
[label]="'Consultar'" | ||
[function]="onConsultar.bind(this)"> | ||
</app-button> | ||
<app-button></app-button> | ||
</div> | ||
|
||
<!-- Contenedor de la Tabla --> | ||
<div class="grid-item table-container" *ngIf="showTable"> | ||
<div class="form-table" *ngIf="showTable"> | ||
<app-table | ||
[dataSource]="dataSource" | ||
[displayedColumns]="displayedColumns" | ||
[showActions]="true" | ||
></app-table> | ||
[showActions]="true"> | ||
</app-table> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.form-avg-consumption { | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
|
||
} | ||
.checkbox-container { | ||
flex: 1; /* Ocupa espacio proporcional al ancho disponible */ | ||
} | ||
.buttons-container { | ||
width: 30%; | ||
display: flex; | ||
flex-wrap: wrap; | ||
position:relative; | ||
justify-content: right; | ||
top: 3px; | ||
left: 0; | ||
margin-top: 5px; | ||
gap: 8px; | ||
} | ||
|
39 changes: 34 additions & 5 deletions
39
...tend/src/app/modules/workCenter/components/avg-consumption/avg-consumption.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,34 @@ | ||
<app-checkbox | ||
[label]="'Centros de Trabajo'" | ||
[options]="options" | ||
(selectedOptions)="handleSelectionChange($event)" | ||
></app-checkbox> | ||
<div class="form-avg-consumption"> | ||
<div class="checkbox-container"> | ||
<app-checkbox | ||
[label]="'Centros de Trabajo'" | ||
[options]="options" | ||
(selectedOptions)="handleSelectionChange($event)"> | ||
</app-checkbox> | ||
</div> | ||
|
||
<div class="buttons-container"> | ||
<app-button | ||
[label]="'Consultar'" | ||
[function]="onConsultar.bind(this)"> | ||
</app-button> | ||
<app-button | ||
[label]="'Proyección'" | ||
[function]="onProyeccion.bind(this)"> | ||
</app-button> | ||
<app-button></app-button> | ||
</div> | ||
</div> | ||
|
||
<div *ngIf="isTableActive"> | ||
<div *ngFor="let option of selectedOptions" class="table"> | ||
<h3>{{ option }}</h3> | ||
<app-table | ||
[dataSource]="dataSources[option]" | ||
[displayedColumns]="displayedColumns" | ||
[footer]="footerTable"> | ||
</app-table> | ||
</div> | ||
</div> | ||
|
||
|
36 changes: 35 additions & 1 deletion
36
frontend/src/app/modules/workCenter/components/avg-consumption/avg-consumption.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,50 @@ | ||
import { Component } from '@angular/core'; | ||
import { DateFilterFn } from '@angular/material/datepicker'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ConfigColumn } from '../../../../shared/components/table/table.component'; | ||
import { WorkCenterService } from '../../../../services/workCenter/work-center.service'; | ||
import { MatTableDataSource } from '@angular/material/table'; | ||
import { WorkCenter } from '../../../../models/workCenter.interface'; | ||
import { Register } from '../../../../models/register.interface'; | ||
|
||
@Component({ | ||
selector: 'app-avg-consumption', | ||
templateUrl: './avg-consumption.component.html', | ||
styleUrl: './avg-consumption.component.css', | ||
}) | ||
export class AvgConsumptionComponent { | ||
constructor ( | ||
private httpService: WorkCenterService | ||
) {} | ||
options: string[] = ['Extra cheese', 'Mushroom', 'Onion', 'Pepperoni', 'Sausage', 'Tomato']; | ||
selectedOptions: string[] = []; | ||
isTableActive: boolean = false; | ||
dataSources: { [key: string]: MatTableDataSource<any> } = {}; | ||
displayedColumns: ConfigColumn[] = [ | ||
{ | ||
title: 'Mes', | ||
field: 'month' | ||
}, | ||
{ | ||
title: 'Consumo Promedio (Kw/h)', | ||
field: 'average' | ||
}, | ||
{ | ||
title: 'Costo ($)', | ||
field: 'cost' | ||
} | ||
]; | ||
footerTable: any[] = []; | ||
|
||
onConsultar() { | ||
this.isTableActive = !this.isTableActive; | ||
} | ||
onProyeccion(){ | ||
alert("No esta implementado perro") | ||
} | ||
|
||
handleSelectionChange(selected: string[]) { | ||
this.selectedOptions = selected; | ||
console.log('Opciones seleccionadas en el componente padre:', this.selectedOptions); | ||
this.isTableActive=false; | ||
} | ||
} |