Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mySkill-x
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
mySkill-x
Commits
670180e4
Commit
670180e4
authored
Apr 11, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ทะเบียนพนักงาน
parent
75c45679
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
185 deletions
+75
-185
sub-employee-registration.component.html
...yee-registration/sub-employee-registration.component.html
+18
-108
sub-employee-registration.component.ts
...loyee-registration/sub-employee-registration.component.ts
+53
-75
datagrid-syncfution.component.ts
...ents/datagrid-syncfution/datagrid-syncfution.component.ts
+4
-2
No files found.
src/app/components/company-components/employee-registration/sub-employee-registration/sub-employee-registration.component.html
View file @
670180e4
<div
class=
"w-full min-height-50px mb-10px justify-between items-center"
>
<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"
[(
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()"
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
class=
"flex justify-end"
>
<div
class=
"px-1"
>
<div
class=
"relative shadow-md"
>
<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
()
"
>
[(
ngModel
)]="
search
"
>
<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>
...
...
@@ -38,7 +21,7 @@
</div>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
data-hs-overlay=
"#sub-employee-registration-modal"
(
click
)="
modalType
=
'add'
;
selectEmployee
()"
>
data-hs-overlay=
"#sub-employee-registration-modal"
(
click
)="
currentModal
=
'add'
;
selectEmployee
()"
>
<i
class=
"ri-add-line"
></i>
Add
</button>
...
...
@@ -46,90 +29,21 @@
<div
class=
"px-1"
>
<button
class=
"ti-btn ti-btn-soft-danger h-45px m-0 shadow-md"
data-hs-overlay=
"#sub-employee-registration-alert-delete-modal"
(
click
)="
modalType=
'deleteGroup
'
;
selectEmployee
()"
>
(
click
)="
currentModal=
'delete
'
;
selectEmployee
()"
>
<i
class=
"ri-delete-bin-6-line"
></i>
Delete
</button>
</div>
<!-- <div class="px-1">
<button class="ti-btn ti-btn-soft-info h-45px m-0 shadow-md">
<i class="ri-printer-line"></i>
Print
</button>
</div> -->
<!-- <div class="px-1">
<button 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
class=
"page px-rem"
>
<div
class=
"overflow-auto table-bordered rounded-t-md"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover"
>
<thead>
<tr>
<ng-container
*
ngFor=
"let item of ['','รหัสพนักงาน','ชื่อ','นามสกุล','ตำแหน่ง','การจัดการ']; let f = first; let l = last; let i = index"
>
<th
scope=
"col"
class=
" px-10px py-10px bg-soft-secondary text-primary !text-center"
>
<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=
"employee.loading"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
<div
*
ngFor=
"let item of [1,2,3]"
class=
"ti-spinner w-8 h-8 text-secondary mx-1"
role=
"status"
aria-label=
"loading"
>
<span
class=
"sr-only"
>
Loading...
</span>
</div>
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!employee.loading&&!employeeFilter().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!employee.loading&&employeeFilter().length"
>
<tr
*
ngFor=
"let item of employeeFilter() | 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.employeeId}}"
[(
ngModel
)]="
item
.
check
"
(
ngModelChange
)="
dataListCheck
()"
>
</td>
<td
class=
"text-center"
>
<label
for=
"checkbox-{{item.data.employeeId}}"
>
{{item.data.employeeId}}
</label>
</td>
<td>
{{item.data.fname}}
</td>
<td>
{{item.data.lname}}
</td>
<td>
{{item.data.position.tdesc}}
</td>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#sub-employee-registration-modal"
(
click
)="
modalType=
'update'
;
selectEmployee
(
item
.
data
)"
></i>
<!-- <i class="ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#sub-employee-registration-alert-delete-modal"
(click)="modalType='delete';selectEmployee(item.data)"></i> -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
<app-pagination
[
totalItems
]="
employeeFilter
().
length
"
[
pageSize
]="
pageSize
"
(
pageChange
)="
currentPage =
$event"
(
pageSizeChange
)="
pageSize =
$event;currentPage
=
1
"
></app-pagination>
</div>
<app-datagrid-syncfution
[
searchSettings
]="
searchSettings
"
[
searchText
]="
search
"
[
dataSource
]="
employee
.
dataList
"
[
columns
]="
columns
"
[
selectedItems
]="
selectedItems
"
modalName=
"#sub-employee-registration-modal"
(
sendSelectData
)="
currentModal=
'update'
;
selectEmployee
($
event
)"
(
sendSelectedItems
)="
onSelectItemChange
($
event
)"
>
</app-datagrid-syncfution>
</div>
<div
id=
"sub-employee-registration-modal"
class=
"hs-overlay hidden ti-modal"
>
...
...
@@ -151,10 +65,6 @@
<div
class=
"w-full flex justify-end"
>
<div
class=
"absolute flex"
>
<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> -->
<button
type=
"button"
class=
"ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
(
click
)="
selectEmployee
()"
>
<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"
...
...
@@ -178,13 +88,13 @@
<div
class=
"grid grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 ti-form-label text-primary mt-2 align-center"
>
รหัสพนักงาน
<span
class=
"text-danger"
>
*
<ng-container
*
ngIf=
"(
modalType
=='add')&&checkPrimary()"
>
<ng-container
*
ngIf=
"(
currentModal
=='add')&&checkPrimary()"
>
<br>
รหัสพนักงานซ้ำ
</ng-container>
</span></label>
<input
type=
"text"
class=
"col-span-6 ti-form-input"
[
ngClass
]="{'
bg-input-readonly
'
:
modalType
=
='update'}"
<input
type=
"text"
class=
"col-span-6 ti-form-input"
[
ngClass
]="{'
bg-input-readonly
'
:
currentModal
=
='update'}"
oninput=
"this.value = this.value.replace(/[^a-zA-Z0-9\u0E00-\uFFFF]/g, '')"
maxlength=
"15"
[
readonly
]="
modalType
=
='update'"
[(
ngModel
)]="
employee
.
select
.
employeeId
"
>
[
readonly
]="
currentModal
=
='update'"
[(
ngModel
)]="
employee
.
select
.
employeeId
"
>
</div>
<div
class=
"grid grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 ti-form-label text-primary mt-2 align-center"
>
ชื่อ-นามสกุล
<span
...
...
@@ -592,8 +502,8 @@
</button>
<button
type=
"button"
class=
"ti-btn ti-btn-success"
data-hs-overlay=
"#sub-employee-registration-alert-add-modal"
[
class
.
ti-btn-disabled
]="
checkEmployeeModel
()||(
modalType
=
='add'&&checkPrimary())"
[
disabled
]="
checkEmployeeModel
()||(
modalType
=
='add'&&checkPrimary())"
>
[
class
.
ti-btn-disabled
]="
checkEmployeeModel
()||(
currentModal
=
='add'&&checkPrimary())"
[
disabled
]="
checkEmployeeModel
()||(
currentModal
=
='add'&&checkPrimary())"
>
บันทึกข้อมูล
</button>
</div>
...
...
@@ -665,7 +575,7 @@
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-employee-registration-alert-add-modal"
(
click
)="
updateEmployeeList
(
modalType
)"
>
data-hs-overlay=
"#sub-employee-registration-alert-add-modal"
(
click
)="
updateEmployeeList
(
currentModal
)"
>
บันทึกข้อมูล
</a>
</div>
...
...
@@ -691,10 +601,10 @@
</div>
<div
class=
"ti-modal-body "
>
<p
class=
"mt-1 text-gray-800 dark:text-white/70"
>
<ng-container
*
ngIf=
"num
DataListChecked
"
>
<ng-container
*
ngIf=
"num
SelectItem()y
"
>
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
<ng-container
*
ngIf=
"!num
DataListChecked
"
>
<ng-container
*
ngIf=
"!num
SelectItem()y
"
>
เลือกข้อมูลที่ต้องการลบ
</ng-container>
!
</p>
...
...
@@ -706,8 +616,8 @@
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-employee-registration-alert-delete-modal"
(
click
)="
updateEmployeeList
(
modalType
)"
*
ngIf=
"num
DataListChecked
"
>
data-hs-overlay=
"#sub-employee-registration-alert-delete-modal"
(
click
)="
updateEmployeeList
(
currentModal
)"
*
ngIf=
"num
SelectItem()y
"
>
ลบข้อมูล
</a>
</div>
...
...
src/app/components/company-components/employee-registration/sub-employee-registration/sub-employee-registration.component.ts
View file @
670180e4
...
...
@@ -32,14 +32,7 @@ import { Bu7Model, MyBu7Model } from 'src/app/shared/model/bu7.model';
import
{
EmpStatusService
}
from
'src/app/shared/services/emp-status.service'
;
import
{
StatusModel
,
MyStatusModel
}
from
'src/app/shared/model/status.model'
;
import
{
MyBossModel
}
from
'src/app/shared/model/boss.model'
;
export
interface
DataEmployee
{
loading
:
boolean
select
:
EmployeeModel
|
any
dataList
:
{
check
:
boolean
data
:
EmployeeModel
}[]
}
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
export
interface
DataModal
{
search
:
string
,
currentPage
:
number
,
...
...
@@ -53,13 +46,36 @@ export interface DataModal {
})
export
class
SubEmployeeRegistrationComponent
{
employee
:
DataEmployee
=
{
loading
:
false
,
select
:
new
MyEmployeeModel
({}),
dataList
:
[]
}
currentPage
=
1
pageSize
=
10
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
employee
:
{
loading
:
boolean
,
select
:
EmployeeModel
|
any
,
dataList
:
EmployeeModel
[]
}
=
{
loading
:
false
,
select
:
new
MyEmployeeModel
(),
dataList
:
[]
}
search
=
""
modalType
:
'add'
|
'update'
|
'delete'
|
'deleteGroup'
=
'add'
currentModal
:
'add'
|
'update'
|
'delete'
=
'add'
columns
:
ColumnModel
[]
=
[{
field
:
"employeeId"
,
headerText
:
"รหัสพนักงาน"
,
type
:
"string"
,
isPrimaryKey
:
true
,
},
{
field
:
"fname"
,
headerText
:
"ชื่อ"
,
type
:
"string"
},
{
field
:
"lname"
,
headerText
:
"นามสกุล"
,
type
:
"string"
},
{
field
:
"position.tdesc"
,
headerText
:
"ตำแหน่ง"
,
type
:
"string"
}]
searchSettings
=
{
fields
:
[
'employeeId'
,
'fname'
,
'lname'
,
'position.tdesc'
],
operator
:
'contains'
,
ignoreCase
:
false
}
selectedItems
:
{
key
:
string
,
count
:
number
,
data
:
Map
<
string
,
boolean
>
}
=
{
key
:
''
,
count
:
0
,
data
:
new
Map
<
string
,
boolean
>
()
};
modal
:
DataModal
=
{
search
:
""
,
...
...
@@ -68,10 +84,6 @@ export class SubEmployeeRegistrationComponent {
pageSize
:
10
}
numDataListChecked
=
0
isDataListChecked
=
false
isDataListCheckedAll
=
false
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
...
...
@@ -186,7 +198,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
pl
.
dataList
=
response
.
map
((
x
:
any
)
=>
new
MyPLModel
(
x
))
this
.
pl
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
pl
.
loading
=
false
...
...
@@ -206,7 +217,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
empType
.
dataList
=
response
.
map
((
x
:
any
)
=>
new
MyEmpTypeModel
(
x
))
this
.
empType
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
empType
.
loading
=
false
...
...
@@ -226,7 +236,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
branch
.
dataList
=
response
.
map
((
x
:
any
)
=>
new
MyBranchModel
(
x
))
this
.
branch
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
branch
.
loading
=
false
...
...
@@ -246,7 +255,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
jobcode
.
dataList
=
response
.
map
((
x
:
any
)
=>
new
MyJobCodeModel
(
x
))
this
.
jobcode
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
jobcode
.
loading
=
false
...
...
@@ -266,7 +274,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
position
.
dataList
=
response
.
map
((
x
:
any
)
=>
new
MyPositionModel
(
x
))
this
.
position
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
position
.
loading
=
false
...
...
@@ -286,7 +293,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
bu1
.
dataList
=
response
?.
map
((
x
:
any
)
=>
new
MyBu1Model
(
x
))
||
[]
this
.
bu1
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
bu1
.
loading
=
false
...
...
@@ -320,7 +326,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
bu2
.
dataList
=
response
?.
map
((
x
:
any
)
=>
new
MyBu2Model
(
x
))
||
[]
this
.
bu2
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
bu2
.
loading
=
false
...
...
@@ -353,7 +358,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
bu3
.
dataList
=
response
?.
map
((
x
:
any
)
=>
new
MyBu3Model
(
x
))
||
[]
this
.
bu3
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
bu3
.
loading
=
false
...
...
@@ -385,7 +389,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
bu4
.
dataList
=
response
?.
map
((
x
:
any
)
=>
new
MyBu4Model
(
x
))
||
[]
this
.
bu4
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
bu4
.
loading
=
false
...
...
@@ -416,7 +419,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
bu5
.
dataList
=
response
?.
map
((
x
:
any
)
=>
new
MyBu5Model
(
x
))
||
[]
this
.
bu5
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
bu5
.
loading
=
false
...
...
@@ -446,7 +448,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
bu6
.
dataList
=
response
?.
map
((
x
:
any
)
=>
new
MyBu6Model
(
x
))
||
[]
this
.
bu6
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
bu6
.
loading
=
false
...
...
@@ -475,7 +476,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
bu7
.
dataList
=
response
?.
map
((
x
:
any
)
=>
new
MyBu7Model
(
x
))
||
[]
this
.
bu7
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
bu7
.
loading
=
false
...
...
@@ -498,7 +498,6 @@ export class SubEmployeeRegistrationComponent {
next
:
response
=>
{
this
.
empGroup
.
dataList
=
response
.
map
((
x
:
any
)
=>
new
MyEmpGroupModel
(
x
))
this
.
empGroup
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
empGroup
.
loading
=
false
...
...
@@ -517,12 +516,14 @@ export class SubEmployeeRegistrationComponent {
this
.
employee
.
loading
=
true
this
.
employeeService
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
employee
.
dataList
=
response
.
map
((
x
:
any
)
=>
({
check
:
false
,
data
:
new
MyEmployeeModel
(
x
)
}))
this
.
employee
.
dataList
=
response
.
map
(
x
=>
{
this
.
selectedItems
.
data
.
set
(
x
.
employeeId
,
false
)
return
new
MyEmployeeModel
(
x
)
})
this
.
employeeModal
.
dataList
=
response
.
filter
(
x
=>
x
.
employeeId
!=
this
.
decodeJWT
(
sessionStorage
.
getItem
(
"accessToken"
)
||
''
).
employeeid
).
map
((
x
:
any
)
=>
new
MyEmployeeModel
(
x
))
this
.
selectedItems
.
key
=
'employeeId'
this
.
selectedItems
.
count
=
0
this
.
employee
.
loading
=
false
this
.
isDataListCheckedAll
=
false
this
.
dataListCheckAll
()
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
employee
.
loading
=
false
...
...
@@ -538,26 +539,21 @@ export class SubEmployeeRegistrationComponent {
}
updateEmployeeList
(
type
:
'add'
|
'update'
|
'delete'
|
'deleteGroup'
)
{
let
body
=
this
.
employee
.
select
updateEmployeeList
(
type
:
'add'
|
'update'
|
'delete'
)
{
this
.
employee
.
loading
=
true
let
body
:
any
=
this
.
employee
.
select
switch
(
type
)
{
case
'delete'
:
{
body
=
[
this
.
employee
.
select
]
break
;
}
case
'deleteGroup'
:
{
body
=
this
.
employee
.
dataList
.
filter
(
x
=>
x
.
check
).
map
(
x
=>
new
MyEmployeeModel
(
x
.
data
))
type
=
'delete'
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
body
=
this
.
employee
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
employeeId
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
employeeId
)).
map
(
x
=>
new
MyEmployeeModel
(
x
))
break
;
}
}
this
.
employee
.
loading
=
true
this
.
employeeService
[
type
](
body
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
search
=
""
this
.
searchChange
()
this
.
getEmployeeList
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
...
...
@@ -571,20 +567,8 @@ export class SubEmployeeRegistrationComponent {
}
})
}
searchChange
()
{
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
employeeFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
dataListCheck
()
}
employeeFilter
()
{
return
this
.
employee
.
dataList
.
filter
(
x
=>
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
()))
}
selectEmployee
(
data
?:
EmployeeModel
)
{
if
(
this
.
modalType
==
'update'
&&
!
data
)
{
if
(
this
.
currentModal
==
'update'
&&
!
data
)
{
this
.
employee
.
select
=
{
...
new
MyEmployeeModel
({
employeeId
:
this
.
employee
.
select
.
employeeId
}),
dateIso
:
''
,
dateEndIso
:
'2100-12-31'
}
this
.
employee
.
select
.
resignDate
=
'2100-12-31'
this
.
employee
.
select
.
status
=
new
MyStatusModel
(
this
.
empStatus
.
dataList
[
0
])
...
...
@@ -660,22 +644,6 @@ export class SubEmployeeRegistrationComponent {
})
}
dataListCheckAll
()
{
const
selectAll
=
this
.
isDataListCheckedAll
;
this
.
employee
.
dataList
.
filter
(
x
=>
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
())).
forEach
(
x
=>
x
.
check
=
selectAll
);
this
.
dataListCheck
();
}
dataListCheck
()
{
const
dataCheck
=
this
.
employeeFilter
();
this
.
isDataListCheckedAll
=
dataCheck
.
length
?
dataCheck
.
every
(
x
=>
x
.
check
)
:
false
;
this
.
numDataListChecked
=
this
.
employee
.
dataList
.
filter
(
x
=>
x
.
check
).
length
;
this
.
isDataListChecked
=
Boolean
(
this
.
numDataListChecked
)
}
checkEmployeeModel
()
{
let
disable
=
false
...
...
@@ -712,6 +680,16 @@ export class SubEmployeeRegistrationComponent {
}
checkPrimary
()
{
return
this
.
employee
.
dataList
.
find
(
x
=>
x
.
data
.
employeeId
==
this
.
employee
.
select
.
employeeId
)
return
this
.
employee
.
dataList
.
find
(
x
=>
x
.
employeeId
==
this
.
employee
.
select
.
employeeId
)
}
numSelectItem
()
{
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
const
num
=
this
.
employee
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
employeeId
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
employeeId
)).
length
return
num
}
onSelectItemChange
(
arg
:
any
)
{
this
.
selectedItems
=
arg
}
}
src/app/components/datagrid-syncfution/datagrid-syncfution.component.ts
View file @
670180e4
...
...
@@ -221,8 +221,10 @@ export class DatagridSyncfutionComponent implements OnInit {
}
filterData
(
text
:
string
,
fields
:
string
[]):
any
[]
{
return
this
.
dataSource
.
filter
(
item
=>
{
return
fields
.
some
(
field
=>
item
[
field
]?.
toString
().
toLowerCase
().
includes
(
text
.
toLowerCase
())
return
fields
.
some
(
field
=>
{
const
value
=
field
.
split
(
'.'
).
reduce
((
obj
,
key
)
=>
obj
?.[
key
],
item
);
return
value
?.
toString
().
toLowerCase
().
includes
(
text
.
toLowerCase
());
}
);
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment