소스 검색

Ajuste para hacer el build en produccion

Oscar José Nuñez Chávez 5 년 전
부모
커밋
c61d626157

+ 0 - 1
src/app/components/assets/assets.component.html

@@ -313,7 +313,6 @@
                 [datasets]="barChartData"
                 [labels]="barChartLabels"
                 [options]="barChartOptions"
-                [plugins]="barChartPlugins"
                 [chartType]="barChartType"
               ></canvas>
             </div>

+ 3 - 1
src/app/components/dashboard/dashboard.component.ts

@@ -1,6 +1,8 @@
 import { ActivatedRoute, Router } from "@angular/router";
 import { Component, OnInit, NgZone, ViewChild } from "@angular/core";
 import { Plant } from "src/app/models/plant";
+import { Rate } from "src/app/models/rate";
+
 import { PlantsService } from "src/app/services/plants.service";
 import { OrganizationsService } from "src/app/services/organizations.service";
 import {
@@ -88,7 +90,7 @@ export class DashboardComponent implements OnInit {
   userLevel: number;
   totalAssetsInstalled: any;
 
-  rates: Object = {
+  rates: Rate = {
     distribuidora: "-",
     codigo_tarifa: "-",
     tarifa_actual: {

+ 1 - 1
src/app/components/profile/profile.component.ts

@@ -91,7 +91,7 @@ export class ProfileComponent implements OnInit {
     return this.userForm.controls;
   }
 
-  editUser(form: any) {
+  editUser() {
     this.submitted = true;
     // stop here if form is invalid
     if (this.userForm.invalid) {

+ 7 - 6
src/app/components/rates/rates.component.html

@@ -17,15 +17,17 @@
               <div class="col-sm-12 col-md-6">
                 <h3 class="mb-3">
                   Distribuidora:
-                  <strong *ngIf="rates.distribuidora">
+                  <strong *ngIf="rates['distribuidora']">
                     {{ rates.distribuidora }}
                   </strong>
                 </h3>
                 <h4>Tarifa actual (USD$/kWh):</h4>
-                <div *ngIf="rates.tarifa_actual.cargo_energia">
+                <div *ngIf="rates['tarifa_actual']['cargo_energia']">
                   Cargo de energia:
                   <strong>
-                    {{ rates.tarifa_actual.cargo_energia | number: "1.2-4" }}
+                    {{
+                      rates["tarifa_actual"]["cargo_energia"] | number: "1.2-4"
+                    }}
                     USD$/kWh
                   </strong>
                 </div>
@@ -194,7 +196,6 @@
                 [datasets]="barChartData"
                 [labels]="barChartLabels"
                 [options]="barChartOptions"
-                [plugins]="barChartPlugins"
                 [chartType]="barChartType"
               ></canvas>
             </div>
@@ -231,7 +232,7 @@
             <label for="sel3">Distribuidora</label>
             <select
               class="custom-select"
-              (change)="onChangeObj($event)"
+              (change)="onChangeD($event)"
               name="sel3"
             >
               <option
@@ -252,7 +253,7 @@
             <label for="sel3">Tipo de tarifa</label>
             <select
               class="custom-select"
-              (change)="onChangeObj($event)"
+              (change)="onChangeT($event)"
               name="sel3"
             >
               <option

+ 10 - 2
src/app/components/rates/rates.component.ts

@@ -15,6 +15,7 @@ import * as moment from "moment";
 import Swal from "sweetalert2";
 import { RatesService } from "@app/services/rates.service";
 import { CatalogsService } from "@app/services/catalogs.service";
+import { Rate } from "@app/models/rate";
 
 @Component({
   selector: "app-rates",
@@ -53,7 +54,7 @@ export class RatesComponent implements OnInit {
   userLevel: number;
   totalAssetsInstalled: any;
 
-  rates: Object = {
+  rates: Rate = {
     distribuidora: "-",
     codigo_tarifa: "-",
     tarifa_actual: {
@@ -112,6 +113,8 @@ export class RatesComponent implements OnInit {
   metersValues: unknown[];
   distribuidoras: any;
   tarifas: any;
+  distribuidoraSel: any;
+  tarifaSel: any;
 
   constructor(
     private plantsService: PlantsService,
@@ -324,5 +327,10 @@ export class RatesComponent implements OnInit {
 
   ngOnChanges(): void {}
 
-  onChangeObj() {}
+  onChangeD(event: any) {
+    this.distribuidoraSel = event.target.value;
+  }
+  onChangeT(event: any) {
+    this.tarifaSel = event.target.value;
+  }
 }

+ 5 - 4
src/app/models/index.ts

@@ -1,4 +1,5 @@
-export * from './role';
-export * from './user';
-export * from './plant';
-export * from './measure';
+export * from "./role";
+export * from "./user";
+export * from "./plant";
+export * from "./measure";
+export * from "./rate";

+ 26 - 0
src/app/models/rate.ts

@@ -0,0 +1,26 @@
+import { Observable } from "rxjs";
+
+export interface Rate {
+  distribuidora: string;
+  codigo_tarifa: string;
+  tarifa_actual: {
+    dateMin: string;
+    dateMax: string;
+    cargo_energia: string;
+    cargo_energia_b1: string;
+    cargo_energia_b2: string;
+    cargo_energia_b3: string;
+    cargo_energia_punta: string;
+    cargo_energia_resto: string;
+    cargo_energia_valle: string;
+  };
+  incremento_porcentaje: {
+    cargo_energia: string;
+    cargo_energia_b1: string;
+    cargo_energia_b2: string;
+    cargo_energia_b3: string;
+    cargo_energia_punta: string;
+    cargo_energia_resto: string;
+    cargo_energia_valle: string;
+  };
+}