perbaikan routing dan penambahan button back pada page monitoring
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { BlockUI, NgBlockUI } from "ng-block-ui";
|
||||
import { ChartApiService } from "src/app/_services/chart.api";
|
||||
interface Sales {
|
||||
@@ -17,9 +18,14 @@ export class DetailComponent {
|
||||
data: any;
|
||||
chartOption: any;
|
||||
Sales: any;
|
||||
mode: string;
|
||||
ExpenseschartOption: any;
|
||||
public breadcrumb: any;
|
||||
constructor(private chartApiservice: ChartApiService) {}
|
||||
constructor(
|
||||
private chartApiservice: ChartApiService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute
|
||||
) {}
|
||||
@BlockUI("totalReceivables") blockUITotalReceivables: NgBlockUI;
|
||||
@BlockUI("salesRecieptsDues") blockUISalesRecieptsDues: NgBlockUI;
|
||||
getInvoicechart() {
|
||||
@@ -148,23 +154,47 @@ export class DetailComponent {
|
||||
};
|
||||
}
|
||||
ngOnInit() {
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Detail Monitoring",
|
||||
linkBack: '/monitoring',
|
||||
isLinkBack: true,
|
||||
links: [
|
||||
{
|
||||
name: "Home",
|
||||
isLink: false,
|
||||
link: "",
|
||||
},
|
||||
{
|
||||
name: "Detail Monitoring",
|
||||
isLink: false,
|
||||
link: "",
|
||||
}
|
||||
],
|
||||
};
|
||||
this.route.data.subscribe((data) => {
|
||||
this.mode = data.mode;
|
||||
});
|
||||
if (this.mode === "room") {
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Detail Monitoring",
|
||||
linkBack: "/monitoring/monitoring-room",
|
||||
isLinkBack: true,
|
||||
links: [
|
||||
{
|
||||
name: "Home",
|
||||
isLink: false,
|
||||
link: "",
|
||||
},
|
||||
{
|
||||
name: "Detail Monitoring",
|
||||
isLink: false,
|
||||
link: "",
|
||||
},
|
||||
],
|
||||
};
|
||||
} else {
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Detail Monitoring",
|
||||
linkBack: "/monitoring",
|
||||
isLinkBack: true,
|
||||
links: [
|
||||
{
|
||||
name: "Home",
|
||||
isLink: false,
|
||||
link: "",
|
||||
},
|
||||
{
|
||||
name: "Detail Monitoring",
|
||||
isLink: false,
|
||||
link: "",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
this.chartApiservice.getInvoiceData().subscribe((Response) => {
|
||||
this.data = Response;
|
||||
this.getInvoicechart();
|
||||
|
||||
Reference in New Issue
Block a user