perbaikan master

This commit is contained in:
Fuzi_fauzia 2024-07-26 09:41:23 +07:00
parent a9f3da867f
commit db9a9e415a
4 changed files with 131 additions and 118 deletions

View File

@ -92,9 +92,9 @@ export class CostManagementComponent implements OnInit {
.subscribe((response) => { .subscribe((response) => {
this.data = response.results.data; this.data = response.results.data;
this.filteredRows = this.data; this.filteredRows = this.data;
let kwhData = parseFloat(response.results.kwh) let kwhData = parseFloat(response.results.kwh);
this.kwhTerm = kwhData.toFixed(1); this.kwhTerm = kwhData.toFixed(1);
this.costTerm = response.results.cost; this.costTerm = response.results.cost;
this.data_cost = this.filteredRows.map((item) => ({ this.data_cost = this.filteredRows.map((item) => ({
@ -135,8 +135,9 @@ export class CostManagementComponent implements OnInit {
dataListBuilding() { dataListBuilding() {
this.monitoringApiService.getBuildingList().subscribe((data) => { this.monitoringApiService.getBuildingList().subscribe((data) => {
this.dataBuildingList = data.data.filter((item) => item.statusName.toLowerCase() === "aktif"); this.dataBuildingList = data.data.filter(
(item) => item.statusName.toLowerCase() === "aktif"
);
}); });
} }
@ -144,79 +145,80 @@ export class CostManagementComponent implements OnInit {
this.costService.getCompPrevMonthCost(buildingId).subscribe((data) => { this.costService.getCompPrevMonthCost(buildingId).subscribe((data) => {
this.dataCompPrev = data.data; this.dataCompPrev = data.data;
this.chartOption = { this.chartOption = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
formatter: function (params) {
var tar = params[1];
return tar.name + "<br/>" + tar.seriesName + " : " + tar.value;
},
},
grid: { grid: {
left: "25%", left: "25%",
right: "25%", right: "25%",
top: "20%", top: "20%",
bottom: "20%", bottom: "20%",
}, },
color: ["#37A647"],
// Add tooltip xAxis: {
tooltip: { type: "category",
trigger: "axis", splitLine: { show: false },
enterable: false, data: [this.dataCompPrev[0].name, this.dataCompPrev[1].name],
formatter: function (params) { axisLine: {
return `${params[0].name}<br/>${ show: true,
params[0].seriesName lineStyle: {
}: Rp. ${params[0].value.toLocaleString()}`; color: "#37A647",
width: 7,
},
},
axisTick: {
show: false,
},
axisLabel: {
show: false,
}, },
}, },
// Add legend yAxis: {
legend: false, type: "value",
axisLine: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
},
// Add custom colors series: [
color: ["#37A647"],
// Horizontal axis
xAxis: [
{ {
type: "category", name: "Placeholder",
data: [this.dataCompPrev[0].name, this.dataCompPrev[1].name], type: "bar",
axisLine: { stack: "Total",
show: true, itemStyle: {
lineStyle: { borderColor: "transparent",
color: "#37A647", color: "transparent",
width: 4, },
emphasis: {
itemStyle: {
borderColor: "transparent",
color: "transparent",
}, },
}, },
axisTick: { data: [1000, 1000],
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
}, },
],
// Vertical axis
yAxis: [
{
type: "value",
axisLine: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
},
],
// Add series
series: [
{ {
name: "Cost", name: "Cost",
type: "bar", type: "bar",
data: [this.dataCompPrev[0].rupiah, this.dataCompPrev[1].rupiah], stack: "Total",
label: { label: {
show: true, show: true,
position: "top", position: "top",
@ -225,7 +227,8 @@ export class CostManagementComponent implements OnInit {
return `Rp. ${params.value.toLocaleString()}`; return `Rp. ${params.value.toLocaleString()}`;
}, },
}, },
barWidth: "50%", // barWidth: "50%",
data: [this.dataCompPrev[0].rupiah, this.dataCompPrev[1].rupiah],
}, },
], ],
}; };
@ -236,79 +239,80 @@ export class CostManagementComponent implements OnInit {
this.costService.getCompActEstCost(buildingId).subscribe((data) => { this.costService.getCompActEstCost(buildingId).subscribe((data) => {
this.dataCompAct = data.data[0]; this.dataCompAct = data.data[0];
this.chartOption2 = { this.chartOption2 = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
formatter: function (params) {
var tar = params[1];
return tar.name + "<br/>" + tar.seriesName + " : " + tar.value;
},
},
grid: { grid: {
left: "25%", left: "25%",
right: "25%", right: "25%",
top: "20%", top: "20%",
bottom: "20%", bottom: "20%",
}, },
color: ["#37A647"],
// Add tooltip xAxis: {
tooltip: { type: "category",
trigger: "axis", splitLine: { show: false },
enterable: false, data: ["Estimation Cost", "Actual Cost"],
formatter: function (params) { axisLine: {
return `${params[0].name}<br/>${ show: true,
params[0].seriesName lineStyle: {
}: Rp. ${params[0].value.toLocaleString()}`; color: "#37A647",
width: 7,
},
},
axisTick: {
show: false,
},
axisLabel: {
show: false,
}, },
}, },
// Add legend yAxis: {
legend: false, type: "value",
axisLine: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
},
// Add custom colors series: [
color: ["#37A647"],
// Horizontal axis
xAxis: [
{ {
type: "category", name: "Placeholder",
data: ["Estimation Cost", "Actual Cost"], type: "bar",
axisLine: { stack: "Total",
show: true, itemStyle: {
lineStyle: { borderColor: "transparent",
color: "#37A647", color: "transparent",
width: 4, },
emphasis: {
itemStyle: {
borderColor: "transparent",
color: "transparent",
}, },
}, },
axisTick: { data: [2500, 2500],
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
}, },
],
// Vertical axis
yAxis: [
{
type: "value",
axisLine: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
},
],
// Add series
series: [
{ {
name: "Cost", name: "Cost",
type: "bar", type: "bar",
data: [this.dataCompAct.est_cost, this.dataCompAct.real_cost], stack: "Total",
label: { label: {
show: true, show: true,
position: "top", position: "top",
@ -317,7 +321,8 @@ export class CostManagementComponent implements OnInit {
return `Rp. ${params.value.toLocaleString()}`; return `Rp. ${params.value.toLocaleString()}`;
}, },
}, },
barWidth: "50%", // Adjust bar width // barWidth: "50%",
data: [this.dataCompAct.est_cost, this.dataCompAct.real_cost],
}, },
], ],
}; };

View File

@ -36,6 +36,7 @@
id="code" id="code"
formControlName="code" formControlName="code"
maxlength="10" maxlength="10"
(input)="toUppercase($event)"
/> />
<div <div
*ngIf="myForm.get('code').touched && myForm.get('code').invalid" *ngIf="myForm.get('code').touched && myForm.get('code').invalid"

View File

@ -64,6 +64,12 @@ export class AddEditMasterRoomComponent {
}); });
} }
toUppercase(event: Event) {
const input = event.target as HTMLInputElement;
input.value = input.value.toUpperCase();
this.myForm.get('code').setValue(input.value);
}
listDataStatus() { listDataStatus() {
this.monitoringApiService.getMasterData().subscribe((res) => { this.monitoringApiService.getMasterData().subscribe((res) => {
this.data = res.results.data; this.data = res.results.data;

View File

@ -284,6 +284,7 @@ export class DetailComponent {
legend: {}, legend: {},
toolbox: { toolbox: {
show: true, show: true,
orient: 'vertical',
feature: { feature: {
dataView: { show: true, readOnly: false }, dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar'] }, magicType: { show: true, type: ['line', 'bar'] },