perbaikan master
This commit is contained in:
parent
a9034c1a32
commit
13e5ee01d2
|
@ -13,7 +13,7 @@
|
||||||
href="https://allbestsistem.com/"
|
href="https://allbestsistem.com/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
style="background-color: #000000 !important;"
|
style="background-color: #000000 !important;"
|
||||||
>Smart Building Management Systems (V@2024-07-11.03)
|
>Smart Building Management Systems (V@2024-07-12.01)
|
||||||
</a></span
|
</a></span
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -48,7 +48,7 @@ export class AddEditMasterBuildingComponent {
|
||||||
owner: ["", Validators.required],
|
owner: ["", Validators.required],
|
||||||
address: ["", Validators.required],
|
address: ["", Validators.required],
|
||||||
phone: ["", [Validators.required, Validators.pattern(/^[0-9]{10,15}$/)]],
|
phone: ["", [Validators.required, Validators.pattern(/^[0-9]{10,15}$/)]],
|
||||||
kwh: ["", [Validators.required, Validators.maxLength(15), Validators.pattern(/^[0-9]{10,15}$/)]],
|
kwh: ["", [Validators.required, Validators.maxLength(15), Validators.pattern(/^[0-9]{2,15}$/)]],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ export class AddEditMasterBuildingComponent {
|
||||||
address: [this.dataRow.address, Validators.required],
|
address: [this.dataRow.address, Validators.required],
|
||||||
phone: [this.dataRow.phone, [Validators.required, Validators.pattern(/^[0-9]{10,15}$/)]],
|
phone: [this.dataRow.phone, [Validators.required, Validators.pattern(/^[0-9]{10,15}$/)]],
|
||||||
owner: [this.dataRow.owner,Validators.required],
|
owner: [this.dataRow.owner,Validators.required],
|
||||||
kwh: [this.dataRow.kwh, [Validators.required, Validators.maxLength(15), Validators.pattern(/^[0-9]{10,15}$/)]],
|
kwh: [this.dataRow.kwh, [Validators.required, Validators.maxLength(15), Validators.pattern(/^[0-9]{2,15}$/)]],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from "@angular/core";
|
||||||
import { AddEditMasterComponent } from '../add-edit-master/add-edit-master.component';
|
import { AddEditMasterComponent } from "../add-edit-master/add-edit-master.component";
|
||||||
import { TableApiService } from 'src/app/_services/table-api.service';
|
import { TableApiService } from "src/app/_services/table-api.service";
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
|
||||||
import { Router } from '@angular/router';
|
import { Router } from "@angular/router";
|
||||||
import { BuildingService } from '../../service/monitoring-api.service';
|
import { BuildingService } from "../../service/monitoring-api.service";
|
||||||
import { AddEditMasterBuildingComponent } from './add-edit-master-building/add-edit-master-building.component';
|
import { AddEditMasterBuildingComponent } from "./add-edit-master-building/add-edit-master-building.component";
|
||||||
import { LoginService } from '../../service/login.service';
|
import { LoginService } from "../../service/login.service";
|
||||||
|
import { ToastrService } from "ngx-toastr";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-master-building',
|
selector: "app-master-building",
|
||||||
templateUrl: './master-building.component.html',
|
templateUrl: "./master-building.component.html",
|
||||||
styleUrls: ['./master-building.component.css']
|
styleUrls: ["./master-building.component.css"],
|
||||||
})
|
})
|
||||||
export class MasterBuildingComponent {
|
export class MasterBuildingComponent {
|
||||||
data: any;
|
data: any;
|
||||||
|
@ -24,7 +25,8 @@ export class MasterBuildingComponent {
|
||||||
private modalService: NgbModal,
|
private modalService: NgbModal,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private monitoringApiService: BuildingService,
|
private monitoringApiService: BuildingService,
|
||||||
private authService: LoginService
|
private authService: LoginService,
|
||||||
|
private toastr: ToastrService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -74,20 +76,38 @@ export class MasterBuildingComponent {
|
||||||
openAddMasterModal() {
|
openAddMasterModal() {
|
||||||
const modalRef = this.modalService.open(AddEditMasterBuildingComponent, {
|
const modalRef = this.modalService.open(AddEditMasterBuildingComponent, {
|
||||||
size: "lg",
|
size: "lg",
|
||||||
backdrop: 'static',
|
backdrop: "static",
|
||||||
keyboard: false
|
keyboard: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
modalRef.componentInstance.mode = "add";
|
modalRef.componentInstance.mode = "add";
|
||||||
modalRef.result.then(
|
modalRef.result.then(
|
||||||
(result) => {
|
(result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (
|
||||||
.postMasterBuildingParam(result)
|
this.filteredRows.some(
|
||||||
.subscribe((res) => {
|
(value) => value.name.toLowerCase() === result.name.toLowerCase()
|
||||||
this.fetchData();
|
)
|
||||||
|
) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
|
.postMasterBuildingParam(result)
|
||||||
|
.subscribe((res) => {
|
||||||
|
this.fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .postMasterBuildingParam(result)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
@ -98,8 +118,8 @@ export class MasterBuildingComponent {
|
||||||
editRow(row) {
|
editRow(row) {
|
||||||
const modalRef = this.modalService.open(AddEditMasterBuildingComponent, {
|
const modalRef = this.modalService.open(AddEditMasterBuildingComponent, {
|
||||||
size: "lg",
|
size: "lg",
|
||||||
backdrop: 'static',
|
backdrop: "static",
|
||||||
keyboard: false
|
keyboard: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
modalRef.componentInstance.dataRow = row;
|
modalRef.componentInstance.dataRow = row;
|
||||||
|
@ -107,12 +127,27 @@ export class MasterBuildingComponent {
|
||||||
modalRef.result.then(
|
modalRef.result.then(
|
||||||
(result) => {
|
(result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.putMasterBuildingParam(result, row.id)
|
.putMasterBuildingParam(result, row.id)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .putMasterBuildingParam(result, row.id)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
|
|
@ -29,7 +29,7 @@ export class MasterCategoryComponent implements OnInit {
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private monitoringApiService: BuildingService,
|
private monitoringApiService: BuildingService,
|
||||||
private toastr: ToastrService,
|
private toastr: ToastrService,
|
||||||
private authService: LoginService
|
private authService: LoginService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -98,23 +98,39 @@ export class MasterCategoryComponent implements OnInit {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService.postHeaderDetailParam(result).subscribe(
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
(res) => {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
|
.postHeaderDetailParam(result)
|
||||||
|
.subscribe((res) => {
|
||||||
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
this.toastr.success("Success", "Save Completed.", {
|
});
|
||||||
timeOut: 2000,
|
}
|
||||||
closeButton: true,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error(error);
|
|
||||||
this.toastr.error("Error", "Something went wrong!", {
|
|
||||||
timeOut: 2000,
|
|
||||||
closeButton: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService.postHeaderDetailParam(result).subscribe(
|
||||||
|
// (res) => {
|
||||||
|
// this.fetchData();
|
||||||
|
// this.toastr.success("Success", "Save Completed.", {
|
||||||
|
// timeOut: 2000,
|
||||||
|
// closeButton: true,
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// (error) => {
|
||||||
|
// console.error(error);
|
||||||
|
// this.toastr.error("Error", "Something went wrong!", {
|
||||||
|
// timeOut: 2000,
|
||||||
|
// closeButton: true,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
@ -137,25 +153,40 @@ export class MasterCategoryComponent implements OnInit {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.putHeaderDetailParam(result, row.id)
|
.putHeaderDetailParam(result, row.id)
|
||||||
.subscribe(
|
.subscribe((res) => {
|
||||||
(res) => {
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
this.toastr.success("Success", "Update Completed.", {
|
});
|
||||||
timeOut: 2000,
|
}
|
||||||
closeButton: true,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error(error);
|
|
||||||
this.toastr.error("Error", "Something went wrong!", {
|
|
||||||
timeOut: 2000,
|
|
||||||
closeButton: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .putHeaderDetailParam(result, row.id)
|
||||||
|
// .subscribe(
|
||||||
|
// (res) => {
|
||||||
|
// this.fetchData();
|
||||||
|
// this.toastr.success("Success", "Update Completed.", {
|
||||||
|
// timeOut: 2000,
|
||||||
|
// closeButton: true,
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// (error) => {
|
||||||
|
// console.error(error);
|
||||||
|
// this.toastr.error("Error", "Something went wrong!", {
|
||||||
|
// timeOut: 2000,
|
||||||
|
// closeButton: true,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { BuildingService } from '../../service/monitoring-api.service';
|
import { BuildingService } from '../../service/monitoring-api.service';
|
||||||
import { LoginService } from '../../service/login.service';
|
import { LoginService } from '../../service/login.service';
|
||||||
|
import { ToastrService } from 'ngx-toastr';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-master-duration-use',
|
selector: 'app-master-duration-use',
|
||||||
|
@ -24,7 +25,8 @@ export class MasterDurationUseComponent {
|
||||||
private modalService: NgbModal,
|
private modalService: NgbModal,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private monitoringApiService: BuildingService,
|
private monitoringApiService: BuildingService,
|
||||||
private authService: LoginService
|
private authService: LoginService,
|
||||||
|
private toastr: ToastrService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -90,12 +92,27 @@ export class MasterDurationUseComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (result) {
|
||||||
.postHeaderDetailParam(result)
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
.subscribe((res) => {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
console.log(res);
|
timeOut: 5000,
|
||||||
this.fetchData();
|
closeButton: true,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
|
.postHeaderDetailParam(result)
|
||||||
|
.subscribe((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .postHeaderDetailParam(result)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
|
@ -118,13 +135,28 @@ export class MasterDurationUseComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.putHeaderDetailParam(result, row.id)
|
.putHeaderDetailParam(result, row.id)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .putHeaderDetailParam(result, row.id)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { BuildingService } from '../../service/monitoring-api.service';
|
import { BuildingService } from '../../service/monitoring-api.service';
|
||||||
import { LoginService } from '../../service/login.service';
|
import { LoginService } from '../../service/login.service';
|
||||||
|
import { ToastrService } from 'ngx-toastr';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-master-floor',
|
selector: 'app-master-floor',
|
||||||
|
@ -24,7 +25,8 @@ export class MasterFloorComponent {
|
||||||
private modalService: NgbModal,
|
private modalService: NgbModal,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private monitoringApiService: BuildingService,
|
private monitoringApiService: BuildingService,
|
||||||
private authService: LoginService
|
private authService: LoginService,
|
||||||
|
private toastr: ToastrService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -90,13 +92,28 @@ export class MasterFloorComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.postHeaderDetailParam(result)
|
.postHeaderDetailParam(result)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .postHeaderDetailParam(result)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
@ -118,13 +135,28 @@ export class MasterFloorComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.putHeaderDetailParam(result, row.id)
|
.putHeaderDetailParam(result, row.id)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .putHeaderDetailParam(result, row.id)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { BuildingService } from '../../service/monitoring-api.service';
|
import { BuildingService } from '../../service/monitoring-api.service';
|
||||||
import { LoginService } from '../../service/login.service';
|
import { LoginService } from '../../service/login.service';
|
||||||
|
import { ToastrService } from 'ngx-toastr';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-master-role',
|
selector: 'app-master-role',
|
||||||
|
@ -24,7 +25,8 @@ export class MasterRoleComponent {
|
||||||
private modalService: NgbModal,
|
private modalService: NgbModal,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private monitoringApiService: BuildingService,
|
private monitoringApiService: BuildingService,
|
||||||
private authService: LoginService
|
private authService: LoginService,
|
||||||
|
private toastr: ToastrService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -90,13 +92,28 @@ export class MasterRoleComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.postHeaderDetailParam(result)
|
.postHeaderDetailParam(result)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .postHeaderDetailParam(result)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
@ -118,13 +135,28 @@ export class MasterRoleComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.putHeaderDetailParam(result, row.id)
|
.putHeaderDetailParam(result, row.id)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .putHeaderDetailParam(result, row.id)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
import { BuildingService } from "../../service/monitoring-api.service";
|
import { BuildingService } from "../../service/monitoring-api.service";
|
||||||
import { LoginService } from "../../service/login.service";
|
import { LoginService } from "../../service/login.service";
|
||||||
|
import { ToastrService } from "ngx-toastr";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-master-room",
|
selector: "app-master-room",
|
||||||
|
@ -21,7 +22,8 @@ export class MasterRoomComponent {
|
||||||
constructor(
|
constructor(
|
||||||
private modalService: NgbModal,
|
private modalService: NgbModal,
|
||||||
private monitoringApiService: BuildingService,
|
private monitoringApiService: BuildingService,
|
||||||
private authService: LoginService
|
private authService: LoginService,
|
||||||
|
private toastr: ToastrService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { TableApiService } from 'src/app/_services/table-api.service';
|
||||||
import { BuildingService } from '../../service/monitoring-api.service';
|
import { BuildingService } from '../../service/monitoring-api.service';
|
||||||
import { AddEditMasterComponent } from '../add-edit-master/add-edit-master.component';
|
import { AddEditMasterComponent } from '../add-edit-master/add-edit-master.component';
|
||||||
import { LoginService } from '../../service/login.service';
|
import { LoginService } from '../../service/login.service';
|
||||||
|
import { ToastrService } from 'ngx-toastr';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-master-status',
|
selector: 'app-master-status',
|
||||||
|
@ -24,7 +25,8 @@ export class MasterStatusComponent {
|
||||||
private modalService: NgbModal,
|
private modalService: NgbModal,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private monitoringApiService: BuildingService,
|
private monitoringApiService: BuildingService,
|
||||||
private authService: LoginService
|
private authService: LoginService,
|
||||||
|
private toastr: ToastrService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -90,13 +92,28 @@ export class MasterStatusComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.postHeaderDetailParam(result)
|
.postHeaderDetailParam(result)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .postHeaderDetailParam(result)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
@ -118,13 +135,28 @@ export class MasterStatusComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.putHeaderDetailParam(result, row.id)
|
.putHeaderDetailParam(result, row.id)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .putHeaderDetailParam(result, row.id)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { BuildingService } from '../../service/monitoring-api.service';
|
import { BuildingService } from '../../service/monitoring-api.service';
|
||||||
import { LoginService } from '../../service/login.service';
|
import { LoginService } from '../../service/login.service';
|
||||||
|
import { ToastrService } from 'ngx-toastr';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-master-type',
|
selector: 'app-master-type',
|
||||||
|
@ -24,7 +25,8 @@ export class MasterTypeComponent {
|
||||||
private modalService: NgbModal,
|
private modalService: NgbModal,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private monitoringApiService: BuildingService,
|
private monitoringApiService: BuildingService,
|
||||||
private authService: LoginService
|
private authService: LoginService,
|
||||||
|
private toastr: ToastrService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -88,15 +90,29 @@ export class MasterTypeComponent {
|
||||||
modalRef.componentInstance.mode = "add";
|
modalRef.componentInstance.mode = "add";
|
||||||
modalRef.result.then(
|
modalRef.result.then(
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.postHeaderDetailParam(result)
|
.postHeaderDetailParam(result)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .postHeaderDetailParam(result)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
@ -116,15 +132,29 @@ export class MasterTypeComponent {
|
||||||
modalRef.componentInstance.mode = "edit";
|
modalRef.componentInstance.mode = "edit";
|
||||||
modalRef.result.then(
|
modalRef.result.then(
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
|
||||||
if (result) {
|
if (result) {
|
||||||
this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
|
timeOut: 5000,
|
||||||
|
closeButton: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.monitoringApiService
|
||||||
.putHeaderDetailParam(result, row.id)
|
.putHeaderDetailParam(result, row.id)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// if (result) {
|
||||||
|
// this.monitoringApiService
|
||||||
|
// .putHeaderDetailParam(result, row.id)
|
||||||
|
// .subscribe((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.fetchData();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
|
|
@ -125,14 +125,21 @@ export class MasterVoltageComponent {
|
||||||
modalRef.result.then(
|
modalRef.result.then(
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
// if (result) {
|
if (result) {
|
||||||
// this.monitoringApiService
|
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
||||||
// .putHeaderDetailParam(result, row.id)
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
// .subscribe((res) => {
|
timeOut: 5000,
|
||||||
// console.log(res);
|
closeButton: true,
|
||||||
// this.fetchData();
|
});
|
||||||
// });
|
} else {
|
||||||
// }
|
this.monitoringApiService
|
||||||
|
.putHeaderDetailParam(result, row.id)
|
||||||
|
.subscribe((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
(reason) => {
|
(reason) => {
|
||||||
console.log(`Dismissed: ${reason}`);
|
console.log(`Dismissed: ${reason}`);
|
||||||
|
|
|
@ -138,7 +138,7 @@
|
||||||
<p
|
<p
|
||||||
class="card-subtitle line-on-side text-muted text-center font-small-3 mx-2 my-1"
|
class="card-subtitle line-on-side text-muted text-center font-small-3 mx-2 my-1"
|
||||||
>
|
>
|
||||||
<span>(v@2024.07.11.03)</span>
|
<span>(v@2024.07.12.01)</span>
|
||||||
</p>
|
</p>
|
||||||
<!-- <div class="card-body">
|
<!-- <div class="card-body">
|
||||||
<a
|
<a
|
||||||
|
|
Loading…
Reference in New Issue