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
8b6b7fea
Commit
8b6b7fea
authored
Apr 02, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ทะเบียนบริษัท
parent
ff6ec3e7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
94 deletions
+66
-94
company-registration-page.component.html
...egistration-page/company-registration-page.component.html
+17
-35
company-registration-page.component.ts
...-registration-page/company-registration-page.component.ts
+44
-56
datagrid-syncfution.component.html
...ts/datagrid-syncfution/datagrid-syncfution.component.html
+4
-3
datagrid-syncfution.component.ts
...ents/datagrid-syncfution/datagrid-syncfution.component.ts
+1
-0
No files found.
src/app/components/company-components/company-registration/company-registration-page/company-registration-page.component.html
View file @
8b6b7fea
<div
class=
"w-full min-height-50px mb-10px justify-between items-center"
>
<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=
"flex justify-end"
>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<div
class=
"relative shadow-md"
>
<div
class=
"relative shadow-md"
>
<input
type=
"text"
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
<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
()
"
>
placeholder=
"Search by No. or Name"
[(
ngModel
)]="
search
"
>
<div
<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"
>
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>
<i
class=
"ri-search-line text-gray"
></i>
...
@@ -57,11 +40,15 @@
...
@@ -57,11 +40,15 @@
</button>
</button>
</div> -->
</div> -->
</div>
</div>
</div>
</div>
</div>
<div
class=
"page px-rem"
>
<div
class=
"page px-rem"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<app-datagrid-syncfution
[
searchSettings
]="
searchSettings
"
[
searchText
]="
search
"
[
dataSource
]="
dataList
"
[
columns
]="
columns
"
[
modalName
]="'#
department-register-modal
'"
[
selectedItems
]="
selectedItems
"
(
sendSelectData
)="
modalStatus=
'edit'
;
setData
($
event
);
openDialog
()"
(
sendSelectedItems
)="
onSelectItemChange
($
event
)"
(
sendOpenDialog
)="
openDialog
()"
>
</app-datagrid-syncfution>
<!-- <div class="overflow-auto shadow-md rounded-t-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered">
<thead>
<thead>
<tr>
<tr>
...
@@ -109,16 +96,13 @@
...
@@ -109,16 +96,13 @@
<td class="flex justify-center">
<td class="flex justify-center">
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
(click)="modalStatus='edit';setData(item.data);openDialog()"></i>
(click)="modalStatus='edit';setData(item.data);openDialog()"></i>
<!-- <i class="ti ti-trash cursor-pointer i-gray fs-l px-1" *ngIf="item.data.code!='100'"
(click)="modalStatus='delete';setData(item.data)"
data-hs-overlay="#company-registration-page-alert-modal"></i> -->
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
<app-pagination [totalItems]="dataListFilter().length" [pageSize]="pageSize" (pageChange)="currentPage = $event"
<app-pagination [totalItems]="dataListFilter().length" [pageSize]="pageSize" (pageChange)="currentPage = $event"
(
pageSizeChange
)="
pageSize =
$event;currentPage
=
1
"
></app-pagination>
(pageSizeChange)="pageSize = $event;currentPage = 1"></app-pagination>
-->
</div>
</div>
<ng-template
#
registrationModal
let-modal
>
<ng-template
#
registrationModal
let-modal
>
...
@@ -128,15 +112,14 @@
...
@@ -128,15 +112,14 @@
<div
class=
"w-full flex justify-end"
>
<div
class=
"w-full flex justify-end"
>
<div
class=
"absolute flex"
>
<div
class=
"absolute flex"
>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
<button
type=
"button"
class=
"ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
(
click
)="
clearData
()"
>
(
click
)="
clearData
()"
>
<i
class=
"ti ti-eraser text-base"
></i>
<i
class=
"ti ti-eraser text-base"
></i>
Clear
Clear
</button>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<mat-dialog-content
>
<mat-dialog-content>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
รหัสบริษัท
<span
class=
"text-danger"
>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
รหัสบริษัท
<span
class=
"text-danger"
>
*
*
<ng-container
*
ngIf=
"modalStatus=='add'&&checkPrimary()"
>
<ng-container
*
ngIf=
"modalStatus=='add'&&checkPrimary()"
>
...
@@ -147,8 +130,7 @@
...
@@ -147,8 +130,7 @@
[
class
.!
border-red
]="
modalStatus=
='add'&&checkPrimary()"
[
class
.!
border-red
]="
modalStatus=
='add'&&checkPrimary()"
[
ngClass
]="{'!
bg-input-readonly
'
:modalStatus=
='edit'}"
[
readonly
]="
modalStatus=
='edit'"
[
ngClass
]="{'!
bg-input-readonly
'
:modalStatus=
='edit'}"
[
readonly
]="
modalStatus=
='edit'"
[(
ngModel
)]="
dataSelect
.
code
"
[
maxLength
]="
5
"
>
[(
ngModel
)]="
dataSelect
.
code
"
[
maxLength
]="
5
"
>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
<span
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
<span
class=
"text-danger"
>
*
</span></label>
class=
"text-danger"
>
*
</span></label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
[(
ngModel
)]="
dataSelect
.
tdesc
"
>
<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>
<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
"
>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
[(
ngModel
)]="
dataSelect
.
edesc
"
>
...
@@ -169,7 +151,7 @@
...
@@ -169,7 +151,7 @@
</button>
</button>
</mat-dialog-actions>
</mat-dialog-actions>
</ng-template>
</ng-template>
<div
id=
"company-registration-page-modal"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"company-registration-page-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=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]"
>
...
@@ -282,10 +264,10 @@
...
@@ -282,10 +264,10 @@
ยืนยันการบันทึกข้อมูลหรือไม่
ยืนยันการบันทึกข้อมูลหรือไม่
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"modalStatus=='delete'||modalStatus=='deleteGroup'"
>
<ng-container
*
ngIf=
"modalStatus=='delete'||modalStatus=='deleteGroup'"
>
<ng-container
*
ngIf=
"num
DataListChecked
"
>
<ng-container
*
ngIf=
"num
SelectItem()
"
>
ยืนยันการลบข้อมูลหรือไม่
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"!num
DataListChecked
"
>
<ng-container
*
ngIf=
"!num
SelectItem()
"
>
เลือกข้อมูลที่ต้องการลบ
เลือกข้อมูลที่ต้องการลบ
</ng-container>
</ng-container>
</ng-container>
</ng-container>
...
@@ -298,10 +280,10 @@
...
@@ -298,10 +280,10 @@
data-hs-overlay=
"#company-registration-page-modal"
>
data-hs-overlay=
"#company-registration-page-modal"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<
!-- <
a class="ti-btn ti-btn-success" href="javascript:void(0);"
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#company-registration-page-alert-modal"
(
click
)="
addCompany
()"
>
data-hs-overlay=
"#company-registration-page-alert-modal"
(
click
)="
addCompany
()"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
-->
</a>
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"modalStatus=='delete'||modalStatus=='deleteGroup'"
>
<ng-container
*
ngIf=
"modalStatus=='delete'||modalStatus=='deleteGroup'"
>
<button
type=
"button"
<button
type=
"button"
...
@@ -309,7 +291,7 @@
...
@@ -309,7 +291,7 @@
data-hs-overlay=
"#company-registration-page-alert-modal"
>
data-hs-overlay=
"#company-registration-page-alert-modal"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<a
class=
"ti-btn ti-btn-danger"
href=
"javascript:void(0);"
*
ngIf=
"num
DataListChecked
"
<a
class=
"ti-btn ti-btn-danger"
href=
"javascript:void(0);"
*
ngIf=
"num
SelectItem()
"
data-hs-overlay=
"#company-registration-page-alert-modal"
(
click
)="
deleteCompany
()"
>
data-hs-overlay=
"#company-registration-page-alert-modal"
(
click
)="
deleteCompany
()"
>
ลบข้อมูล
ลบข้อมูล
</a>
</a>
...
...
src/app/components/company-components/company-registration/company-registration-page/company-registration-page.component.ts
View file @
8b6b7fea
import
{
ChangeDetectorRef
,
Component
,
ViewChild
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
,
ViewChild
}
from
'@angular/core'
;
import
{
MatDialog
}
from
'@angular/material/dialog'
;
import
{
MatDialog
}
from
'@angular/material/dialog'
;
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
CompanyModel
,
MyCompanyModel
}
from
'src/app/shared/model/company.model'
;
import
{
CompanyModel
,
MyCompanyModel
}
from
'src/app/shared/model/company.model'
;
import
{
CompanyService
}
from
'src/app/shared/services/company.service'
;
import
{
CompanyService
}
from
'src/app/shared/services/company.service'
;
...
@@ -24,17 +25,35 @@ export class CompanyRegistrationPageComponent {
...
@@ -24,17 +25,35 @@ export class CompanyRegistrationPageComponent {
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
search
=
""
search
=
""
modalStatus
=
'add'
modalStatus
=
'add'
dataList
:
{
check
:
boolean
,
data
:
DataModel
}
[]
=
[]
dataList
:
DataModel
[]
=
[]
dataLoading
=
false
dataLoading
=
false
dataSelect
:
DataModel
=
{
code
:
""
,
tdesc
:
""
,
edesc
:
""
,
address
:
""
,
contact
:
""
}
dataSelect
:
DataModel
=
{
code
:
""
,
tdesc
:
""
,
edesc
:
""
,
address
:
""
,
contact
:
""
}
selectedItems
:
{
key
:
string
,
count
:
number
,
data
:
Map
<
string
,
boolean
>
}
=
{
key
:
''
,
count
:
0
,
data
:
new
Map
<
string
,
boolean
>
()
};
numDataListChecked
=
0
searchSettings
=
{
isDataListChecked
=
false
fields
:
[
'code'
,
'tdesc'
,
'edesc'
],
isDataListCheckedAll
=
false
operator
:
'contains'
,
ignoreCase
:
false
};
columns
:
ColumnModel
[]
=
[{
field
:
"code"
,
headerText
:
"รหัสบริษัท"
,
type
:
"string"
,
isPrimaryKey
:
true
,
},
{
field
:
"tdesc"
,
headerText
:
"รายละเอียดบริษัท (ไทย)"
,
type
:
"string"
},
{
field
:
"edesc"
,
headerText
:
"รายละเอียดบริษัท (อังกฤษ)"
,
type
:
"string"
}]
selectedFile
:
File
|
null
=
null
;
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
dialogRef
:
any
dialogRef
:
any
constructor
(
private
toastr
:
ToastrService
,
constructor
(
private
toastr
:
ToastrService
,
private
companyService
:
CompanyService
,
private
companyService
:
CompanyService
,
private
cdr
:
ChangeDetectorRef
,
private
cdr
:
ChangeDetectorRef
,
...
@@ -48,11 +67,13 @@ export class CompanyRegistrationPageComponent {
...
@@ -48,11 +67,13 @@ export class CompanyRegistrationPageComponent {
this
.
dataLoading
=
true
this
.
dataLoading
=
true
this
.
companyService
.
getList
().
subscribe
({
this
.
companyService
.
getList
().
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
this
.
dataList
=
response
.
map
(
x
=>
({
check
:
false
,
data
:
{
code
:
x
.
companyId
,
tdesc
:
x
.
tdesc
,
edesc
:
x
.
edesc
,
address
:
x
.
addressText
,
contact
:
x
.
contactText
}
}))
this
.
dataList
=
response
.
map
(
x
=>
{
this
.
selectedItems
.
data
.
set
(
x
.
companyId
,
false
)
return
{
code
:
x
.
companyId
,
tdesc
:
x
.
tdesc
,
edesc
:
x
.
edesc
,
address
:
x
.
addressText
,
contact
:
x
.
contactText
}
})
this
.
selectedItems
.
key
=
'code'
this
.
selectedItems
.
count
=
0
this
.
dataLoading
=
false
this
.
dataLoading
=
false
this
.
isDataListCheckedAll
=
false
this
.
dataListCheckAll
()
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
},
error
:
error
=>
{
this
.
dataLoading
=
false
this
.
dataLoading
=
false
...
@@ -61,23 +82,10 @@ export class CompanyRegistrationPageComponent {
...
@@ -61,23 +82,10 @@ export class CompanyRegistrationPageComponent {
})
})
}
}
searchChange
()
{
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
dataListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
dataListCheck
()
}
dataListFilter
()
{
return
this
.
dataList
.
filter
(
x
=>
{
const
data
=
x
.
data
const
match
=
data
.
code
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
data
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
data
.
edesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
());
return
match
;
});
}
setData
(
data
?:
DataModel
)
{
setData
(
data
?:
DataModel
)
{
this
.
dataSelect
=
JSON
.
parse
(
JSON
.
stringify
(
data
||
{
code
:
""
,
tdesc
:
""
,
edesc
:
""
,
address
:
""
,
contact
:
""
}));
this
.
dataSelect
=
JSON
.
parse
(
JSON
.
stringify
(
data
||
{
code
:
""
,
tdesc
:
""
,
edesc
:
""
,
address
:
""
,
contact
:
""
}));
}
}
addCompany
()
{
addCompany
()
{
Swal
.
fire
({
Swal
.
fire
({
icon
:
'question'
,
icon
:
'question'
,
...
@@ -115,7 +123,7 @@ export class CompanyRegistrationPageComponent {
...
@@ -115,7 +123,7 @@ export class CompanyRegistrationPageComponent {
}
}
deleteCompany
()
{
deleteCompany
()
{
if
(
!
this
.
numDataListChecked
)
{
if
(
!
this
.
numSelectItem
())
{
this
.
showAlert
(
'กรุณาเลือกข้อมูลที่ต้องการลบ'
,
'error'
)
this
.
showAlert
(
'กรุณาเลือกข้อมูลที่ต้องการลบ'
,
'error'
)
return
return
}
}
...
@@ -129,12 +137,8 @@ export class CompanyRegistrationPageComponent {
...
@@ -129,12 +137,8 @@ export class CompanyRegistrationPageComponent {
reverseButtons
:
true
,
reverseButtons
:
true
,
}).
then
((
result
)
=>
{
}).
then
((
result
)
=>
{
if
(
result
.
isConfirmed
)
{
if
(
result
.
isConfirmed
)
{
let
body
:
CompanyModel
|
CompanyModel
[]
=
[]
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
if
(
this
.
dataSelect
.
code
)
{
const
body
=
this
.
dataList
.
filter
(
x
=>
x
.
code
!=
'100'
).
filter
(
x
=>
selectedKeys
.
includes
(
x
.
code
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
code
)).
map
(
x
=>
new
MyCompanyModel
({
companyId
:
x
.
code
,
tdesc
:
x
.
tdesc
,
edesc
:
x
.
edesc
,
addressText
:
x
.
address
,
contactText
:
x
.
contact
}))
body
=
new
MyCompanyModel
({
companyId
:
this
.
dataSelect
.
code
,
tdesc
:
this
.
dataSelect
.
tdesc
,
edesc
:
this
.
dataSelect
.
edesc
,
addressText
:
this
.
dataSelect
.
address
,
contactText
:
this
.
dataSelect
.
contact
})
}
else
{
body
=
this
.
dataList
.
filter
(
x
=>
x
.
check
&&
x
.
data
.
code
!=
'100'
).
map
(
x
=>
new
MyCompanyModel
({
companyId
:
x
.
data
.
code
,
tdesc
:
x
.
data
.
tdesc
,
edesc
:
x
.
data
.
edesc
,
addressText
:
x
.
data
.
address
,
contactText
:
x
.
data
.
contact
}))
}
this
.
dataLoading
=
true
this
.
dataLoading
=
true
this
.
companyService
.
delete
(
body
).
subscribe
({
this
.
companyService
.
delete
(
body
).
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
...
@@ -154,8 +158,6 @@ export class CompanyRegistrationPageComponent {
...
@@ -154,8 +158,6 @@ export class CompanyRegistrationPageComponent {
})
})
}
}
});
});
}
}
showAlert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
showAlert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
...
@@ -167,27 +169,6 @@ export class CompanyRegistrationPageComponent {
...
@@ -167,27 +169,6 @@ export class CompanyRegistrationPageComponent {
});
});
}
}
dataListCheckAll
()
{
const
selectAll
=
this
.
isDataListCheckedAll
;
this
.
dataList
.
filter
(
x
=>
{
const
data
=
x
.
data
const
match
=
data
.
code
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
data
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
data
.
edesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
());
return
match
;
}).
forEach
(
x
=>
x
.
check
=
selectAll
);
this
.
dataListCheck
();
}
dataListCheck
()
{
const
dataCheck
=
this
.
dataListFilter
();
this
.
isDataListCheckedAll
=
dataCheck
.
length
?
dataCheck
.
filter
(
x
=>
x
.
data
.
code
!=
'100'
).
every
(
x
=>
x
.
check
)
:
false
;
if
(
dataCheck
.
length
==
1
&&
dataCheck
.
find
(
x
=>
x
.
data
.
code
==
'100'
))
{
this
.
isDataListCheckedAll
=
false
}
this
.
numDataListChecked
=
this
.
dataList
.
filter
(
x
=>
x
.
check
).
length
;
if
(
this
.
dataList
.
some
(
x
=>
x
.
check
&&
x
.
data
.
code
==
'100'
))
{
this
.
numDataListChecked
=
this
.
numDataListChecked
-
1
}
this
.
isDataListChecked
=
Boolean
(
this
.
numDataListChecked
)
}
onFileSelected
(
event
:
any
)
{
onFileSelected
(
event
:
any
)
{
this
.
selectedFile
=
event
.
target
.
files
.
length
>
0
?
event
.
target
.
files
[
0
]
:
null
;
this
.
selectedFile
=
event
.
target
.
files
.
length
>
0
?
event
.
target
.
files
[
0
]
:
null
;
...
@@ -244,7 +225,7 @@ export class CompanyRegistrationPageComponent {
...
@@ -244,7 +225,7 @@ export class CompanyRegistrationPageComponent {
}
}
checkPrimary
()
{
checkPrimary
()
{
return
this
.
dataList
.
find
(
x
=>
x
.
data
.
code
==
this
.
dataSelect
.
code
)
return
this
.
dataList
.
find
(
x
=>
x
.
code
==
this
.
dataSelect
.
code
)
}
}
openDialog
()
{
openDialog
()
{
...
@@ -252,10 +233,17 @@ export class CompanyRegistrationPageComponent {
...
@@ -252,10 +233,17 @@ export class CompanyRegistrationPageComponent {
width
:
'500px'
,
width
:
'500px'
,
disableClose
:
false
,
disableClose
:
false
,
});
});
console
.
log
(
"🚀 ~ CompanyRegistrationPageComponent ~ openDialog ~ this.dialogRef:"
,
this
.
dialogRef
)
}
}
closeDialog
()
{
closeDialog
()
{
this
.
dialogRef
.
close
()
this
.
dialogRef
.
close
()
}
}
onSelectItemChange
(
arg
:
any
)
{
this
.
selectedItems
=
arg
}
numSelectItem
()
{
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
const
num
=
this
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
code
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
code
)).
length
return
num
}
}
}
src/app/components/datagrid-syncfution/datagrid-syncfution.component.html
View file @
8b6b7fea
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
[
allowMultiSorting
]='
true
'
>
[
allowMultiSorting
]='
true
'
>
<e-columns>
<e-columns>
<e-column
headerText=
'checkboxSelect'
[
textAlign
]="'
center
'"
width=
'150'
*
ngIf=
"checkBoxSetting"
>
<e-column
headerText=
'checkboxSelect'
[
textAlign
]="'
center
'"
width=
'150'
[
editType
]="
false
"
[
allowEditing
]="
false
"
*
ngIf=
"checkBoxSetting"
>
<ng-template
#
headerTemplate
let-data
*
ngIf=
"checkBoxSetting"
>
<ng-template
#
headerTemplate
let-data
*
ngIf=
"checkBoxSetting"
>
<input
type=
"checkbox"
[
id
]="'
checkbox-all
'"
class=
"ti-form-checkbox cursor-pointer"
<input
type=
"checkbox"
[
id
]="'
checkbox-all
'"
class=
"ti-form-checkbox cursor-pointer"
[
checked
]="
selectedItemsAll
"
(
click
)="
toggleSelectionAll
()"
>
[
checked
]="
selectedItemsAll
"
(
click
)="
toggleSelectionAll
()"
>
...
@@ -22,8 +23,8 @@
...
@@ -22,8 +23,8 @@
</ng-template>
</ng-template>
</e-column>
</e-column>
<e-column
*
ngFor=
"let col of columns"
[
field
]="
col
.
field
"
[
headerText
]="
col
.
headerText
"
[
width
]="
col
.
width
"
<e-column
*
ngFor=
"let col of columns"
[
field
]="
col
.
field
"
[
headerText
]="
col
.
headerText
"
[
width
]="
col
.
width
"
[
format
]="
col
.
format
"
[
textAlign
]="'
center
'"
[
isPrimaryKey
]="
col
.
isPrimaryKey
"
[
editType
]="
col
.
editTyp
e
"
[
format
]="
col
.
format
"
[
textAlign
]="'
center
'"
[
isPrimaryKey
]="
col
.
isPrimaryKey
"
[
editType
]="
fals
e
"
[
validationRules
]="
col
.
validationRules
"
[
allowEditing
]="
'
true
'
"
[
allowSorting
]="'
true
'"
[
allowFiltering
]="
true
"
[
validationRules
]="
col
.
validationRules
"
[
allowEditing
]="
false
"
[
allowSorting
]="'
true
'"
[
allowFiltering
]="
true
"
[
visible
]="
col
.
visible
"
[
type
]="
col
.
type
"
>
[
visible
]="
col
.
visible
"
[
type
]="
col
.
type
"
>
<ng-template
#
headerTemplate
let-data
>
<ng-template
#
headerTemplate
let-data
>
<span
class=
"font-size-12px font-weight-700 text-primary"
>
{{ col.headerText }}
</span>
<span
class=
"font-size-12px font-weight-700 text-primary"
>
{{ col.headerText }}
</span>
...
...
src/app/components/datagrid-syncfution/datagrid-syncfution.component.ts
View file @
8b6b7fea
...
@@ -47,6 +47,7 @@ L10n.load({
...
@@ -47,6 +47,7 @@ L10n.load({
},
},
'th-TH'
:
{
'th-TH'
:
{
'pager'
:
{
'pager'
:
{
'All'
:
'ทั้งหมด'
,
'currentPageInfo'
:
''
,
'currentPageInfo'
:
''
,
'totalItemsInfo'
:
'{0} รายการ'
,
'totalItemsInfo'
:
'{0} รายการ'
,
'totalRecordsInfo'
:
'{0} รายการ'
,
'totalRecordsInfo'
:
'{0} รายการ'
,
...
...
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