Commit 2af7bb7c by Nattana Chaiyamat

Merge branch 'DEV' of https://mygit.myhr.co.th/angular/myAppraisal into DEV

# Conflicts:
#	src/app/components/competency-assessment/evaluation-cycle-manager/evaluation-cycle/evaluation-cycle.component.html
#	src/app/components/performance-management-evaluation/evaluation-cycle-performance/management-evaluation-cycle/management-evaluation-cycle.component.html
#	src/app/components/performance-management-evaluation/evaluation-cycle-performance/management-evaluation-cycle/management-evaluation-cycle.component.ts
parents 92361e77 1f1f5e05
...@@ -315,6 +315,6 @@ ...@@ -315,6 +315,6 @@
</div> </div>
<ng-container *ngIf="showFrom" > <ng-container *ngIf="showFrom" >
<app-edit-define-document-form [evaluationRound]="evaluationRound" (showFrom)="showFrom=$event"></app-edit-define-document-form> <!-- <app-edit-define-document-form [evaluationRound]="evaluationRound" (showFrom)="showFrom=$event"></app-edit-define-document-form> -->
</ng-container> </ng-container>
...@@ -101,7 +101,8 @@ a.custom-link { ...@@ -101,7 +101,8 @@ a.custom-link {
} }
.ti-modal { .ti-modal {
overflow: auto; overflow: hidden;
overflow-y: auto;
} }
.header-title-type { .header-title-type {
width: 100%; width: 100%;
...@@ -115,4 +116,31 @@ a.custom-link { ...@@ -115,4 +116,31 @@ a.custom-link {
} }
.bg-input-readonly{ .bg-input-readonly{
background-color: rgb(241 245 249); background-color: rgb(241 245 249);
} }
\ No newline at end of file .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{
width: 35%; /* ความกว้างที่คุณต้องการ */
position: absolute; /* ทำให้สามารถจัดตำแหน่งได้ */
top: 50%; /* ให้อยู่กลางในแนวตั้ง */
left: 50%; /* ให้อยู่กลางในแนวนอน */
transform: translate(-50%, -50%); /* เคลื่อนที่ modal กลับมาให้ตรงกลาง */
background-color: #ffffff;
}
...@@ -391,8 +391,10 @@ ...@@ -391,8 +391,10 @@
</div> </div>
</div> </div>
<div class="ti-modal-body "> <div class="ti-modal-body ">
<app-edit-evaluation-form *ngIf="evaluationRoundId" <!-- <app-edit-evaluation-form *ngIf="evaluationRoundId"
[evaluationRoundId]="evaluationRoundId"></app-edit-evaluation-form> [evaluationRoundId]="evaluationRoundId"></app-edit-evaluation-form>> -->
<app-edit-define-document-form *ngIf="evaluationRoundId"
[evaluationRoundId]="evaluationRoundId"></app-edit-define-document-form>
</div> </div>
</div> </div>
</div> </div>
...@@ -465,7 +467,7 @@ ...@@ -465,7 +467,7 @@
<tbody *ngIf="!pl.loading&&plListFilter().length"> <tbody *ngIf="!pl.loading&&plListFilter().length">
<tr <tr
*ngFor="let item of plListFilter() | slice:((modal.currentPage-1) * 10) : (((modal.currentPage-1) * 10) + 10);let i = index" *ngFor="let item of plListFilter() | slice:((modal.currentPage-1) * 10) : (((modal.currentPage-1) * 10) + 10);let i = index"
class="cursor-pointer" data-hs-overlay="#evaluation-cycle-modal" (click)="selectPl(item)" > class="cursor-pointer" data-hs-overlay="#evaluation-cycle-modal" (click)="selectPl(item)">
<td class="flex justify-center"> <td class="flex justify-center">
{{((modal.currentPage-1) * 10)+(i+1)}} {{((modal.currentPage-1) * 10)+(i+1)}}
</td> </td>
......
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { AppraisalRoundModel, MyAppraisalRoundModel } from 'src/app/shared/model/appraisal-aps.model'; import { AppraisalRoundModel, MyAppraisalRoundModel } from 'src/app/shared/model/appraisal-aps.model';
import { AppraisalFormModel } from 'src/app/shared/model/appraisal-form.model';
import { AppraisalModel, MyAppraisalModel } from 'src/app/shared/model/appraisal.model'; import { AppraisalModel, MyAppraisalModel } from 'src/app/shared/model/appraisal.model';
import { EvaluationCycleModel, MyEvaluationCycleModel } from 'src/app/shared/model/evaluation-cycle.model'; import { EvaluationCycleModel, MyEvaluationCycleModel } from 'src/app/shared/model/evaluation-cycle.model';
import { EvaluationModal } from 'src/app/shared/model/evaluation-form.modal'; import { EvaluationModal } from 'src/app/shared/model/evaluation-form.modal';
......
...@@ -139,6 +139,8 @@ ...@@ -139,6 +139,8 @@
data-hs-overlay="#management-evaluation-cycle-modal"></i> data-hs-overlay="#management-evaluation-cycle-modal"></i>
<i class="ti ti-user cursor-pointer i-gray fs-l px-1" <i class="ti ti-user cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#management-evaluation-cycle-page-modal"></i> data-hs-overlay="#management-evaluation-cycle-page-modal"></i>
<i class="ti ti-user cursor-pointer i-gray fs-l px-1" data-hs-overlay="#evaluation-cycle-person-modal"
(click)="openModal('evaluation-cycle-person-modal',item.data.pmsEvaluationRoundId)"></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="modalStatus='delete';setData(item.data)" <i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="modalStatus='delete';setData(item.data)"
data-hs-overlay="#management-evaluation-cycle-alert-modal"></i> data-hs-overlay="#management-evaluation-cycle-alert-modal"></i>
<!-- <span class="badge text-white m-1" *ngIf="item.data.statusCode.code!='1'" <!-- <span class="badge text-white m-1" *ngIf="item.data.statusCode.code!='1'"
...@@ -301,8 +303,7 @@ ...@@ -301,8 +303,7 @@
data-hs-overlay="#management-evaluation-cycle-modal"> data-hs-overlay="#management-evaluation-cycle-modal">
ย้อนกลับ ย้อนกลับ
</button> </button>
<button type="button" class="ti-btn ti-btn-success" <button type="button" class="ti-btn ti-btn-success" data-hs-overlay="#management-evaluation-cycle-alert-modal"
data-hs-overlay="#management-evaluation-cycle-alert-modal"
[class.ti-btn-disabled]="!dataSelect.pmsEvaluationRoundId||!dataSelect.tdesc||!dataSelect.apsyear||!dataSelect.apsPeriodStart||!dataSelect.apsPeriodEnd" [class.ti-btn-disabled]="!dataSelect.pmsEvaluationRoundId||!dataSelect.tdesc||!dataSelect.apsyear||!dataSelect.apsPeriodStart||!dataSelect.apsPeriodEnd"
[disabled]="!dataSelect.pmsEvaluationRoundId||!dataSelect.tdesc||!dataSelect.apsyear||!dataSelect.apsPeriodStart||!dataSelect.apsPeriodEnd"> [disabled]="!dataSelect.pmsEvaluationRoundId||!dataSelect.tdesc||!dataSelect.apsyear||!dataSelect.apsPeriodStart||!dataSelect.apsPeriodEnd">
บันทึกข้อมูล บันทึกข้อมูล
...@@ -346,7 +347,6 @@ ...@@ -346,7 +347,6 @@
ยืนยันการลบข้อมูลหรือไม่ ยืนยันการลบข้อมูลหรือไม่
</ng-container> </ng-container>
</p> </p>
<div class="flex justify-end mt-2rem mb-1rem"> <div class="flex justify-end mt-2rem mb-1rem">
<ng-container *ngIf="modalStatus=='add'||modalStatus=='edit'"> <ng-container *ngIf="modalStatus=='add'||modalStatus=='edit'">
<button type="button" <button type="button"
...@@ -379,20 +379,27 @@ ...@@ -379,20 +379,27 @@
<div id="management-evaluation-cycle-page-modal" class="hs-overlay hidden ti-modal"> <div id="management-evaluation-cycle-page-modal" 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="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 w-full rounded-sm shadow-sm"> <div class="max-h-full overflow-hidden ti-modal-content w-full rounded-sm shadow-sm">
<div class="ti-modal-header"> <div id="evaluation-cycle-person-modal" class="hs-overlay hidden ti-modal">
<h3 class="text-xxl font-bold text-primary"> <div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out m-3 lg:!mx-auto " style="min-width: 70%;">
เเก้ไขเเบบฟอร์มตามรอบการประเมิน <div class="max-h-full overflow-hidden ti-modal-content w-full">
</h3> <div class="ti-modal-header">
<div class="flex justify-end"> <h3 class="text-xxl font-bold text-primary">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger" เเก้ไขเเบบฟอร์มตามรอบการประเมิน
data-hs-overlay="#management-evaluation-cycle-page-modal"> </h3>
<span class="sr-only">Close</span> <div class="flex justify-end">
<i class="ti ti-circle-x fs-xxl"></i> <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
</button> data-hs-overlay="#management-evaluation-cycle-page-modal" (click)="evaluationRoundId=''">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="ti-modal-body "> <div class="ti-modal-body ">
<app-edit-evaluation-form></app-edit-evaluation-form> <app-edit-evaluation-form *ngIf="evaluationRoundId"
[evaluationRoundId]="evaluationRoundId"></app-edit-evaluation-form>
</div> </div>
</div> </div>
</div> </div>
...@@ -463,7 +470,7 @@ ...@@ -463,7 +470,7 @@
<tbody *ngIf="!pl.loading&&plListFilter().length"> <tbody *ngIf="!pl.loading&&plListFilter().length">
<tr <tr
*ngFor="let item of plListFilter() | slice:((modal.currentPage-1) * 10) : (((modal.currentPage-1) * 10) + 10);let i = index" *ngFor="let item of plListFilter() | slice:((modal.currentPage-1) * 10) : (((modal.currentPage-1) * 10) + 10);let i = index"
class="cursor-pointer" data-hs-overlay="#management-evaluation-cycle-modal" (click)="selectPl(item)" > class="cursor-pointer" data-hs-overlay="#management-evaluation-cycle-modal" (click)="selectPl(item)">
<td class="flex justify-center"> <td class="flex justify-center">
{{((modal.currentPage-1) * 10)+(i+1)}} {{((modal.currentPage-1) * 10)+(i+1)}}
</td> </td>
......
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, Output, Renderer2 } from '@angular/core';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { PLModel, MyPLModel } from 'src/app/shared/model/pl.model'; import { PLModel, MyPLModel } from 'src/app/shared/model/pl.model';
import { MyPmsMasfromEvaluationModel, PmsMasfromEvaluationModel } from 'src/app/shared/model/pms-masfrom-evaluation.model'; import { MyPmsMasfromEvaluationModel, PmsMasfromEvaluationModel } from 'src/app/shared/model/pms-masfrom-evaluation.model';
...@@ -15,6 +15,7 @@ export interface DataModal { ...@@ -15,6 +15,7 @@ export interface DataModal {
styleUrls: ['./management-evaluation-cycle.component.scss'] styleUrls: ['./management-evaluation-cycle.component.scss']
}) })
export class ManagementCycleComponent { export class ManagementCycleComponent {
@Output() evaluationRoundIdChange = new EventEmitter<string>();
apsPeriodStart: string = ''; apsPeriodStart: string = '';
apsPeriodEnd: string = ''; apsPeriodEnd: string = '';
...@@ -30,18 +31,19 @@ export class ManagementCycleComponent { ...@@ -30,18 +31,19 @@ export class ManagementCycleComponent {
isDataListChecked = false isDataListChecked = false
isDataListCheckedAll = false isDataListCheckedAll = false
numDataListChecked = 0 numDataListChecked = 0
modal: DataModal = { modal: DataModal = {
search: "", search: "",
currentPage: 1, currentPage: 1,
page: Array.from({ length: 1 }, (_, i) => i + 1) page: Array.from({ length: 1 }, (_, i) => i + 1)
} }
pl: { loading: boolean, selectList: PLModel[], selectIndex: number, dataList: PLModel[] } = { loading: false, selectList: [new MyPLModel()], selectIndex: -1, dataList: [] } pl: { loading: boolean, selectList: PLModel[], selectIndex: number, dataList: PLModel[] } = { loading: false, selectList: [new MyPLModel()], selectIndex: -1, dataList: [] }
evaluationRoundId = ''
private unlisten!: () => void;
constructor(private pmsMasfromEvaluationCycleService: PmsMasfromEvaluationCycleService, constructor(private pmsMasfromEvaluationCycleService: PmsMasfromEvaluationCycleService,
private toastr: ToastrService, private toastr: ToastrService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private pLService: PLService private pLService: PLService,
private renderer: Renderer2
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
...@@ -81,6 +83,11 @@ export class ManagementCycleComponent { ...@@ -81,6 +83,11 @@ export class ManagementCycleComponent {
if (this.pl.selectIndex === this.pl.selectList.length - 1) { if (this.pl.selectIndex === this.pl.selectList.length - 1) {
this.pl.selectList.push(new MyPLModel()); this.pl.selectList.push(new MyPLModel());
} }
this.unlisten = this.renderer.listen('document', 'keydown', (event) => {
if (event.key === 'Escape') {
this.evaluationRoundId = ''
}
});
} }
getPmsMasfromEvaluationCycleList() { getPmsMasfromEvaluationCycleList() {
...@@ -198,6 +205,19 @@ export class ManagementCycleComponent { ...@@ -198,6 +205,19 @@ export class ManagementCycleComponent {
this.modal.currentPage = 1 this.modal.currentPage = 1
this.modal.page = Array.from({ length: Math.ceil(dataList.length / 10) }, (_, i) => i + 1); this.modal.page = Array.from({ length: Math.ceil(dataList.length / 10) }, (_, i) => i + 1);
} }
openModal(id: string, evaluationRoundId: string) {
this.evaluationRoundId = ''
if (id == 'evaluation-cycle-person-modal') {
this.evaluationRoundId = evaluationRoundId
this.evaluationRoundIdChange.emit(evaluationRoundId)
setTimeout(() => {
document.getElementById(id)?.classList.add('open');
document.getElementById(id)?.classList.remove('hidden');
document.getElementById(id)?.setAttribute('aria-overlay', 'false');
}, 10);
}
}
} }
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