Commit 7ec9f7e1 by Nakarin Luankla

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

parents ab11b77f 6bdbd384
......@@ -103,7 +103,7 @@
</tbody>
<tbody *ngIf="!bu2ListLoading&&filterBu2Table().length">
<tr
*ngFor="let item of filterBu2Table() | slice:((bu2Table.currentPage-1) * 10) : (((bu2Table.currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of filterBu2Table() | slice:((bu2Table.currentPage-1) * bu2Table.pageSize) : (((bu2Table.currentPage-1) * bu2Table.pageSize) + bu2Table.pageSize);let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.bu2id}}"
[(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
......@@ -382,11 +382,11 @@
</tbody>
<tbody *ngIf="filterBu1Modal().length">
<ng-container *ngIf="currentModal=='add'">
<tr *ngFor="let item of filterBu1Modal() | slice:((bu1Modal.currentPage-1) * 10) : (((bu1Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu1Modal() | slice:((bu1Modal.currentPage-1) * bu1Modal.pageSize) : (((bu1Modal.currentPage-1) * bu1Modal.pageSize) + bu1Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu1(item)"
data-hs-overlay="#department-list-modal-add">
<td class="flex justify-center">
{{((bu1Modal.currentPage-1) * 10)+(i+1)}}
{{((bu1Modal.currentPage-1) * bu1Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu1id}}</td>
<td>{{item.tdesc}}</td>
......@@ -394,11 +394,11 @@
</tr>
</ng-container>
<ng-container *ngIf="currentModal=='edit'">
<tr *ngFor="let item of filterBu1Modal() | slice:((bu1Modal.currentPage-1) * 10) : (((bu1Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu1Modal() | slice:((bu1Modal.currentPage-1) * bu1Modal.pageSize) : (((bu1Modal.currentPage-1) * bu1Modal.pageSize) + bu1Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu1(item)"
data-hs-overlay="#department-list-modal-edit">
<td class="flex justify-center">
{{((bu1Modal.currentPage-1) * 10)+(i+1)}}
{{((bu1Modal.currentPage-1) * bu1Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu1id}}</td>
<td>{{item.tdesc}}</td>
......
......@@ -103,7 +103,7 @@
</tbody>
<tbody *ngIf="!bu1ListLoading&&bu1ListFilter().length">
<tr
*ngFor="let item of bu1ListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of bu1ListFilter() | slice:((currentPage-1) * pageSize) : (((currentPage-1) * pageSize) + pageSize);let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.bu1id}}"
[(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
......
......@@ -105,7 +105,7 @@
</tbody>
<tbody *ngIf="!bu3ListLoading&&filterBu3Table().length">
<tr
*ngFor="let item of filterBu3Table() | slice:((bu3Table.currentPage-1) * 10) : (((bu3Table.currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of filterBu3Table() | slice:((bu3Table.currentPage-1) * bu3Table.pageSize) : (((bu3Table.currentPage-1) * bu3Table.pageSize) + bu3Table.pageSize);let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.bu3id}}"
[(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
......@@ -398,11 +398,11 @@
</tbody>
<tbody *ngIf="filterBu2Modal().length">
<ng-container *ngIf="currentModal=='add'">
<tr *ngFor="let item of filterBu2Modal() | slice:((bu2Modal.currentPage-1) * 10) : (((bu2Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu2Modal() | slice:((bu2Modal.currentPage-1) * bu2Modal.pageSize) : (((bu2Modal.currentPage-1) * bu2Modal.pageSize) + bu2Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu2(item)"
data-hs-overlay="#section-registration-modal-add">
<td class="flex justify-center">
{{((bu2Modal.currentPage-1) * 10)+(i+1)}}
{{((bu2Modal.currentPage-1) * bu2Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu2id}}</td>
<td>{{item.tdesc}}</td>
......@@ -410,11 +410,11 @@
</tr>
</ng-container>
<ng-container *ngIf="currentModal=='edit'">
<tr *ngFor="let item of filterBu2Modal() | slice:((bu2Modal.currentPage-1) * 10) : (((bu2Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu2Modal() | slice:((bu2Modal.currentPage-1) * bu2Modal.pageSize) : (((bu2Modal.currentPage-1) * bu2Modal.pageSize) + bu2Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu2(item)"
data-hs-overlay="#section-registration-modal-edit">
<td class="flex justify-center">
{{((bu2Modal.currentPage-1) * 10)+(i+1)}}
{{((bu2Modal.currentPage-1) * bu2Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu2id}}</td>
<td>{{item.tdesc}}</td>
......
......@@ -104,7 +104,7 @@
</tbody>
<tbody *ngIf="!bu7ListLoading&&filterBu7Table().length">
<tr
*ngFor="let item of filterBu7Table() | slice:((bu7Table.currentPage-1) * 10) : (((bu7Table.currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of filterBu7Table() | slice:((bu7Table.currentPage-1) * bu7Table.pageSize) : (((bu7Table.currentPage-1) * bu7Table.pageSize) + bu7Table.pageSize);let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.bu7id}}"
[(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
......@@ -398,11 +398,11 @@
</tbody>
<tbody *ngIf="filterBu6Modal().length">
<ng-container *ngIf="currentModal=='add'">
<tr *ngFor="let item of filterBu6Modal() | slice:((bu6Modal.currentPage-1) * 10) : (((bu6Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu6Modal() | slice:((bu6Modal.currentPage-1) * bu6Modal.pageSize) : (((bu6Modal.currentPage-1) * bu6Modal.pageSize) + bu6Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu6(item)"
data-hs-overlay="#sub-department-four-modal-add">
<td class="flex justify-center">
{{((bu6Modal.currentPage-1) * 10)+(i+1)}}
{{((bu6Modal.currentPage-1) * bu6Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu6id}}</td>
<td>{{item.tdesc}}</td>
......@@ -410,11 +410,11 @@
</tr>
</ng-container>
<ng-container *ngIf="currentModal=='edit'">
<tr *ngFor="let item of filterBu6Modal() | slice:((bu6Modal.currentPage-1) * 10) : (((bu6Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu6Modal() | slice:((bu6Modal.currentPage-1) * bu6Modal.pageSize) : (((bu6Modal.currentPage-1) * bu6Modal.pageSize) + bu6Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu6(item)"
data-hs-overlay="#sub-department-four-modal-edit">
<td class="flex justify-center">
{{((bu6Modal.currentPage-1) * 10)+(i+1)}}
{{((bu6Modal.currentPage-1) * bu6Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu6id}}</td>
<td>{{item.tdesc}}</td>
......
......@@ -104,7 +104,7 @@
</tbody>
<tbody *ngIf="!bu4ListLoading&&filterBu4Table().length">
<tr
*ngFor="let item of filterBu4Table() | slice:((bu4Table.currentPage-1) * 10) : (((bu4Table.currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of filterBu4Table() | slice:((bu4Table.currentPage-1) * bu4Table.pageSize) : (((bu4Table.currentPage-1) * bu4Table.pageSize) + bu4Table.pageSize);let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.bu4id}}"
[(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
......@@ -400,11 +400,11 @@
</tbody>
<tbody *ngIf="filterBu3Modal().length">
<ng-container *ngIf="currentModal=='add'">
<tr *ngFor="let item of filterBu3Modal() | slice:((bu3Modal.currentPage-1) * 10) : (((bu3Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu3Modal() | slice:((bu3Modal.currentPage-1) * bu3Modal.pageSize) : (((bu3Modal.currentPage-1) * bu3Modal.pageSize) + bu3Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu3(item)"
data-hs-overlay="#sub-department-one-modal-add">
<td class="flex justify-center">
{{((bu3Modal.currentPage-1) * 10)+(i+1)}}
{{((bu3Modal.currentPage-1) * bu3Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu3id}}</td>
<td>{{item.tdesc}}</td>
......@@ -412,11 +412,11 @@
</tr>
</ng-container>
<ng-container *ngIf="currentModal=='edit'">
<tr *ngFor="let item of filterBu3Modal() | slice:((bu3Modal.currentPage-1) * 10) : (((bu3Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu3Modal() | slice:((bu3Modal.currentPage-1) * bu3Modal.pageSize) : (((bu3Modal.currentPage-1) * bu3Modal.pageSize) + bu3Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu3(item)"
data-hs-overlay="#sub-department-one-modal-edit">
<td class="flex justify-center">
{{((bu3Modal.currentPage-1) * 10)+(i+1)}}
{{((bu3Modal.currentPage-1) * bu3Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu3id}}</td>
<td>{{item.tdesc}}</td>
......
......@@ -104,7 +104,7 @@
</tbody>
<tbody *ngIf="!bu6ListLoading&&filterBu6Table().length">
<tr
*ngFor="let item of filterBu6Table() | slice:((bu6Table.currentPage-1) * 10) : (((bu6Table.currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of filterBu6Table() | slice:((bu6Table.currentPage-1) * bu6Table.pageSize) : (((bu6Table.currentPage-1) * bu6Table.pageSize) + bu6Table.pageSize);let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.bu6id}}"
[(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
......@@ -399,11 +399,11 @@
</tbody>
<tbody *ngIf="filterBu5Modal().length">
<ng-container *ngIf="currentModal=='add'">
<tr *ngFor="let item of filterBu5Modal() | slice:((bu5Modal.currentPage-1) * 10) : (((bu5Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu5Modal() | slice:((bu5Modal.currentPage-1) * bu5Modal.pageSize) : (((bu5Modal.currentPage-1) * bu5Modal.pageSize) + bu5Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu5(item)"
data-hs-overlay="#sub-department-three-modal-add">
<td class="flex justify-center">
{{((bu5Modal.currentPage-1) * 10)+(i+1)}}
{{((bu5Modal.currentPage-1) * bu5Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu5id}}</td>
<td>{{item.tdesc}}</td>
......@@ -411,11 +411,11 @@
</tr>
</ng-container>
<ng-container *ngIf="currentModal=='edit'">
<tr *ngFor="let item of filterBu5Modal() | slice:((bu5Modal.currentPage-1) * 10) : (((bu5Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu5Modal() | slice:((bu5Modal.currentPage-1) * bu5Modal.pageSize) : (((bu5Modal.currentPage-1) * bu5Modal.pageSize) + bu5Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu5(item)"
data-hs-overlay="#sub-department-three-modal-edit">
<td class="flex justify-center">
{{((bu5Modal.currentPage-1) * 10)+(i+1)}}
{{((bu5Modal.currentPage-1) * bu5Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu5id}}</td>
<td>{{item.tdesc}}</td>
......
......@@ -103,7 +103,7 @@
</tbody>
<tbody *ngIf="!bu5ListLoading&&filterBu5Table().length">
<tr
*ngFor="let item of filterBu5Table() | slice:((bu5Table.currentPage-1) * 10) : (((bu5Table.currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of filterBu5Table() | slice:((bu5Table.currentPage-1) * bu5Table.pageSize) : (((bu5Table.currentPage-1) * bu5Table.pageSize) + bu5Table.pageSize);let i = index">
<td td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.bu5id}}"
[(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
......@@ -398,11 +398,11 @@
</tbody>
<tbody *ngIf="filterBu4Modal().length">
<ng-container *ngIf="currentModal=='add'">
<tr *ngFor="let item of filterBu4Modal() | slice:((bu4Modal.currentPage-1) * 10) : (((bu4Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu4Modal() | slice:((bu4Modal.currentPage-1) * bu4Modal.pageSize) : (((bu4Modal.currentPage-1) * bu4Modal.pageSize) + bu4Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu4(item)"
data-hs-overlay="#sub-department-two-modal-add">
<td class="flex justify-center">
{{((bu4Modal.currentPage-1) * 10)+(i+1)}}
{{((bu4Modal.currentPage-1) * bu4Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu4id}}</td>
<td>{{item.tdesc}}</td>
......@@ -410,11 +410,11 @@
</tr>
</ng-container>
<ng-container *ngIf="currentModal=='edit'">
<tr *ngFor="let item of filterBu4Modal() | slice:((bu4Modal.currentPage-1) * 10) : (((bu4Modal.currentPage-1) * 10) + 10);let i = index"
<tr *ngFor="let item of filterBu4Modal() | slice:((bu4Modal.currentPage-1) * bu4Modal.pageSize) : (((bu4Modal.currentPage-1) * bu4Modal.pageSize) + bu4Modal.pageSize);let i = index"
class="cursor-pointer" (click)="selectBu4(item)"
data-hs-overlay="#sub-department-two-modal-edit">
<td class="flex justify-center">
{{((bu4Modal.currentPage-1) * 10)+(i+1)}}
{{((bu4Modal.currentPage-1) * bu4Modal.pageSize)+(i+1)}}
</td>
<td>{{item.bu4id}}</td>
<td>{{item.tdesc}}</td>
......
......@@ -96,7 +96,7 @@
</tbody>
<tbody *ngIf="!dataLoading&&dataListFilter().length">
<tr
*ngFor="let item of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of dataListFilter() | slice:((currentPage-1) * pageSize) : (((currentPage-1) * pageSize) + pageSize);let i = index">
<td class="text-center">
<input *ngIf="item.data.code!='100'" type="checkbox" class="ti-form-checkbox cursor-pointer"
id="checkbox-{{item.data.code}}" [(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
......
......@@ -43,6 +43,7 @@ export interface DataModal {
search: string,
currentPage: number,
page: number[]
pageSize: number
}
@Component({
selector: 'app-sub-employee-registration',
......@@ -54,6 +55,7 @@ export class SubEmployeeRegistrationComponent {
employee: DataEmployee = { loading: false, select: new MyEmployeeModel({}), dataList: [] }
currentPage = 1
pageSize = 10
page = Array.from({ length: 1 }, (_, i) => i + 1);
search = ""
modalType: 'add' | 'update' | 'delete' | 'deleteGroup' = 'add'
......@@ -61,7 +63,8 @@ export class SubEmployeeRegistrationComponent {
modal: DataModal = {
search: "",
currentPage: 1,
page: Array.from({ length: 1 }, (_, i) => i + 1)
page: Array.from({ length: 1 }, (_, i) => i + 1),
pageSize: 10
}
numDataListChecked = 0
......@@ -464,8 +467,7 @@ export class SubEmployeeRegistrationComponent {
return this.employeeModal.dataList.filter(x => x.employeeId.toLowerCase().includes(this.modal.search.toLowerCase()) ||
x.fname.toLowerCase().includes(this.modal.search.toLowerCase()) ||
x.lname.toLowerCase().includes(this.modal.search.toLowerCase()) ||
x.position.tdesc.toLowerCase().includes(this.modal.search.toLowerCase()) ||
x.jobCode.tdesc.toLowerCase().includes(this.modal.search.toLowerCase()))
x.position.tdesc.toLowerCase().includes(this.modal.search.toLowerCase()))
}
......@@ -512,8 +514,7 @@ export class SubEmployeeRegistrationComponent {
x.data.employeeId.toLowerCase().includes(this.search.toLowerCase()) ||
x.data.fname.toLowerCase().includes(this.search.toLowerCase()) ||
x.data.lname.toLowerCase().includes(this.search.toLowerCase()) ||
x.data.position.tdesc.toLowerCase().includes(this.search.toLowerCase()) ||
x.data.jobCode.tdesc.toLowerCase().includes(this.search.toLowerCase()))
x.data.position.tdesc.toLowerCase().includes(this.search.toLowerCase()))
}
selectEmployee(data?: EmployeeModel) {
if (this.modalType == 'update' && !data) {
......
......@@ -17,6 +17,7 @@ export interface DataModel {
})
export class EmployeeCategories {
currentPage = 1
pageSize = 10
page = Array.from({ length: 1 }, (_, i) => i + 1);
search = ""
modalStatus = 'add'
......
<div class="w-full min-height-50px mb-10px justify-between items-center">
<div class="flex pr-2 pb-2rem">
<div class="flex justify-between">
<div class="flex">
<div class="flex items-center">
<input type="checkbox" class="ti-form-checkbox pointer-events-none" id="hs-default-checkbox"
......@@ -8,7 +8,7 @@
{{numDataListChecked}} Selected</label>
</div>
<div class="mx-1 flex items-center">
<button (click)="isDataListCheckedAll = !isDataListCheckedAll;dataListCheckAll()" id="check-boxall"
<button (click)="isDataListCheckedAll = !isDataListCheckedAll;dataListCheckAll()" id='check-boxall'
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>
......@@ -16,28 +16,11 @@
<label class="text-sm text-gray-500 ml-2" for="check-boxall">Select All</label>
</div>
</div>
</div>
<div class="flex justify-between">
<div class="flex pr-2">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#employee-group-unit-component-upload-modal"
(click)="fileInput.value = '';selectedFile=null;selectedFileName = 'กรุณาเลือกไฟล์'">
<i class="ri-add-line"></i>
นำเข้าข้อมูล
</button>
<a class="mx-2 justify-center -mb-px inline-flex items-center gap-2 font-weight-500 font-size-12px text-center text-secondary border-secondary border-b-2 align-items-end"
href="javascript:void(0);" (click)="downloadFile()">
ดาวน์โหลดตัวอย่างไฟล์
</a>
</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"
style="height: 40px;" [(ngModel)]="search" (ngModelChange)="searchChange()">
<input type="text" 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>
......@@ -45,26 +28,35 @@
</div>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
<button type="button"
class=" h-45px ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-10 m-0 shadow-md"
data-hs-overlay="#employee-group-unit-component-upload-modal"
(click)="fileInput.value = '';selectedFile=null;selectedFileName = 'กรุณาเลือกไฟล์'">
<i class="ti ti-file-plus"></i>
import
</button>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
data-hs-overlay="#employee-group-unit-component-page-modal" (click)="modalStatus='add';setData()">
<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-20px m-0 shadow-md"
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-45px m-0 shadow-md"
data-hs-overlay="#employee-group-unit-component-page-alert-modal"
(click)="modalStatus='deleteGroup';setData()">
<i class="ri-delete-bin-6-line"></i>
Delete
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-20px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
</div>
......@@ -126,44 +118,8 @@
</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>
<ul class="nav-tabs mt-3">
<span>Show {{((currentPage-1) * 10)+1}} to {{emp_groupListFilter().length<10 ?emp_groupListFilter().length:
(currentPage==page.length ? ((currentPage * 10) - ((currentPage * 10) -
emp_groupListFilter().length) ) :(currentPage * 10) ) }} of {{emp_groupListFilter().length}}
items</span>
</ul>
</nav>
<app-pagination [totalItems]="emp_groupListFilter().length" [pageSize]="pageSize"
(pageChange)="currentPage = $event" (pageSizeChange)="pageSize = $event;currentPage = 1"></app-pagination>
</div>
......@@ -212,11 +168,13 @@
</div>
</div>
<div class="ti-modal-body ">
<label for="input-label" class="ti-form-label mt-2rem">รหัสกลุ่มพนักงาน<span class="text-danger">*</span></label>
<label for="input-label" class="ti-form-label mt-2rem">รหัสกลุ่มพนักงาน<span
class="text-danger">*</span></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.groupId">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดกลุ่มพนักงาน (ไทย)<span class="text-danger">*</span></label>
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดกลุ่มพนักงาน (ไทย)<span
class="text-danger">*</span></label>
<input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="dataSelect.tdesc">
<label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียดกลุ่มพนักงาน (อังกฤษ)</label>
<input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="dataSelect.edesc">
......@@ -321,6 +279,11 @@
<i class="ti ti-upload"></i>
</button>
</div>
<div class="flex justify-center mt-2rem ">
<h1 class="cursor-pointer justify-center -mb-px inline-flex items-center gap-2 font-weight-500 font-size-12px
text-center text-secondary border-secondary border-b-2 align-items-end" (click)="downloadFile()">
ดาวน์โหลดตัวอย่างไฟล์</h1>
</div>
<div class="flex justify-center mt-2rem mb-1rem space-x-4">
<button type="submit" class="ti-btn ti-btn-secondary"
data-hs-overlay="#employee-group-unit-component-upload-modal"
......
......@@ -18,6 +18,7 @@ export interface DataModel {
})
export class EmployeeGroupUnit implements OnInit {
currentPage = 1
pageSize = 10
selectedItems: string[] = [];
modalStatus: 'add' | 'edit' | 'delete' | 'deleteGroup' = 'add'
page = Array.from({ length: 1 }, (_, i) => i + 1);
......
<div class="w-full min-height-50px mb-10px justify-between items-center">
<div class="flex pr-2 pb-2rem">
<div class="flex justify-between">
<div class="flex">
<div class="flex items-center">
<input type="checkbox" class="ti-form-checkbox pointer-events-none" id="hs-default-checkbox"
......@@ -8,36 +8,19 @@
{{numDataListChecked}} Selected</label>
</div>
<div class="mx-1 flex items-center">
<button (click)="isDataListCheckedAll = !isDataListCheckedAll;dataListCheckAll()" id="check-boxall"
<button (click)="isDataListCheckedAll = !isDataListCheckedAll;dataListCheckAll()" id='check-boxall'
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" for="check-boxall" >Select All</label>
</div>
</div>
</div>
<div class="flex justify-between">
<div class="flex pr-2">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#employee-level-upload-modal"
(click)="fileInput.value = '';selectedFile=null;selectedFileName = 'กรุณาเลือกไฟล์'">
<i class="ri-add-line"></i>
นำเข้าข้อมูล
</button>
<a class="mx-2 justify-center -mb-px inline-flex items-center gap-2 font-weight-500 font-size-12px text-center text-secondary border-secondary border-b-2 align-items-end"
href="javascript:void(0);" (click)="downloadFile()">
ดาวน์โหลดตัวอย่างไฟล์
</a>
<label class="text-sm text-gray-500 ml-2" for="check-boxall">Select All</label>
</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"
style="height: 40px;" [(ngModel)]="search" (ngModelChange)="searchChange()">
<input type="text" 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>
......@@ -45,25 +28,34 @@
</div>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
<button type="button"
class=" h-45px ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-10 m-0 shadow-md"
data-hs-overlay="#employee-level-upload-modal"
(click)="fileInput.value = '';selectedFile=null;selectedFileName = 'กรุณาเลือกไฟล์'">
<i class="ti ti-file-plus"></i>
import
</button>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
data-hs-overlay="#employee-level-page-modal" (click)="modalStatus='add';setData()">
<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-20px m-0 shadow-md"
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-45px m-0 shadow-md"
data-hs-overlay="#employee-level-page-alert-modal" (click)="modalStatus='deleteGroup';setData()">
<i class="ri-delete-bin-6-line"></i>
Delete
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-20px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
</div>
......@@ -106,8 +98,8 @@
<tr
*ngFor="let item of plListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer"
id="checkbox-{{item.data.plId}}" [(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.plId}}"
[(ngModel)]="item.check" (ngModelChange)="dataListCheck()">
</td>
<td class="text-center">
<label for="checkbox-{{item.data.plId}}">&nbsp;{{item.data.plId}}</label>
......@@ -127,43 +119,8 @@
</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>
<ul class="nav-tabs mt-3">
<span>Show {{((currentPage-1) * 10)+1}} to {{plListFilter().length<10 ?plListFilter().length:
(currentPage==page.length ? ((currentPage * 10) - ((currentPage * 10) - plListFilter().length) ) :(currentPage
* 10) ) }} of {{plListFilter().length}} items</span>
</ul>
</nav>
<app-pagination [totalItems]="plListFilter().length" [pageSize]="pageSize" (pageChange)="currentPage = $event"
(pageSizeChange)="pageSize = $event;currentPage = 1"></app-pagination>
</div>
......@@ -214,7 +171,8 @@
<input type="text" id="input-label" class="ti-form-input w-1/2"
[ngClass]="{'bg-input-readonly':modalStatus=='edit'}" [readonly]="modalStatus=='edit'"
[(ngModel)]="dataSelect.plId">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดระดับพนักงาน(JL) (ไทย)<span class="text-danger">*</span></label>
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดระดับพนักงาน(JL) (ไทย)<span
class="text-danger">*</span></label>
<input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="dataSelect.tdesc">
<label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียดระดับพนักงาน(JL) (อังกฤษ)</label>
<input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="dataSelect.edesc">
......@@ -254,6 +212,11 @@
<i class="ti ti-upload"></i>
</button>
</div>
<div class="flex justify-center mt-2rem ">
<h1 class="cursor-pointer justify-center -mb-px inline-flex items-center gap-2 font-weight-500 font-size-12px
text-center text-secondary border-secondary border-b-2 align-items-end" (click)="downloadFile()">
ดาวน์โหลดตัวอย่างไฟล์</h1>
</div>
<div class="flex justify-center mt-2rem mb-1rem space-x-4">
<button type="submit" class="ti-btn ti-btn-secondary" data-hs-overlay="#employee-level-upload-modal"
[class.ti-btn-disabled]="!selectedFile" (click)="uploadFile()" [disabled]="!selectedFile"
......
......@@ -17,6 +17,7 @@ export interface DataModel {
})
export class EmployeeLevel implements OnInit {
currentPage = 1
pageSize = 10
page = Array.from({ length: 1 }, (_, i) => i + 1);
search = ""
modalStatus = 'add'
......
......@@ -19,6 +19,7 @@ export interface DataModel {
})
export class PositionUnitComponent implements OnInit {
currentPage = 1
pageSize = 10
selectedItems: string[] = [];
search = ""
selectedFile: File | null = null;
......
......@@ -44,12 +44,12 @@
Delete
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-20px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
</div>
......
......@@ -44,12 +44,12 @@
Delete
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-20px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
</div>
......
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