diff --git a/src/app/content/hemat-app/master/master-floor/master-floor.component.ts b/src/app/content/hemat-app/master/master-floor/master-floor.component.ts index a83cf46..2b53cc5 100644 --- a/src/app/content/hemat-app/master/master-floor/master-floor.component.ts +++ b/src/app/content/hemat-app/master/master-floor/master-floor.component.ts @@ -151,8 +151,6 @@ export class MasterFloorComponent { .putHeaderDetailParam(result, row.id) .subscribe((res) => { this.fetchData(); - console.log(res); - if (res.status === 400) { this.toastr.error( "Warning", diff --git a/src/app/content/hemat-app/monitoring/building/building.component.html b/src/app/content/hemat-app/monitoring/building/building.component.html index d8d00b8..2b97b6d 100644 --- a/src/app/content/hemat-app/monitoring/building/building.component.html +++ b/src/app/content/hemat-app/monitoring/building/building.component.html @@ -1,4 +1,4 @@ -
+
@@ -6,16 +6,75 @@
-
- +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
-

Building

+

{{labelData}}

{{ data.build_name ? data.build_name : data.name }}

@@ -58,25 +117,21 @@ transform: translate(-50%, -50%); " > -

- {{ data.total }} KWH -

+

{{ data.total }} KWH

Consumption
- + -->
+
diff --git a/src/app/content/hemat-app/monitoring/detail/detail.component.ts b/src/app/content/hemat-app/monitoring/detail/detail.component.ts index 7c4386b..9ef5c26 100644 --- a/src/app/content/hemat-app/monitoring/detail/detail.component.ts +++ b/src/app/content/hemat-app/monitoring/detail/detail.component.ts @@ -37,6 +37,7 @@ export class DetailComponent { currentTime: string; chartOption: any; chartOptionBar: any; + chartInstance: any; // chart bar public barChartLabels: string[] = []; @@ -333,9 +334,19 @@ export class DetailComponent { }, ], }; + onClick: (params) => { + this.onChartClick(params); + } }); } + onChartClick(params) { + console.log(params); + + // Show popup with details + // alert(`Day: ${params.name}\nKWH Consumption: ${params.value}`); + } + seeMore(paramsId) { this.router.navigate(["/monitoring/control-device-see-more/", paramsId]); } diff --git a/src/app/content/hemat-app/service/device.service.ts b/src/app/content/hemat-app/service/device.service.ts index 7dd42d7..fc44ae3 100644 --- a/src/app/content/hemat-app/service/device.service.ts +++ b/src/app/content/hemat-app/service/device.service.ts @@ -98,4 +98,21 @@ export class DeviceService { }); return this.http.get(url, { headers }); } + + filterDashboard(building, floor): Observable { + const endpoint = `/building/dashboard/list`; + const params = new URLSearchParams({ + building_id: building ? building : 0, + floor_id: floor ? floor :0, + }); + // if (category) { + // params.append("category_id", category); + // } + const url = `${BASE_URL}${endpoint}?${params.toString()}`; + const headers = new HttpHeaders({ + "Content-Type": "application/json", + "x-api-key": "j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT", + }); + return this.http.get(url, { headers }); + } } diff --git a/src/app/content/hemat-app/service/monitoring-api.service.ts b/src/app/content/hemat-app/service/monitoring-api.service.ts index ad3c85b..b7e386e 100644 --- a/src/app/content/hemat-app/service/monitoring-api.service.ts +++ b/src/app/content/hemat-app/service/monitoring-api.service.ts @@ -277,4 +277,6 @@ export class BuildingService { // device.mapping.some((map: any) => console.log(map)) ); } + + }