From 98159a1584624e89b3f5a9f15a6c6e9bfdaad483 Mon Sep 17 00:00:00 2001
From: Fuzi_fauzia
Date: Mon, 26 Aug 2024 14:13:37 +0700
Subject: [PATCH] penambahan label detail
---
src/app/_layout/footer/footer.component.html | 2 +-
.../device-control.component.ts | 2 -
.../monitoring/detail/detail.component.ts | 57 ++++++++++++++-----
.../service/monitoring-api.service.ts | 8 +++
src/app/login/login.component.html | 2 +-
5 files changed, 53 insertions(+), 18 deletions(-)
diff --git a/src/app/_layout/footer/footer.component.html b/src/app/_layout/footer/footer.component.html
index 9f4d5a4..599393c 100644
--- a/src/app/_layout/footer/footer.component.html
+++ b/src/app/_layout/footer/footer.component.html
@@ -13,7 +13,7 @@
href="https://allbestsistem.com/"
target="_blank"
style="background-color: #ffffff !important;"
- >Smart Building Management Systems (V@2024-08-26.2)
+ >Smart Building Management Systems (V@2024-08-26.3)
diff --git a/src/app/content/hemat-app/device/device-control/device-control.component.ts b/src/app/content/hemat-app/device/device-control/device-control.component.ts
index 42e81f7..4d3068c 100644
--- a/src/app/content/hemat-app/device/device-control/device-control.component.ts
+++ b/src/app/content/hemat-app/device/device-control/device-control.component.ts
@@ -175,8 +175,6 @@ export class DeviceControlComponent {
}
schedulerItem(row) {
- console.log(row);
-
this.router.navigate(["/device/scheduler", row.id, row.name]);
}
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 b99f1a7..7ff5218 100644
--- a/src/app/content/hemat-app/monitoring/detail/detail.component.ts
+++ b/src/app/content/hemat-app/monitoring/detail/detail.component.ts
@@ -5,6 +5,8 @@ import { CurrencyPipe } from "@angular/common";
import { LoginService } from "../../service/login.service";
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
import { ModalExportComponent } from "../modal-export/modal-export.component";
+import { CostManagementService } from "../../service/cost-management.service";
+import { BuildingService } from "../../service/monitoring-api.service";
@Component({
selector: "app-detail",
@@ -16,8 +18,6 @@ export class DetailComponent {
data: any;
mode: string;
breadcrumb: any;
- donutChart1: any;
- donutChart2: any;
// temperature
days = [
@@ -36,7 +36,6 @@ export class DetailComponent {
currentTime: string;
chartOption: any;
chartOptionBar: any;
- chartInstance: any;
// chart bar
public barChartLabels: string[] = [];
@@ -45,8 +44,6 @@ export class DetailComponent {
//..........................
// integrasi
- electric: any;
- water: any;
device: any;
room: any;
topCard: any;
@@ -57,6 +54,9 @@ export class DetailComponent {
buildingId: any;
floorId: any;
roomId: any;
+ buildingName: any;
+ floorName: any;
+ roomName: any;
//......
constructor(
@@ -65,7 +65,9 @@ export class DetailComponent {
private currencyPipe: CurrencyPipe,
private router: Router,
private authService: LoginService,
- private modalService: NgbModal
+ private modalService: NgbModal,
+ private costService: CostManagementService,
+ private buildingService: BuildingService
) {}
get formattedSummaryCost(): string {
@@ -83,12 +85,11 @@ export class DetailComponent {
this.route.data.subscribe((data) => {
this.mode = data.mode;
});
- this.breadcrumbLink();
this.route.params.subscribe((params) => {
this.buildingId = params["buildingId"] ? params["buildingId"] : 0;
this.floorId = params["floorId"] ? params["floorId"] : 0;
this.roomId = params["roomId"] ? params["roomId"] : 0;
-
+ this.dataBuilding(this.buildingId);
if (
this.buildingId !== undefined &&
this.floorId === undefined &&
@@ -107,6 +108,7 @@ export class DetailComponent {
this.dataEnergyMonitoringSummary(this.buildingId, this.floorId, 0);
this.dataEnergyDeviceCategory(this.buildingId, this.floorId, 0);
this.dataEnergyChartKwhWater(this.buildingId, this.floorId, 0);
+
} else if (
this.buildingId !== undefined &&
this.floorId !== undefined &&
@@ -147,7 +149,7 @@ export class DetailComponent {
isLinkBack: true,
links: [
{
- name: "Building",
+ name: this.buildingName,
isLink: false,
link: "",
},
@@ -160,12 +162,12 @@ export class DetailComponent {
isLinkBack: true,
links: [
{
- name: "Building",
+ name: this.buildingName,
isLink: false,
link: "",
},
{
- name: "Floor",
+ name: this.floorName,
isLink: false,
link: "",
},
@@ -178,17 +180,17 @@ export class DetailComponent {
isLinkBack: true,
links: [
{
- name: "Building",
+ name: this.buildingName,
isLink: false,
link: "",
},
{
- name: "Floor",
+ name: this.floorName,
isLink: false,
link: "",
},
{
- name: "Room",
+ name: this.roomName,
isLink: false,
link: "",
},
@@ -316,6 +318,33 @@ export class DetailComponent {
});
}
+ dataBuilding(buildingId) {
+ this.costService.getBUildingById(buildingId).subscribe((res) => {
+ this.buildingName = res.data.name
+ this.breadcrumbLink();
+ if (this.floorId) {
+ this.dataFloor(this.floorId)
+ }
+ if (this.roomId) {
+ this.dataRoom(this.roomId)
+ }
+ });
+ }
+
+ dataFloor(floorId) {
+ this.buildingService.getHeaderDetailParam(floorId).subscribe((res) => {
+ this.floorName = res.data.name;
+ this.breadcrumbLink();
+ });
+ }
+
+ dataRoom(roomId) {
+ this.buildingService.getRoom(roomId).subscribe((res) => {
+ this.roomName = res.data.name;
+ this.breadcrumbLink();
+ });
+ }
+
dataEnergyMonitoringSummary(buildingId, floorId, roomId) {
this.energyMonitoringService
.getDashboardSummary(buildingId, floorId, roomId)
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 0223cc6..48c4c6f 100644
--- a/src/app/content/hemat-app/service/monitoring-api.service.ts
+++ b/src/app/content/hemat-app/service/monitoring-api.service.ts
@@ -81,6 +81,10 @@ export class BuildingService {
return this.get('room/list');
}
+ getRoom(id: any): Observable {
+ return this.get(`room/${id}`);
+ }
+
getListRoomDataUnmap(): Observable {
return this.get('room/list/unmap');
}
@@ -105,6 +109,10 @@ export class BuildingService {
return this.put(`header-detail-param/${id}`, data);
}
+ getHeaderDetailParam(id: any): Observable {
+ return this.get(`header-detail-param/${id}`);
+ }
+
deleteHeaderDetailParam(id: string): Observable {
return this.delete(`header-detail-param/${id}`);
}
diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html
index 90aef66..bc791ab 100644
--- a/src/app/login/login.component.html
+++ b/src/app/login/login.component.html
@@ -138,7 +138,7 @@
- (v@2024.08.26.2)
+ (v@2024.08.26.3)