penambahan route floor dan room
This commit is contained in:
parent
cd777f11ad
commit
b5cf71d008
|
@ -115,9 +115,17 @@ export class BuildingComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
viewDetail(row) {
|
viewDetail(row) {
|
||||||
console.log(row);
|
if (row.building_id !== undefined && row.floor_id === undefined) {
|
||||||
|
this.router.navigate(["/monitoring/view-detail-floor", row.id]);
|
||||||
|
} else if (row.building_id !== undefined && row.floor_id !== undefined) {
|
||||||
|
this.router.navigate(["/monitoring/view-detail-room", row.id]);
|
||||||
|
} else {
|
||||||
|
this.router.navigate(["/monitoring/view-detail-building", row.id]);
|
||||||
|
}
|
||||||
|
console.log(row.floor_id);
|
||||||
|
console.log(row.building_id);
|
||||||
|
|
||||||
this.router.navigate(["/monitoring/view-detail", row.id]);
|
// this.router.navigate(["/monitoring/view-detail", row.id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
editRow(row) {
|
editRow(row) {
|
||||||
|
|
|
@ -85,10 +85,10 @@ export class DetailComponent {
|
||||||
});
|
});
|
||||||
this.breadcrumbLink();
|
this.breadcrumbLink();
|
||||||
this.route.params.subscribe((params) => {
|
this.route.params.subscribe((params) => {
|
||||||
const buildingId = params["buildingId"];
|
const buildingId = params["id"];
|
||||||
console.log(buildingId);
|
console.log(buildingId);
|
||||||
|
|
||||||
this.paramsId = params["buildingId"];
|
this.paramsId = params["id"];
|
||||||
if (buildingId) {
|
if (buildingId) {
|
||||||
this.dataEnergyMonitoringTopCard(buildingId);
|
this.dataEnergyMonitoringTopCard(buildingId);
|
||||||
this.dataEnergyMonitoringSummary(buildingId);
|
this.dataEnergyMonitoringSummary(buildingId);
|
||||||
|
|
|
@ -90,10 +90,21 @@ import { ClipboardModule } from 'ngx-clipboard';
|
||||||
data: { mode: 'room' }
|
data: { mode: 'room' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'view-detail/:buildingId',
|
path: 'view-detail-building/:id',
|
||||||
component: DetailComponent,
|
component: DetailComponent,
|
||||||
data: { mode: 'building' }
|
data: { mode: 'building' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'view-detail-floor/:id',
|
||||||
|
component: DetailComponent,
|
||||||
|
data: { mode: 'floor' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'view-detail-room/:id',
|
||||||
|
component: DetailComponent,
|
||||||
|
data: { mode: 'room' }
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: 'view-new-room/:id',
|
path: 'view-new-room/:id',
|
||||||
component: DetailComponent,
|
component: DetailComponent,
|
||||||
|
|
Loading…
Reference in New Issue