penambahan search code
This commit is contained in:
parent
df1cd2339e
commit
03c7e54bc8
|
@ -23,9 +23,9 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item mr-auto">
|
<li class="nav-item mr-auto">
|
||||||
<a
|
<a
|
||||||
[routerLink]="['/dashboard/sales']"
|
[routerLink]="['/monitoring']"
|
||||||
class="navbar-brand"
|
class="navbar-brand"
|
||||||
routerLink="/dashboard/sales"
|
routerLink="/monitoring"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
class="brand-logo"
|
class="brand-logo"
|
||||||
|
@ -53,6 +53,7 @@
|
||||||
[routerLink]=""
|
[routerLink]=""
|
||||||
class="nav-link modern-nav-toggle pr-0"
|
class="nav-link modern-nav-toggle pr-0"
|
||||||
data-toggle="collapse"
|
data-toggle="collapse"
|
||||||
|
|
||||||
(click)="toggleFixMenu($event)"
|
(click)="toggleFixMenu($event)"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
|
|
|
@ -68,7 +68,8 @@ export class MasterRoomComponent {
|
||||||
rowContainsSearchTerm(row: any, searchTermLC: string): boolean {
|
rowContainsSearchTerm(row: any, searchTermLC: string): boolean {
|
||||||
return (
|
return (
|
||||||
row.name.toLowerCase().includes(searchTermLC) ||
|
row.name.toLowerCase().includes(searchTermLC) ||
|
||||||
row.description.toLowerCase().includes(searchTermLC)
|
row.description.toLowerCase().includes(searchTermLC) ||
|
||||||
|
row.code.toLowerCase().includes(searchTermLC)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,25 +39,7 @@ export class DetailComponent {
|
||||||
chartOptionBar: any;
|
chartOptionBar: any;
|
||||||
|
|
||||||
// chart bar
|
// chart bar
|
||||||
public barChartOptions: ChartOptions = {
|
|
||||||
responsive: true,
|
|
||||||
animation: {
|
|
||||||
duration: 0,
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
x: {
|
|
||||||
stacked: true,
|
|
||||||
},
|
|
||||||
y: {
|
|
||||||
stacked: true,
|
|
||||||
beginAtZero: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
public barChartLabels: string[] = [];
|
public barChartLabels: string[] = [];
|
||||||
public barChartType: ChartType = "bar";
|
|
||||||
public barChartLegend = true;
|
|
||||||
public barChartData: number[] = [];
|
public barChartData: number[] = [];
|
||||||
public barChartData2: number[] = [];
|
public barChartData2: number[] = [];
|
||||||
//..........................
|
//..........................
|
||||||
|
@ -300,6 +282,15 @@ export class DetailComponent {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
legend: {},
|
legend: {},
|
||||||
|
toolbox: {
|
||||||
|
show: true,
|
||||||
|
feature: {
|
||||||
|
dataView: { show: true, readOnly: false },
|
||||||
|
magicType: { show: true, type: ['line', 'bar'] },
|
||||||
|
restore: { show: true },
|
||||||
|
saveAsImage: { show: true }
|
||||||
|
}
|
||||||
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: "3%",
|
left: "3%",
|
||||||
right: "4%",
|
right: "4%",
|
||||||
|
@ -310,6 +301,7 @@ export class DetailComponent {
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
data: this.barChartLabels,
|
data: this.barChartLabels,
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
|
@ -321,7 +313,7 @@ export class DetailComponent {
|
||||||
{
|
{
|
||||||
name: "KWH Consumption",
|
name: "KWH Consumption",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
color: "#ffffff",
|
color: "#242222",
|
||||||
stack: "Ad",
|
stack: "Ad",
|
||||||
emphasis: {
|
emphasis: {
|
||||||
focus: "series",
|
focus: "series",
|
||||||
|
@ -329,7 +321,7 @@ export class DetailComponent {
|
||||||
data: this.barChartData,
|
data: this.barChartData,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Cost Consumption",
|
name: "Summary Cost",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
stack: "Ad",
|
stack: "Ad",
|
||||||
color: "#37a647",
|
color: "#37a647",
|
||||||
|
@ -343,24 +335,6 @@ export class DetailComponent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
aggregateKwhWeekly(data: any[]): number[] {
|
|
||||||
const weeks = [];
|
|
||||||
let weekSum = 0;
|
|
||||||
let dayCount = 0;
|
|
||||||
|
|
||||||
data.forEach((entry, index) => {
|
|
||||||
weekSum += entry.kwh;
|
|
||||||
dayCount++;
|
|
||||||
if (dayCount === 7 || index === data.length - 1) {
|
|
||||||
weeks.push(weekSum);
|
|
||||||
weekSum = 0;
|
|
||||||
dayCount = 0;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return weeks;
|
|
||||||
}
|
|
||||||
|
|
||||||
seeMore(paramsId) {
|
seeMore(paramsId) {
|
||||||
this.router.navigate(["/monitoring/control-device-see-more/", paramsId]);
|
this.router.navigate(["/monitoring/control-device-see-more/", paramsId]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue