Commit 61a21b06 by Nattana Chaiyamat

การประเมินสมรรถนะ

การจัดการสมรรถนะ
จัดกลุ่มสมรรถนะ
แก้ไขกลุ่มสมรรถนะ
parent 2a3d1080
......@@ -158,10 +158,17 @@ export class EditGroupCompetenciesComponent {
}
deleteGroupAssessmentById() {
this.dataList = this.dataList.filter((item, i) => (this.groupAssessmentIndex == -1 ? !item.check : i != this.groupAssessmentIndex));
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.detectChanges();
if (this.groupAssessmentIndex == -1) {
this.dataList = this.dataList.filter(item => !item.check);
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.detectChanges();
} else {
this.dataList = this.dataList.splice(this.groupAssessmentIndex, 1)
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.detectChanges();
}
}
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
......
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AppraisalService } from 'src/app/shared/services/appraisal.service';
@Component({
selector: 'app-round-one',
templateUrl: './round-one.component.html',
styleUrls: ['./round-one.component.scss']
})
export class RoundOneComponent {
@Input() pathTitle = ['การประเมินสมรรถนะ', 'ทะเบียนเครื่องมือ', 'เครื่องมือประเมิน'];
export class RoundOneComponent { @Input() pathTitle = ['การประเมินสมรรถนะ', 'ทะเบียนเครื่องมือ', 'เครื่องมือประเมิน'];
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
@Output() sendPageEvalution: EventEmitter<string> = new EventEmitter<string>();
@Output() sendEmployeeId: EventEmitter<string> = new EventEmitter<string>();
activeTab: string = 'tab1'; // กำหนด tab เริ่มต้น
isChecked: boolean = false;
// ฟังก์ชันในการเปลี่ยนแท็บ
changeTab(tab: { id: string, text: string }) {
this.sendPathTitle.emit(['การประเมินสมรรถนะ', 'ทะเบียนเครื่องมือ', tab.text]);
this.activeTab = tab.id;
}
toggleCheckbox(): void {
this.isChecked = !this.isChecked;
}
// การจัดการการเปิดปิด modal
modalOptions: {
[nameModal: string]: {
isModalOpen: boolean;
modalSize: string;
backdropClose: boolean;
};
} = {
"add": {
isModalOpen: false,
modalSize: 'm',
backdropClose: true,
},
"edit": {
isModalOpen: false,
modalSize: 'm',
backdropClose: true,
}
};
openModal(name: string, size: string, closeOnBackdrop?: boolean) {
this.modalOptions[name].modalSize = size;
this.modalOptions[name].backdropClose = closeOnBackdrop || false;
this.modalOptions[name].isModalOpen = true;
this.currentModal = name; // ตั้งค่าค่าของ currentModal เป็น 'add' หรือ 'edit'
document.body.style.overflow = 'hidden';
}
closeModal(name: string) {
this.modalOptions[name].isModalOpen = false;
if (!this.isAnyModalOpen()) {
document.body.style.overflow = ''; // คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
}
isAnyModalOpen(): boolean {
return Object.values(this.modalOptions).some(modal => modal.isModalOpen); // ตรวจสอบว่า modal อื่นยังเปิดอยู่หรือไม่
}
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
addUser() {
}
currentModal = ""
constructor(private toastr: ToastrService) { }
showSuccess() {
this.toastr.success('บันทึกข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
showSuccessEdit() {
this.toastr.success('เเก้ไขข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
constructor(private appraisalService: AppraisalService
) {
}
showSuccessDelete() {
this.toastr.success('ลบข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
getBossList(){
}
returnPage(text: string) {
this.sendEmployeeId.emit()
......
......@@ -22,4 +22,7 @@ export class AppraisalService {
postCompetency(body: AppraisalCompentencyModel2): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi + "/competency", body)
}
getBossList(): Observable<AppraisalCompentencyModel2> {
return this.http.get<AppraisalCompentencyModel2>(this.urlApi + "/appraisal/boss/emp")
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment