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