Commit d2f40ff3 by Natthaphat Pankiang

การประเมินสมรรถนะ >การจัดการรอบการประเมิน >กำหนดฟอร์มเอกสาร

parents 3ad46602 4c2c2eb8
......@@ -32,6 +32,7 @@ import { JobDetailComponent } from '../job-detail-components/job-detail/job-deta
import { CommandStructureComponent } from '../job-detail-components/command-structure/command-structure.component';
import { AssessmentManagementComponent } from '../performance-management-evaluation/assessment-management/assessment-management.component';
import { JobPositionIndicatorsComponent } from '../job-detail-components/job-position-indicators/job-position-indicators.component';
import { EvaluationCyclePerformanceComponent } from '../performance-management-evaluation/evaluation-cycle-performance/evaluation-cycle-performance.component';
......@@ -71,6 +72,7 @@ const routes: Routes = [
{ path: "command-structure",title: 'โครงสร้างสายการบังคับบัญชา', component: CommandStructureComponent },
{ path: "assessment-management",title: 'การจัดการการประเมิณ', component: AssessmentManagementComponent },
{ path: "job-position-indicators",title: 'ตัวชี้วัดของตำแหน่งงาน', component: JobPositionIndicatorsComponent },
{ path: "evaluation-cycle-performance",title: 'รอบการประเมิณ', component: EvaluationCyclePerformanceComponent },
]
}
];
......
......@@ -86,6 +86,9 @@ import { SubJobPositionIndicatorsComponent } from '../job-detail-components/job-
import { JobPositionIndicatorsComponent } from '../job-detail-components/job-position-indicators/job-position-indicators.component';
import { DefineDocumentFormComponent } from '../competency-assessment/evaluation-cycle-manager/define-document-form/define-document-form.component';
import { EditDefineDocumentFormComponent } from '../competency-assessment/evaluation-cycle-manager/define-document-form/edit-define-document-form/edit-define-document-form.component';
import { EvaluationCyclePerformanceComponent } from '../performance-management-evaluation/evaluation-cycle-performance/evaluation-cycle-performance.component';
import { DocumentFormComponent } from '../performance-management-evaluation/evaluation-cycle-performance/document-form/document-form.component';
import { EditEvaluationFormComponent } from '../performance-management-evaluation/evaluation-cycle-performance/document-form/edit-evaluation-form/edit-evaluation-form.component';
@NgModule({
declarations: [
......@@ -154,6 +157,10 @@ import { EditDefineDocumentFormComponent } from '../competency-assessment/evalua
SubJobPositionIndicatorsComponent,
DefineDocumentFormComponent,
EditDefineDocumentFormComponent,
EvaluationCyclePerformanceComponent,
DocumentFormComponent,
EditEvaluationFormComponent,
],
imports: [
CommonModule,
......
<div class="w-full min-height-50px mb-10px justify-between items-center">
<div class="flex justify-end">
<div class="px-1">
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name"
[(ngModel)]="search" (ngModelChange)="searchChange()">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
<div class="page px-rem">
<div class="overflow-auto rounded-top-0.65rem">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead class="height-50px">
<tr class="font-size-12px">
<ng-container
*ngFor="let item of ['รหัส','รายละเอียด','รอบปีการประเมิน','วันที่เริ่มต้น','วันที่สิ้นสุด','สถานะ','Action']; let f = first; let l = last">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l&&!f">
<i class="ti ti-dots-vertical fs-l"></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody *ngIf="!dataListFilter().length">
<tr>
<td class="text-center" colspan="100%">
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody *ngIf="dataListFilter().length">
<tr
*ngFor="let item of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td class="flex justify-around">{{item.code}}</td>
<td style="width: 300px;">{{item.period}}</td>
<td>{{item.year}}</td>
<td>{{item.startDate}}</td>
<td>{{item.endDate}}</td>
<td>
<span class="flex justify-center items-center rounded-full h-5 w-5 text-white"
[ngClass]="{'bg-success':item.status=='1','bg-warning':item.status=='2','bg-gray-400':item.status=='3'}">
<ng-container [ngSwitch]="item.status">
<i *ngSwitchCase="'1'" class="ti ti-player-play"></i>
<i *ngSwitchCase="'2'" class="ti ti-clock"></i>
<div *ngSwitchDefault></div>
</ng-container>
</span>
</td>
<td class="flex justify-center items-center">
<ng-container *ngIf="item.status == '2'; else defaultActions">
<button class="badge text-white m-1 bg-primary" (click)="onEdit()">สร้างแบบฟอร์ม</button>
</ng-container>
<ng-template #defaultActions>
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
(click)="modalStatus='edit';dataListSelect(item)"
data-hs-overlay="#document-form-modal"></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#document-form-alert-delete-modal"></i>
</ng-template>
</td>
</tr>
</tbody>
</table>
</div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="page.length">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="currentPage = (currentPage-1 || 1)">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li *ngFor="let item of page;let f = first;let l = last">
<ng-container *ngIf="item==3&&currentPage!=1&&currentPage!=2&&currentPage!=3">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a>
</ng-container>
<ng-container *ngIf="(f||l)||(item==currentPage-1||item==currentPage||item==currentPage+1)">
<a class="page-link" href="javascript:void(0);" [class.active]="item==currentPage"
(click)="currentPage=item">{{item}}
</a>
</ng-container>
<ng-container
*ngIf="item==page.length-2&&currentPage!=page.length&&currentPage!=page.length-1&&currentPage!=page.length-2">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a>
</ng-container>
</li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="currentPage = (currentPage > page.length-1 ? currentPage: currentPage+1 )">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
</nav>
</div>
<div id="document-form-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]">
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
{{modalStatus=='add'?'เพิ่มรอบการประเมิน':'แก้ไขรอบการประเมิน'}}
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#document-form-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="w-full flex justify-end">
<div class="absolute flex">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md">
<svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00"
xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84"
transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path d="M15 49A24 24 0 0 1 32 8"></path>
<path d="M49 15a24 24 0 0 1-17 41"></path>
<polyline points="15.03 40 15.03 48.97 8 48.97"></polyline>
<polyline points="48.97 24 48.97 15.03 56 15.03"></polyline>
</g>
</svg>
Clear
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
<div class="ti-modal-body padding-16px pt-0 overflow-y-0">
<label for="input-label" class="ti-form-label mt-2rem">รหัส รอบการประเมิน *</label>
<input type="text" id="input-label" class="ti-form-input w-1/2"
[ngClass]="{'bg-input-readonly':modalStatus=='edit'}" [readonly]="modalStatus=='edit'"
[(ngModel)]="dataSelect.code">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (ไทย) *</label>
<input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="dataSelect.period">
<label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (อังกฤษ)</label>
<input type="text" id="detail_eng" class="ti-form-input h-16">
<label for="input-label" class="ti-form-label mt-2rem">ปีการประเมิน</label>
<input type="text" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="dataSelect.year">
<label for="input-label" class="ti-form-label mt-2rem">ช่วงเวลารอบการประเมิน</label>
<input type="text" name="daterange" id="inlinetime" ngxDaterangepickerMd
class="form-control ti-form-input focus:z-10 flatpickr-input" readonly />
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay="#document-form-modal">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#document-form-alert-edit-modal">
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div id="document-form-alert-edit-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
<div class="max-h-full overflow-hidden ti-modal-content-alert w-full">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
แจ้งเตือน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#document-form-alert-edit-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="ti-modal-body ">
<p class="mt-1 text-gray-800 dark:text-white/70">
ยืนยันการเเก้ไขข้อมูลหรือไม่
</p>
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay="#document-form-modal">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#document-form-alert-edit-modal" (click)="addUser();showSuccessEdit()">
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div id="document-form-alert-delete-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
<div class="max-h-full overflow-hidden ti-modal-content-alert w-full">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
แจ้งเตือน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#document-form-alert-delete-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="ti-modal-body ">
<p class="mt-1 text-gray-800 dark:text-white/70">
ยืนยันการลบข้อมูลหรือไม่!
</p>
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay="#document-form-table-modal-edit">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#document-form-alert-delete-modal" (click)="addUser();showSuccessDelete()">
ลบข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
.ti-modal-content-alert{
width: 35%; /* ความกว้างที่คุณต้องการ */
position: absolute; /* ทำให้สามารถจัดตำแหน่งได้ */
top: 50%; /* ให้อยู่กลางในแนวตั้ง */
left: 50%; /* ให้อยู่กลางในแนวนอน */
transform: translate(-50%, -50%); /* เคลื่อนที่ modal กลับมาให้ตรงกลาง */
background-color: #ffffff;
}
\ No newline at end of file
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
export interface dataModel {
check: boolean,
code: string,
period: string,
year: string,
startDate: string,
endDate: string,
status: string
}
@Component({
selector: 'app-document-form',
templateUrl: './document-form.component.html',
styleUrls: ['./document-form.component.scss']
})
export class DocumentFormComponent {
@Input() pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'รอบการประเมิน', 'กำหนดฟอร์มเอกสาร'];
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
@Output() sendGroupShow: EventEmitter<string> = new EventEmitter<string>();
activeTab: string = 'tab1'; // กำหนด tab เริ่มต้น
onEdit(){
this.sendGroupShow.emit('2');
}
// ฟังก์ชันในการเปลี่ยนแท็บ
changeTab(tab: { id: string, text: string }) {
this.sendPathTitle.emit(['การประเมินจัดการประสิทธิภาพ', 'การจัดการประเมิณ', tab.text]);
this.activeTab = tab.id;
}
currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1);
search = ""
numDataListChecked = 0
isDataListChecked = false
isDataListCheckedAll = false
dataList: dataModel[] = [
{
check: false,
code: "Y67P2",
period: "ช่วงเวลาที่ 2",
year: "2567",
startDate: "01-07-2567",
endDate: "31-12-2567",
status: "1"
},
{
check: false,
code: "Y68P1",
period: "ช่วงเวลาที่ 1",
year: "2568",
startDate: "01-01-2568",
endDate: "30-06-2568",
status: "2"
},
]
dataSelect: dataModel = {
check: false,
code: "",
period: "",
year: "",
startDate: "",
endDate: "",
status: "",
}
modalStatus: "add" | "edit" = "add"
constructor(private toastr: ToastrService, private cdr: ChangeDetectorRef) {
}
dataListSelect(data?: dataModel) {
this.dataSelect = data || {
check: false,
code: "",
period: "",
year: "",
startDate: "",
endDate: "",
status: "",
}
this.cdr.detectChanges()
}
dataListFilter() {
return this.dataList.filter(x => {
const match = x.code.includes(this.search) || x.period.includes(this.search);
if (!match) x.check = false;
return match;
});
}
dataListCheck() {
const dataCheck = this.dataListFilter();
this.isDataListChecked = dataCheck.some(x => x.check);
this.isDataListCheckedAll = dataCheck.length ? dataCheck.every(x => x.check) : false;
this.numDataListChecked = dataCheck.filter(x => x.check).length;
}
dataListCheckAll() {
const selectAll = this.isDataListCheckedAll;
this.dataList.forEach(x => x.check = selectAll);
this.dataListCheck();
}
searchChange() {
this.currentPage = 1;
const filteredData = this.dataListFilter();
this.page = Array.from({ length: Math.ceil(filteredData.length / 10) }, (_, i) => i + 1);
this.dataListCheck();
}
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 อื่นยังเปิดอยู่หรือไม่
}
// ฟังก์ชัน toggle checkbox
isChecked: boolean = false; // ใช้สำหรับตรวจสอบสถานะของ checkbox
toggleCheckbox() {
this.isChecked = !this.isChecked; // สลับสถานะ
}
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
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',
});
}
showSuccessDelete() {
this.toastr.success('ลบข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
}
<div class="flex items-center py-4 border-b-2 border-collapse ">
<button type="button" class="ti-btn ti-btn-outline ti-btn-outline-light h-20px m-0 shadow-md text-blue-500" (click)="onBack()">
<i class="ri-arrow-left-s-line"></i> ย้อนกลับ
</button>
<div class="text-2xl font-bold py-2 text-primary px-4 ">
เเก้ไขเเบบฟอร์มตามรอบการประเมิน
</div>
</div>
<div class="body-content">
<div class="page">
<div class="border-b border-t border-gray-200 dark:border-white/10">
<div class="grid grid-cols-2 gap-6 mt-5">
<div class="col-span-1">
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">รอบการประเมิน</label>
</div>
<div class="col-span-1">
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">ปีการประเมิน</label>
</div>
</div>
<div class="grid grid-cols-2 gap-6 mb-5">
<div class="col-span-1">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly" readonly value="ช่วงเวลาที่ 2">
</div>
<div class="col-span-1">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly" readonly value="2567">
</div>
</div>
</div>
</div>
</div>
<div class="header-title-type">
<div class="flex justify-end">
<div class="px-1">
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name"
style="height: 40px;">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-success h-20px m-0 shadow-md"
data-hs-overlay="#edit-evaluation-form-alert-modal">
<i class="ri-save-3-line"></i>
Save
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-10 m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
<div class="page px-rem">
<div class="overflow-auto table-bordered rounded-t-md">
<div id="card-type-1" role="tabpanel" aria-labelledby="card-type-item-1">
<div class="overflow-auto shadow-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead>
<tr>
<ng-container
*ngFor="let item of ['รหัสเเบบฟอร์ม','ชื่อพนักงาน','ตำเเหน่ง','ระดับพนักงาน','Action']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f || l || item === 'ระดับความหวัง'">
<span class="text-sm">{{ item }}</span>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of[
['F6702-01', 'พิมพร อุดมการ','Human Resource Development Officer S3','พนักงานระดับ S1-S2'],
['F6702-02', 'กรกนก อินทนิน','HRD Training Officer','พนักงานระดับ S3-S4'],
['F6702-03', 'ลลิตา อาเเว','Recruitment & Employment Officer','พนักงานระดับ S1-S2'],
['F6702-04', 'ภาวินี ย้อนเวลา','Time keeper & Doc.[Payroll] Officer','พนักงานระดับ S1-S2'],
['F6702-06', 'จิตรา อาคมเเคง','Employee Relations Officer','พนักงานระดับ S3-S4']];let i = index">
<td class="text-center" style="font-size: 12px; width: 12%;">{{item[0]}}</td>
<td style="font-size: 12px; width: 40%;">{{item[1]}}</td>
<td style="font-size: 12px; width: 15%; word-break: break-word; white-space: normal;">
{{item[2]}}
</td>
<td style="font-size: 12px; width: 15%;">{{item[3]}}</td>
<td class="text-center">
<div class="flex justify-center items-center">
<div class="flex justify-center items-center">
<i *ngIf="hsSwitchChecked[item[0]]" class="ti ti-edit cursor-pointer i-gray fs-xl px-2 text-center" data-hs-overlay="#edit-evaluation-form-table-modal-edit"></i>
<input type="checkbox" id="hs-small-switch-{{item[0]}}" class="ti-switch shrink-0 w-11 h-6 before:w-5 before:h-5"
[(ngModel)]="hsSwitchChecked[item[0]]">
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="body-content" style="margin-top: 20px;">
<ul class="nav-tabs">
<div class="px-1 py-1 bg-white rounded-2 shadow justify-content-center align-items-center">
<div class="box-body">
<nav class="pagination-style-3 overflow-auto">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li><a class="page-link active" href="javascript:void(0);" aria-current="page">1</a>
</li>
<li><a class="page-link" href="javascript:void(0);">2</a></li>
<li><a class="page-link" href="javascript:void(0);">3</a></li>
<li><a class="page-link" href="javascript:void(0);">4</a></li>
<li><a class="page-link" href="javascript:void(0);">5</a></li>
<li><a class="page-link" href="javascript:void(0);">...</a></li>
<li><a class="page-link" href="javascript:void(0);">31</a></li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
</nav>
</div>
</div>
</ul>
<ul class="nav-tabs mt-1">
<p>Show 1 to 10 of 50 items</p>
</ul>
</div>
</div>
<div id="edit-evaluation-form-table-modal-edit" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto">
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
การประเมินผล
</h3>
<div class="flex justify-end">
<button type="button"
class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#edit-evaluation-form-table-modal-edit">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="ti-modal-body">
<div class="body-content">
<div class="page">
<div class="border-b border-gray-200 dark:border-white/10">
<div class="grid grid-cols-2 gap-6 mt-2">
<div class="col-span-1">
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">รหัสเเบบฟอร์ม</label>
</div>
<div class="col-span-1">
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">ชื่อพนักงาน</label>
</div>
</div>
<div class="grid grid-cols-2 gap-6 mb-5">
<div class="col-span-1">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly" readonly value="F6702-01">
</div>
<div class="col-span-1">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly" readonly value="พิมพร อูรณการ">
</div>
</div>
</div>
</div>
</div>
<div class="body-content-table">
<div class="page">
<div class="flex justify-between">
<div class="flex pr-2">
<div class="flex">
<div class="flex items-center">
<input type="checkbox" class="ti-form-checkbox pointer-events-none" id="hs-default-checkbox"
[(ngModel)]="isDataListChecked">
<label for="hs-default-checkbox" class="text-sm text-gray-500 mx-2 pointer-events-none">
{{numDataListChecked}} Selected</label>
</div>
<div class="mx-1 flex items-center">
<button (click)="isDataListCheckedAll = !isDataListCheckedAll;dataListCheckAll()"
class="focus:ring-2 focus:ring-primary rounded-sm flex item-center">
<i class="fs-l transition-all duration-200"
[ngClass]="{'ri-checkbox-multiple-line text-gray-500': !isDataListCheckedAll, 'ri-checkbox-multiple-fill text-primary': isDataListCheckedAll}"></i>
</button>
<label class="text-sm text-gray-500 ml-2">Select All</label>
</div>
</div>
</div>
<div class="flex justify-end">
<div class="px-1">
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name"
[(ngModel)]="search" (ngModelChange)="searchChange()">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md" data-hs-overlay="#edit-evaluation-form-add-table-modal-edit">
<i class="ri-add-line"></i>
Add
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-45px m-0 shadow-md"
data-hs-overlay="#edit-evaluation-form-alert-delete-modal">
<i class="ti ti-trash fs-l"></i>
Delete
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
</div>
</div>
<div class="overflow-auto table-bordered" style="border-radius: 5px;">
<div class="overflow-auto border">
<table class="ti-custom-table ti-custom-table-head">
<thead>
<tr>
<ng-container
*ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','น้ำหนัก','Action']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l">
<span class="text-sm">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!f && i==1">
<svg class="head-table-icon" xmlns="http://www.w3.org/2000/svg" width="30"
height="13" fill="currentColor" viewBox="0 0 16 16">
<path
d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z">
</path>
</svg>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody *ngIf="!dataListFilter().length">
<tr>
<td class="text-center" colspan="100%">
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody *ngIf="dataListFilter().length">
<tr
*ngFor="let item of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td style="font-size: 12px; width: 15%;" class="text-center">
<input style="margin-right: 20px;" type="checkbox" class="ti-form-checkbox cursor-pointer " [(ngModel)]="item.check"
(ngModelChange)="dataListCheck()">
<label>{{item.code}}</label>
</td>
<td style="font-size: 12px; width: 40%; word-break: break-word; white-space: normal;">
{{item.headname}}
</td>
<td style="font-size: 12px; width: 15%;">{{item.type}}</td>
<td style="font-size: 12px; width: 15%;"><span>{{item.weight}}</span></td>
<td class="flex justify-center items-center">
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#edit-evaluation-form-alert-delete-modal"></i>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="page.length">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="currentPage = (currentPage-1 || 1)">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li *ngFor="let item of page;let f = first;let l = last">
<ng-container *ngIf="item==3&&currentPage!=1&&currentPage!=2&&currentPage!=3">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a>
</ng-container>
<ng-container *ngIf="(f||l)||(item==currentPage-1||item==currentPage||item==currentPage+1)">
<a class="page-link" href="javascript:void(0);" [class.active]="item==currentPage"
(click)="currentPage=item">{{item}}
</a>
</ng-container>
<ng-container
*ngIf="item==page.length-2&&currentPage!=page.length&&currentPage!=page.length-1&&currentPage!=page.length-2">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a>
</ng-container>
</li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="currentPage = (currentPage > page.length-1 ? currentPage: currentPage+1 )">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
</nav>
<div class="flex justify-end mt-3rem mb-1rem space-x-4">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay="#edit-evaluation-form-table-modal-edit">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-form-alert-modal">
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div id="edit-evaluation-form-add-table-modal-edit" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto">
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
การประเมินผล
</h3>
<div class="flex justify-end">
<button type="button"
class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#edit-evaluation-form-table-modal-edit">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="ti-modal-body">
<div class="flex justify-end pb-1rem">
<div class="px-1">
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
<div class="overflow-auto table-bordered" style="border-radius: 5px;">
<div class="overflow-auto border">
<table class="ti-custom-table ti-custom-table-head">
<thead>
<tr>
<ng-container
*ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','น้ำหนัก','Action']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l">
<span class="text-sm">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!f && i==1">
<svg class="head-table-icon" xmlns="http://www.w3.org/2000/svg" width="30"
height="13" fill="currentColor" viewBox="0 0 16 16">
<path
d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z">
</path>
</svg>
</div>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!f && i==2">
<svg class="head-table-icon" xmlns="http://www.w3.org/2000/svg" width="30"
height="13" fill="currentColor" viewBox="0 0 16 16">
<path
d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z">
</path>
</svg>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody *ngIf="!dataListFilter().length">
<tr>
<td class="text-center" colspan="100%">
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody *ngIf="dataListFilter().length">
<tr
*ngFor="let item of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td style="font-size: 12px; width: 15%;" class="text-center">
<input style="margin-right: 20px;" type="checkbox" class="ti-form-checkbox cursor-pointer " [(ngModel)]="item.check"
(ngModelChange)="dataListCheck()">
<label>{{item.code}}</label>
</td>
<td style="font-size: 12px; width: 40%; word-break: break-word; white-space: normal;">
{{item.headname}}
</td>
<td style="font-size: 12px; width: 15%;">{{item.type}}</td>
<td class="text-center" style="font-size: 12px; width: 15%;">{{item.weight}}</td>
<td class="flex justify-center">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#edit-evaluation-form-alert-modal">
<i class="ri-add-line"></i>
Select
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="body-content" style="margin-top: 20px;">
<ul class="nav-tabs">
<div class="px-1 bg-white rounded-2 shadow justify-content-center align-items-center">
<div class="box-body">
<nav class="pagination-style-3 overflow-auto">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li><a class="page-link active" href="javascript:void(0);" aria-current="page">1</a></li>
<li><a class="page-link" href="javascript:void(0);">2</a></li>
<li><a class="page-link" href="javascript:void(0);">3</a></li>
<li><a class="page-link" href="javascript:void(0);">4</a></li>
<li><a class="page-link" href="javascript:void(0);">5</a></li>
<li><a class="page-link" href="javascript:void(0);">...</a></li>
<li><a class="page-link" href="javascript:void(0);">31</a></li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
</nav>
</div>
</div>
</ul>
<ul class="nav-tabs mt-1">
<p>Show 1 to 10 of 50 items</p>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="edit-evaluation-form-alert-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
<div class="max-h-full overflow-hidden ti-modal-content-alert w-full">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
แจ้งเตือน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#edit-evaluation-form-alert-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="ti-modal-body ">
<p class="mt-1 text-gray-800 dark:text-white/70">
ยืนยันการบันทึกข้อมูลหรือไม่
</p>
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay="#edit-evaluation-form-add-table-modal-edit">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-form-alert-modal" (click)="addUser();showSuccess()">
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div id="edit-evaluation-form-alert-delete-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
<div class="max-h-full overflow-hidden ti-modal-content-alert w-full">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
แจ้งเตือน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#edit-evaluation-form-alert-delete-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="ti-modal-body ">
<p class="mt-1 text-gray-800 dark:text-white/70">
ยืนยันการลบข้อมูลหรือไม่!
</p>
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay="#edit-evaluation-form-table-modal-edit">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-form-alert-delete-modal" (click)="addUser();showSuccessDelete()">
ลบข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
.button-clear {
position: absolute;
top: 96px;
z-index: 1;
right: 41vw;
}
.button-help {
position: absolute;
top: 0px;
z-index: 1;
right: 0vw;
margin: 4.2rem;
margin-right: 10px; /* เพิ่มใหม่ 12/16*/
}
table.ti-custom-table th {
height: 60px;
}
table.ti-custom-table thead {
height: 50px;
}
table.ti-custom-table thead th span {
font-size: 12px;
font-weight: bold;
}
a.custom-link {
padding: 10px 40px; /* ปรับ padding ให้เพิ่มขนาด */
}
/* สไตล์ของแถบเมนู */
.nav-tabs {
display: flex;
width: 100%;
cursor: pointer;
margin-bottom: 10px;
height: 20%;
}
.nav-item {
list-style: none;
margin-right: 10px; /* ช่องว่างระหว่างเมนู */
}
.nav-link {
text-decoration: none;
padding: 10px 20px;
display: inline-block;
font-size: large;
border-width: 2px 2px 0px 2px;
border-style: solid;
border-color: #ccc;
border-radius: 5px 5px 0px 0px;
}
.nav-link:hover {
background-color: #f0f0f0; /* เปลี่ยนสีเมื่อ hover */
}
.nav-link.active {
color: #ffffff; /* สีตัวอักษรในสถานะ active */
font-size: large;
border-bottom: 3.5px solid rgb(var(--color-primary)); /* เส้นใต้ */
background-color: rgb(var(--color-primary));
border-width: 2px 2px 0px 2px;
border-style: solid;
border-color: rgb(var(--color-primary));
border-radius: 5px 5px 0px 0px;
}
.tab-content {
margin-top: 20px;
}
.tab-pane.active {
display: block;
}
.nav-item-text {
list-style: none;
margin-right: 10px; /* ช่องว่างระหว่างเมนู */
}
.nav-link-text {
text-decoration: none;
display: inline-block;
font-size: large;
color: #569bf5;
border-bottom: 2px solid #569bf5;
line-height: 0.8;
}
.ti-pagination .page-link.active {
background-color: #569bf5;
color: white;
border-radius: 50%;
padding: 8px 12px;
}
.box-body{
padding: 0rem;
}
.page{
min-height: 0vh;
}
.ti-modal {
overflow: hidden;
overflow-y: auto;
}
.header-title-type {
width: 100%;
min-height: 50px; /* ใช้ min-height เพื่อให้มีความยืดหยุ่น */
// margin-top: 50px;
// margin-bottom: 16px;
justify-content: space-between; /* จัดเรียงองค์ประกอบภายใน */
align-items: center; /* จัดกลางแนวตั้ง */
padding-top: 50px;
padding-bottom: 1rem;
}
.bg-input-readonly{
background-color: rgb(241 245 249);
}
.body-content{
overflow-y: auto;
}
.body-content-table{
margin-top: 20px;
margin-bottom: 20px;
}
.ti-switch:checked {
background-color: #28a745; /* เปลี่ยนสีพื้นหลังเป็นสีเขียว */
}
td span {
display: inline-block; /*span มีลักษณะเป็นกรอบ */
padding: 5px 10px;
border: 1px solid black;
border-radius: 10px;
background-color: #f9f9f9;
width: 80px;
height: 40px;
}
.ti-modal-content-alert{
width: 35%; /* ความกว้างที่คุณต้องการ */
position: absolute; /* ทำให้สามารถจัดตำแหน่งได้ */
top: 50%; /* ให้อยู่กลางในแนวตั้ง */
left: 50%; /* ให้อยู่กลางในแนวนอน */
transform: translate(-50%, -50%); /* เคลื่อนที่ modal กลับมาให้ตรงกลาง */
background-color: #ffffff;
}
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
export interface dataModel {
check: boolean,
code: string,
headname: string,
type: string,
weight: string,
}
@Component({
selector: 'app-edit-evaluation-form',
templateUrl: './edit-evaluation-form.component.html',
styleUrls: ['./edit-evaluation-form.component.scss']
})
export class EditEvaluationFormComponent {
@Input() pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'รอบการประเมิน', 'กำหนดฟอร์มเอกสาร','เเก้ไขฟอร์มตามรอบการประเมิน'];
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
@Output() sendGroupShow: EventEmitter<string> = new EventEmitter<string>();
activeTab: string = 'tab1';
hsSwitchChecked: { [key: string]: boolean };
currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1);
search = ""
numDataListChecked = 0
isDataListChecked = false
isDataListCheckedAll = false
dataList: dataModel[] = [
{
check: false,
code: "HS-01",
headname: "C1 CUSTOMER ORIENTED (SQCDME)",
type: "HOSHIN",
weight: "5.0",
},
{
check: false,
code: "HS-02",
headname: "C2 MANUFACTURING OPTIMIZATION",
type: "HOSHIN",
weight: "3.0",
},
{
check: false,
code: "HS-03",
headname: "C3 INCREASE EMPLOYEE ENGAGEMENT",
type: "HOSHIN",
weight: "3.0",
},
{
check: false,
code: "HS-04",
headname: "C4 HEALTHY FINANCIAL",
type: "HOSHIN",
weight: "3.0",
},
{
check: false,
code: "HS-05",
headname: "C5 RISK MANAGEMENT (TAXATION)",
type: "HOSHIN",
weight: "1.0",
},
{
check: false,
code: "KP-01",
headname: "ประสาทงานกับวิทยากร ผู้เข้ารับการอบรมทั้งภายในเเละภายนอกตามเเผนการฝึกอบรมพัฒนา",
type: "KPI",
weight: "10.0",
},
]
dataSelect: dataModel = {
check: false,
code: "",
headname: "",
type: "",
weight: "",
}
constructor(private toastr: ToastrService, private cdr: ChangeDetectorRef) {
this.hsSwitchChecked = {
'F6702-01': false,
'F6702-02': false,
'F6702-03': false,
'F6702-04': false,
'F6702-06': false
};
}
dataListSelect(data?: dataModel) {
this.dataSelect = data || {
check: false,
code: "",
headname: "",
type: "",
weight: "",
}
this.cdr.detectChanges()
}
dataListFilter() {
return this.dataList.filter(x => {
const match = x.code.includes(this.search) || x.headname.includes(this.search);
if (!match) x.check = false;
return match;
});
}
dataListCheck() {
const dataCheck = this.dataListFilter();
this.isDataListChecked = dataCheck.some(x => x.check);
this.isDataListCheckedAll = dataCheck.length ? dataCheck.every(x => x.check) : false;
this.numDataListChecked = dataCheck.filter(x => x.check).length;
}
dataListCheckAll() {
const selectAll = this.isDataListCheckedAll;
this.dataList.forEach(x => x.check = selectAll);
this.dataListCheck();
}
searchChange() {
this.currentPage = 1;
const filteredData = this.dataListFilter();
this.page = Array.from({ length: Math.ceil(filteredData.length / 10) }, (_, i) => i + 1);
this.dataListCheck();
}
// ฟังก์ชันในการเปลี่ยนแท็บ
changeTab(tab: { id: string, text: string }) {
this.sendPathTitle.emit(['การประเมินจัดการประสิทธิภาพ', 'รอบการประเมิน', 'กำหนดฟอร์มเอกสาร', tab.text]);
this.activeTab = tab.id;
}
onBack() {
this.sendGroupShow.emit('1'); // เปลี่ยนกลับไปหน้า 1
}
// การจัดการการเปิดปิด 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 อื่นยังเปิดอยู่หรือไม่
}
// ฟังก์ชัน toggle checkbox
isChecked: boolean = false; // ใช้สำหรับตรวจสอบสถานะของ checkbox
toggleCheckbox() {
this.isChecked = !this.isChecked; // สลับสถานะ
}
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
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',
});
}
showSuccessDelete() {
this.toastr.success('ลบข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
}
<app-page-header [pathTitle]="pathTitle"></app-page-header>
<div class="bg-card-white">
</div>
<div class="block-main-content">
<div class="font-size-18px font-weight-700 pt-1.5rem text-primary px-2rem">
รอบการประเมิน
</div>
<div class="page pt-0.75rem">
<div class="border-b border-gray-200 dark:border-white/10 px-2rem">
<nav class="-mb-0.5 flex space-x-6 rtl:space-x-reverse">
<a class="text-base font-medium hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 dark:text-white/70 hover:text-secondary active"
href="javascript:void(0);" id="underline-item-1" data-hs-tab="#underline-1"
aria-controls="underline-1"
(click)="activeTab='underline-1';pathTitle = ['การประเมินจัดการประสิทธิภาพ','การจัดการประเมิณ','รอบการประเมิน']">
จัดกลุ่มการประเมิน
</a>
<a class="text-base font-medium hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 dark:text-white/70 hover:text-secondary"
href="javascript:void(0);" id="underline-item-2" data-hs-tab="#underline-2"
aria-controls="underline-2"
(click)="activeTab='underline-2';pathTitle = ['การประเมินจัดการประสิทธิภาพ','การจัดการประเมิณ','กำหนดฟอร์มเอกสาร']">
กำหนดฟอร์มเอกสาร
</a>
</nav>
</div>
<div class="mt-3 px-2rem">
<div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1"
*ngIf="activeTab === 'underline-1'">
-----
</div>
<div id="underline-2" role="tabpanel" aria-labelledby="underline-item-2"
*ngIf="activeTab === 'underline-2'">
<app-document-form *ngIf="groupShow=='1'" [pathTitle]="pathTitle"
(sendPathTitle)="pathTitle=$event" (sendGroupShow)="groupShow=$event"></app-document-form>
<app-edit-evaluation-form *ngIf="groupShow=='2'" [pathTitle]="pathTitle"
(sendPathTitle)="pathTitle=$event" (sendGroupShow)="groupShow=$event"></app-edit-evaluation-form>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { Component } from '@angular/core';
@Component({
selector: 'app-evaluation-cycle-performance',
templateUrl: './evaluation-cycle-performance.component.html',
styleUrls: ['./evaluation-cycle-performance.component.scss']
})
export class EvaluationCyclePerformanceComponent {
pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'รอบการประเมิน','รอบการประเมิน']
activeTab: string = 'underline-1';
groupShow = '1'
}
......@@ -141,7 +141,7 @@ export class NavService implements OnDestroy {
{ path: '', title: 'ทะเบียนเกรด', type: 'link' },
{ path: '', title: 'ปัจจัยการประเมินผล', type: 'link' },
{ path: '/assessment-management', title: 'การจัดการการประเมิน', type: 'link' },
{ path: '', title: 'รอบการประเมิน', type: 'link' },
{ path: '/evaluation-cycle-performance', title: 'รอบการประเมิน', type: 'link' },
{ path: '', title: 'การตั่งค่า', type: 'link' },
{ path: '', title: 'รายงาน', type: 'link' },
],
......
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