|
|
@@ -16,6 +16,7 @@ import { formatDate } from '@angular/common';
|
|
|
|
|
|
import {AngularMyDatePickerDirective,IAngularMyDpOptions, IMyDateModel} from 'angular-mydatepicker';
|
|
|
import printJS from 'print-js'
|
|
|
+import { ExportType,ExcelOptions, Options } from 'mat-table-exporter';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-assets',
|
|
|
@@ -24,7 +25,12 @@ import printJS from 'print-js'
|
|
|
})
|
|
|
|
|
|
export class AssetsComponent implements OnInit {
|
|
|
-
|
|
|
+ exportExcel = ExportType.XLSX;
|
|
|
+ exportCSV = ExportType.CSV;
|
|
|
+ exportJSON = ExportType.JSON;
|
|
|
+ ExcelOptions:ExcelOptions = {fileName:'data-Medidores', sheet: 'Hoja 1', Props: {Author: 'INVERLEC'}}
|
|
|
+ CSVOptions:Options = {fileName:'data-Medidores'}
|
|
|
+ JSONOptions:Options = {fileName:'data-Medidores'}
|
|
|
title = "Plantas";
|
|
|
|
|
|
// General var declarations
|
|
|
@@ -155,7 +161,6 @@ export class AssetsComponent implements OnInit {
|
|
|
|
|
|
this.logsService.getAssetEnviromentalStats(this.organizationId).subscribe(resp => {
|
|
|
this.environment = resp["data"]["environmentals"];
|
|
|
- console.log(this.environment);
|
|
|
this.environmentCO2 = this.environment.avoided_kg_of_co2.toFixed(2);
|
|
|
this.environmentHouse = this.environment.number_of_homes.toFixed(0);
|
|
|
this.environmentFuel = this.environment.number_of_crude_barrels.toFixed(2);
|
|
|
@@ -217,7 +222,7 @@ export class AssetsComponent implements OnInit {
|
|
|
this.onMeasureClickRange(this.view, endDate);
|
|
|
break;
|
|
|
default:
|
|
|
- console.log("nada");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -305,7 +310,7 @@ export class AssetsComponent implements OnInit {
|
|
|
let label = this.metersValues[prop]["label"];
|
|
|
let measure_values = Object.values(this.metersValues[prop]["data"].map(obj => obj.total_energy_kWh).reverse())
|
|
|
this.metersData.push({"label": label, backgroundColor: this.barChartColors[prop], data: measure_values, borderColor: this.borderChartColors[prop] });
|
|
|
- this.tableData.push({headers: label+" kWh Generado", dataValues: measure_values})
|
|
|
+ this.tableData.push({headers: label+" [kWh]", dataValues: measure_values})
|
|
|
}
|
|
|
|
|
|
// Initialization of arrays for the table view of the measure values
|