Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myjob-manage
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
myjob-manage
Commits
6c349735
Commit
6c349735
authored
Jul 07, 2025
by
Natthaphat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ทะเบียนระดับวุฒิการศึกษา
parent
db403a28
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
496 additions
and
41 deletions
+496
-41
common.module.ts
src/app/DPU/common/common.module.ts
+5
-0
category-company.component.ts
...department/category-company/category-company.component.ts
+2
-20
country-registration.component.ts
...nt/country-registration/country-registration.component.ts
+2
-19
degree-manage.component.css
...pany-department/degree-manage/degree-manage.component.css
+0
-0
degree-manage.component.html
...any-department/degree-manage/degree-manage.component.html
+204
-0
degree-manage.component.spec.ts
...-department/degree-manage/degree-manage.component.spec.ts
+28
-0
degree-manage.component.ts
...mpany-department/degree-manage/degree-manage.component.ts
+218
-0
degree.service.ts
src/app/DPU/services/degree.service.ts
+30
-0
nav.service.ts
src/app/shared/services/nav.service.ts
+1
-0
en.json
src/assets/i18n/en.json
+3
-1
th.json
src/assets/i18n/th.json
+3
-1
No files found.
src/app/DPU/common/common.module.ts
View file @
6c349735
...
...
@@ -52,6 +52,11 @@ export const admin: Routes = [
import
(
'./company-department/category-company/category-company.component'
).
then
((
m
)
=>
m
.
CategoryCompanyComponent
),
},
{
path
:
'degree-manage'
,
loadComponent
:
()
=>
import
(
'./company-department/degree-manage/degree-manage.component'
).
then
((
m
)
=>
m
.
DegreeManageComponent
),
},
{
path
:
'job-types'
,
loadComponent
:
()
=>
import
(
'./company-department/job-type/job-type.component'
).
then
((
m
)
=>
m
.
JobTypeComponent
),
...
...
src/app/DPU/common/company-department/category-company/category-company.component.ts
View file @
6c349735
...
...
@@ -31,24 +31,6 @@ import { CategoryCompanyService } from '../../../services/category-company.servi
styleUrls
:
[
'./category-company.component.css'
]
})
export
class
CategoryCompanyComponent
implements
OnInit
{
quillConfig
=
{
toolbar
:
[
[
'link'
],
[
'bold'
,
'italic'
,
'underline'
,
'strike'
],
[
'blockquote'
,
'code-block'
],
[{
'header'
:
1
},
{
'header'
:
2
}],
[{
'list'
:
'ordered'
},
{
'list'
:
'bullet'
}],
[{
'script'
:
'sub'
},
{
'script'
:
'super'
}],
[{
'indent'
:
'-1'
},
{
'indent'
:
'+1'
}],
[{
'direction'
:
'rtl'
}],
[{
'size'
:
[
'small'
,
false
,
'large'
,
'huge'
]
}],
[{
'header'
:
[
1
,
2
,
3
,
4
,
5
,
6
,
false
]
}],
[{
'color'
:
[]
},
{
'background'
:
[]
}],
[{
'align'
:
[]
}],
[
'clean'
],
]
};
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
modalDetail
!
:
TemplateRef
<
any
>
;
...
...
@@ -125,7 +107,7 @@ export class CategoryCompanyComponent implements OnInit {
if
(
this
.
modalStatus
==
'add'
)
{
console
.
log
(
this
.
category
);
this
.
categoryCompanyService
.
post
(
this
.
category
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึก
เวอร์ชั่น
สำเร็จ"
,
"success"
);
swal
(
"Save Success!!"
,
"บันทึก
ประเภท
สำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
})
...
...
@@ -133,7 +115,7 @@ export class CategoryCompanyComponent implements OnInit {
const
respone
=
new
CategoryModel
(
this
.
category
);
this
.
categoryCompanyService
.
post
(
respone
).
subscribe
(
result
=>
{
console
.
log
(
result
)
swal
(
"Update Success!!"
,
"บันทึก
เวอร์ชั่น
สำเร็จ"
,
"success"
);
swal
(
"Update Success!!"
,
"บันทึก
ประเภท
สำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
})
...
...
src/app/DPU/common/company-department/country-registration/country-registration.component.ts
View file @
6c349735
...
...
@@ -34,23 +34,6 @@ import { CountryModel } from "../../../models/country.model";
styleUrl
:
'./country-registration.component.css'
})
export
class
CountryRegistrationComponent
{
quillConfig
=
{
toolbar
:
[
[
'link'
],
[
'bold'
,
'italic'
,
'underline'
,
'strike'
],
[
'blockquote'
,
'code-block'
],
[{
'header'
:
1
},
{
'header'
:
2
}],
[{
'list'
:
'ordered'
},
{
'list'
:
'bullet'
}],
[{
'script'
:
'sub'
},
{
'script'
:
'super'
}],
[{
'indent'
:
'-1'
},
{
'indent'
:
'+1'
}],
[{
'direction'
:
'rtl'
}],
[{
'size'
:
[
'small'
,
false
,
'large'
,
'huge'
]
}],
[{
'header'
:
[
1
,
2
,
3
,
4
,
5
,
6
,
false
]
}],
[{
'color'
:
[]
},
{
'background'
:
[]
}],
[{
'align'
:
[]
}],
[
'clean'
],
]
};
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
modalDetail
!
:
TemplateRef
<
any
>
;
...
...
@@ -127,7 +110,7 @@ export class CountryRegistrationComponent {
if
(
this
.
modalStatus
==
'add'
)
{
console
.
log
(
this
.
country
);
this
.
countryService
.
post
(
this
.
country
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึก
เวอร์ชั่น
สำเร็จ"
,
"success"
);
swal
(
"Save Success!!"
,
"บันทึก
ประเทศ
สำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
})
...
...
@@ -135,7 +118,7 @@ export class CountryRegistrationComponent {
const
respone
=
new
CountryModel
(
this
.
country
);
this
.
countryService
.
post
(
respone
).
subscribe
(
result
=>
{
console
.
log
(
result
)
swal
(
"Update Success!!"
,
"บันทึก
เวอร์ชั่น
สำเร็จ"
,
"success"
);
swal
(
"Update Success!!"
,
"บันทึก
ประเทศ
สำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
})
...
...
src/app/DPU/common/company-department/degree-manage/degree-manage.component.css
0 → 100644
View file @
6c349735
src/app/DPU/common/company-department/degree-manage/degree-manage.component.html
0 → 100644
View file @
6c349735
<app-page-header
[
title
]="'ทะเบียนระดับวุฒิการศึกษา'"
[
activeTitle
]="'ผู้ดูแลระบบ'"
[
title1
]="'ทะเบียนระดับวุฒิการศึกษา'"
></app-page-header>
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"box"
>
<div
class=
"box-header justify-between"
>
<div
class=
"box-title"
>
{{ 'All List' | translate}}
<span
class=
"badge bg-light text-default rounded-full ms-1 text-[0.75rem] align-middle"
>
{{itemsList.length}}
</span>
</div>
<div
class=
"flex flex-wrap gap-2"
>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(
click
)="
new
()"
data-hs-overlay=
"#modal-detail"
><i
class=
"ri-add-line font-semibold align-middle"
></i>
{{ 'Create' |
translate}}
</a>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-danger-full me-2"
*
ngIf=
"someSelected"
(
click
)="
deleteSelect
()"
><i
class=
"ri-delete-bin-line font-semibold align-middle"
></i>
{{ 'Delete' |
translate}}
</a>
<div>
<input
class=
"form-control form-control"
type=
"text"
placeholder=
"ค้นหาระดับการศึกษา"
aria-label=
".form-control-sm example"
[(
ngModel
)]='
searchTerm
'
>
</div>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table whitespace-nowrap min-w-full ti-custom-table-hover"
>
<thead>
<tr
class=
"border-b border-defaultborder"
>
<th
scope=
"col"
class=
"!text-start"
>
<input
class=
"form-check-input check-all"
type=
"checkbox"
id=
"all-products"
(
change
)="
toggleAll
($
event
)"
[
checked
]="
allSelected
"
aria-label=
"..."
>
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Degree ID' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Description(TH)' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Description(ENG)' | translate}}
</th>
<!-- <th scope="col" class="text-start">{{ 'Higher' | translate}}</th> -->
<th
scope=
"col"
class=
"text-start"
>
{{ 'Action' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
></th>
</tr>
</thead>
<tbody>
@if (filterList.length > 0) {
@for(item of filterList;track filterList){
<tr
class=
"border border-defaultborder dark:border-defaultborder/10"
>
<td
class=
"product-checkbox"
><input
class=
"form-check-input"
type=
"checkbox"
[
checked
]="
selectedItems
.
get
(
item
.
degreeId
)"
(
change
)="
onCheckboxChange
(
item
.
degreeId
)"
aria-label=
"..."
value=
""
>
</td>
<td>
<div>
<span
class=
"block"
>
{{item.degreeId}}
</span>
</div>
</td>
<td>
<div>
<span>
{{item.thName}}
</span>
</div>
</td>
<td>
<div>
<span>
{{item.engName}}
</span>
</div>
</td>
<!-- <td>
<div>
<span>{{item.higher}}</span>
</div>
</td> -->
<td>
<div
class=
"flex flex-row items-center !gap-2 "
>
<a
aria-label=
"anchor"
(
click
)="
view
(
item
)"
data-hs-overlay=
"#modal-detail"
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
><i
class=
"ri-pencil-line"
></i></a>
<a
aria-label=
"anchor"
href=
"javascript:void(0);"
(
click
)="
deletedegree
(
item
)"
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-danger/10 text-danger hover:bg-danger hover:text-white hover:border-danger"
><i
class=
"ri-delete-bin-line"
></i></a>
</div>
</td>
</tr>
}
} @else {
<tr>
<td
[
attr
.
colspan
]="
6
"
class=
"text-center py-4"
>
<ng-container
*
ngIf=
"itemsList.length === 0 && !searchTerm"
>
<p>
กำลังโหลดข้อมูล หรือไม่มีข้อมูลเลย...
</p>
</ng-container>
<ng-container
*
ngIf=
"itemsList.length > 0 && filterList.length === 0 && searchTerm"
>
<p>
ไม่พบข้อมูลที่ค้นหา...
</p>
</ng-container>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div
class=
"box-footer"
>
<div
class=
"flex items-center flex-wrap overflow-auto"
*
ngIf=
"filterList.length > 0"
>
<div
class=
"mb-2 sm:mb-0"
>
<div>
{{'Showing' | translate}} {{filterList.length}} {{'entries'
| translate}}
<i
class=
"bi bi-arrow-right ms-2 font-semibold"
></i>
</div>
</div>
<div
class=
"ms-auto"
>
<nav
aria-label=
"Page navigation"
>
<ul
class=
"ti-pagination mb-0"
>
<li
*
ngIf=
"pageIndex>0"
class=
"page-item {{pageIndex==0 ? 'disabled' : ''}}"
><a
class=
"page-link px-3 py-[0.375rem] cursor-pointer"
(
click
)="
pageIndex =
pageIndex-1;updatePagedItems()"
>
{{'Previous' | translate}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageIndex-1>0"
(
click
)="
pageIndex =
pageIndex-2;updatePagedItems()"
>
{{pageIndex-1}}
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageIndex>0 && ((pageIndex-1)*10 < (searchTerm == '' ? itemsList.length : filterList.length))"
(
click
)="
pageIndex =
pageIndex-1;updatePagedItems()"
>
{{pageIndex}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link active px-3 py-[0.375rem]"
href=
"javascript:void(0);"
>
{{pageIndex +1}}
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageIndex+1)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
(
click
)="
pageIndex =
pageIndex+1;updatePagedItems()"
>
{{pageIndex +2}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageIndex+2)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
(
click
)="
pageIndex =
pageIndex+2;updatePagedItems()"
>
{{pageIndex +3}}
</a></li>
<li
*
ngIf=
"(pageIndex+1)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem] cursor-pointer"
(
click
)="
pageIndex =
pageIndex+1;updatePagedItems()"
>
{{'Next' |
translate}}
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<div
id=
"modal-detail"
class=
"hs-overlay hidden ti-modal [--overlay-backdrop:static]"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<div
class=
"ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
{{ (modalStatus == 'add' ? ('Create' | translate) : ('Edit' | translate)) + ' ' + ('Degree' | translate) }}
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay=
"#modal-detail"
#
closeModal
>
<span
class=
"sr-only"
>
{{'Close' | translate}}
</span>
<i
class=
"ri-close-line"
></i>
</button>
</div>
<div
class=
"ti-modal-body px-4"
>
<div
class=
"grid grid-cols-12 gap-4"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Degree ID' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
[
ngClass
]="{
'!
bg-input-readonly
'
:
modalStatus =
==
'
edit
'
}"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
degree
.
degreeId
"
[
readonly
]="
modalStatus =
==
'
edit
'"
>
<div
class=
"text-danger"
*
ngIf=
"!degree.degreeId"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Description(TH)' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
degree
.
thName
"
>
<div
class=
"text-danger"
*
ngIf=
"!degree.thName"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Description(ENG)' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
degree
.
engName
"
>
<div
class=
"text-danger"
*
ngIf=
"!degree.engName"
>
{{'Please fill in information' | translate}}
</div>
</div>
</div>
</div>
<div
class=
"ti-modal-footer"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay=
"#modal-detail"
>
{{'Cancel' | translate}}
</button>
<button
type=
"button"
(
click
)="
save
()"
class=
"ti-btn bg-primary text-white !font-medium"
>
{{'Save' |
translate}}
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/app/DPU/common/company-department/degree-manage/degree-manage.component.spec.ts
0 → 100644
View file @
6c349735
/* tslint:disable:no-unused-variable */
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
By
}
from
'@angular/platform-browser'
;
import
{
DebugElement
}
from
'@angular/core'
;
import
{
DegreeManageComponent
}
from
'./degree-manage.component'
;
describe
(
'DegreeManageComponent'
,
()
=>
{
let
component
:
DegreeManageComponent
;
let
fixture
:
ComponentFixture
<
DegreeManageComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
DegreeManageComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
DegreeManageComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/DPU/common/company-department/degree-manage/degree-manage.component.ts
0 → 100644
View file @
6c349735
import
{
CommonModule
}
from
"@angular/common"
;
import
{
ChangeDetectionStrategy
,
Component
,
ElementRef
,
TemplateRef
,
ViewChild
}
from
'@angular/core'
;
import
{
NgSelectModule
}
from
"@ng-select/ng-select"
;
import
{
TranslateModule
,
TranslateService
}
from
"@ngx-translate/core"
;
import
{
FormsModule
}
from
"@angular/forms"
;
import
swal
from
'sweetalert'
;
import
{
MatPaginator
,
PageEvent
}
from
"@angular/material/paginator"
;
import
{
FileUploadModule
}
from
'ng2-file-upload'
;
import
{
FileItem
,
FileUploader
,
ParsedResponseHeaders
}
from
"ng2-file-upload"
;
import
{
Router
}
from
"@angular/router"
;
import
{
QuillModule
}
from
"ngx-quill"
;
import
{
MatDialog
}
from
"@angular/material/dialog"
;
import
{
SharedModule
}
from
"../../../../shared/shared.module"
;
import
{
PdpaConfigComponent
}
from
"../../pdpa-manage/pdpa-config/pdpa-config.component"
;
import
{
MyPdpaModel
,
PdpaModel
}
from
"../../../models/pdpa.model"
;
import
{
DegreeModel
}
from
"../../../models/degree.model"
;
import
{
DegreeService
}
from
"../../../services/degree.service"
;
@
Component
({
selector
:
'app-degree-manage'
,
standalone
:
true
,
imports
:
[
CommonModule
,
SharedModule
,
TranslateModule
,
NgSelectModule
,
FormsModule
,
MatPaginator
,
FileUploadModule
,
PdpaConfigComponent
,
QuillModule
],
templateUrl
:
'./degree-manage.component.html'
,
styleUrl
:
'./degree-manage.component.css'
})
export
class
DegreeManageComponent
{
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
modalDetail
!
:
TemplateRef
<
any
>
;
currentTab
=
1
allSelected
=
false
;
someSelected
=
false
;
itemsList
:
DegreeModel
[]
=
[]
filterList
:
DegreeModel
[]
=
[]
degree
:
DegreeModel
=
new
DegreeModel
()
selectedItems
=
new
Map
<
string
,
boolean
>
();
pageIndex
=
0
;
modalStatus
:
"add"
|
"edit"
=
"add"
isSaving
=
false
;
get
searchTerm
():
string
{
return
this
.
_searchTerm
;
}
set
searchTerm
(
val
:
string
)
{
this
.
pageIndex
=
0
;
this
.
allSelected
=
false
this
.
_searchTerm
=
val
;
if
(
val
!=
''
)
{
this
.
filterList
=
this
.
filter
(
val
);
}
else
{
this
.
updatePagedItems
()
}
}
_searchTerm
=
""
;
constructor
(
private
degreeService
:
DegreeService
,
public
translate
:
TranslateService
,
private
modal
:
MatDialog
)
{
}
ngOnInit
():
void
{
this
.
degreeService
.
list
().
subscribe
(
res
=>
{
this
.
itemsList
=
res
.
map
(
item
=>
new
DegreeModel
(
item
,
this
.
translate
));
this
.
filterList
=
[...
this
.
itemsList
];
});
}
filter
(
v
:
string
)
{
return
this
.
itemsList
?.
filter
(
(
x
)
=>
x
.
degreeId
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
thName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
engName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
higher
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
);
}
new
()
{
this
.
modalStatus
=
'add'
this
.
degree
=
new
DegreeModel
();
}
view
(
item
:
DegreeModel
)
{
this
.
modalStatus
=
'edit'
;
this
.
degree
=
new
DegreeModel
(
item
,
this
.
translate
);
}
save
()
{
swal
({
title
:
"Are you sure?"
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"Cancel"
,
"Confirm"
],
})
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
if
(
this
.
modalStatus
==
'add'
)
{
console
.
log
(
this
.
degree
);
this
.
degreeService
.
post
(
this
.
degree
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกระดับการศึกษาสำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
})
}
else
if
(
this
.
modalStatus
==
'edit'
)
{
const
respone
=
new
DegreeModel
(
this
.
degree
);
this
.
degreeService
.
post
(
respone
).
subscribe
(
result
=>
{
console
.
log
(
result
)
swal
(
"Update Success!!"
,
"บันทึกระดับการศึกษาสำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
})
}
}
});
}
deletedegree
(
item
:
DegreeModel
)
{
const
versionText
=
`
${
this
.
translate
.
instant
(
'degree'
)}
:
${
item
.
thName
}
`
;
swal
({
title
:
"Are you sure?"
,
text
:
`Confirm to delete :\n
${
versionText
}
\!`
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"Cancel"
,
"Yes,Delete it!"
],
}).
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
const
res
=
new
DegreeModel
(
item
)
console
.
log
(
res
);
this
.
degreeService
.
delete
(
res
).
subscribe
(
result
=>
{
swal
(
"Delete Success!!"
,
"ลบข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
();
});
}
});
}
deleteSelect
()
{
let
degreeConfig
=
''
;
this
.
selectedItems
.
forEach
((
isSelected
,
res
)
=>
{
if
(
isSelected
)
{
const
degree
=
this
.
itemsList
.
find
(
degree
=>
degree
.
degreeId
===
res
)
as
DegreeModel
;
if
(
degree
)
{
degreeConfig
+=
`
${
this
.
translate
.
instant
(
'degree'
)}
:
${
degree
.
thName
}
\n`
;
}
}
});
swal
({
title
:
"Are you sure?"
,
text
:
degreeConfig
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"Cancel"
,
"Yes, Delete it!"
],
})
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
this
.
selectedItems
.
forEach
((
isSelected
,
res
)
=>
{
if
(
isSelected
)
{
const
degree
=
this
.
itemsList
.
find
(
degree
=>
degree
.
degreeId
===
res
);
if
(
degree
)
{
const
newdegree
=
new
DegreeModel
(
degree
)
console
.
log
(
newdegree
);
this
.
degreeService
.
delete
(
newdegree
).
subscribe
(
result
=>
{
swal
(
"Delete Success!!"
,
"ลบข้อมูลที่เลือกสำเร็จ"
,
"success"
);
this
.
ngOnInit
();
});
}
}
});
}
});
}
updatePagedItems
()
{
const
startIndex
=
this
.
pageIndex
*
10
;
const
endIndex
=
startIndex
+
10
;
this
.
filterList
=
this
.
itemsList
.
slice
(
startIndex
,
endIndex
);
}
toggleAll
(
event
:
any
)
{
this
.
allSelected
=
event
.
target
.
checked
;
this
.
selectedItems
.
clear
();
this
.
itemsList
.
forEach
(
item
=>
{
this
.
selectedItems
.
set
(
item
.
degreeId
,
this
.
allSelected
);
});
this
.
someSelected
=
this
.
itemsList
.
some
(
item
=>
this
.
selectedItems
.
get
(
item
.
degreeId
));
}
onCheckboxChange
(
degreeId
:
string
)
{
const
isSelected
=
this
.
selectedItems
.
get
(
degreeId
)
||
false
;
this
.
selectedItems
.
set
(
degreeId
,
!
isSelected
);
this
.
allSelected
=
this
.
itemsList
.
every
(
item
=>
this
.
selectedItems
.
get
(
item
.
degreeId
));
this
.
someSelected
=
this
.
itemsList
.
some
(
item
=>
this
.
selectedItems
.
get
(
item
.
degreeId
));
}
filterEmp
(
empId
:
string
)
{
this
.
degree
=
this
.
itemsList
.
filter
(
e
=>
e
.
degreeId
==
empId
)[
0
]
}
}
\ No newline at end of file
src/app/DPU/services/degree.service.ts
0 → 100644
View file @
6c349735
import
{
HttpClient
,
HttpHeaders
}
from
"@angular/common/http"
;
import
{
Injectable
}
from
"@angular/core"
;
import
{
environment
}
from
"../../../environments/environment"
;
import
{
Observable
}
from
"rxjs"
;
import
{
DegreeModel
}
from
"../models/degree.model"
;
@
Injectable
({
providedIn
:
'root'
})
export
class
DegreeService
{
constructor
(
private
http
:
HttpClient
)
{
}
list
():
Observable
<
DegreeModel
[]
>
{
return
this
.
http
.
get
<
DegreeModel
[]
>
(
`
${
environment
.
baseUrl
}
/degree/list`
);
}
post
(
body
:
any
):
Observable
<
any
>
{
return
this
.
http
.
post
(
`
${
environment
.
baseUrl
}
/degree`
,
body
,
{
observe
:
'response'
});
}
delete
(
body
:
any
):
Observable
<
any
>
{
const
option
=
{
headers
:
new
HttpHeaders
({
'Content-Type'
:
'application/json'
}),
body
:
body
};
return
this
.
http
.
delete
<
any
>
(
`
${
environment
.
baseUrl
}
/degree`
,
option
);
}
}
src/app/shared/services/nav.service.ts
View file @
6c349735
...
...
@@ -131,6 +131,7 @@ export class NavService implements OnDestroy {
{
path
:
'/company-departments/company-info'
,
title
:
'ข้อมูลบริษัท'
,
type
:
'link'
},
{
path
:
'/admin/country-registration'
,
title
:
'ทะเบียนประเทศ'
,
type
:
'link'
},
{
path
:
'/admin/category-company'
,
title
:
'ทะเบียนประเภทบริษัท'
,
type
:
'link'
},
{
path
:
'/admin/degree-manage'
,
title
:
'ทะเบียนระดับวุฒิการศึกษา'
,
type
:
'link'
},
{
path
:
'/admin/job-types'
,
title
:
'จัดการประเภทงาน'
,
type
:
'link'
},
{
path
:
'/admin/provinces'
,
title
:
'จัดการจังหวัด'
,
type
:
'link'
},
],
...
...
src/assets/i18n/en.json
View file @
6c349735
...
...
@@ -97,5 +97,7 @@
"Country"
:
"Country"
,
"Description(TH)"
:
"Description(TH)"
,
"Description(ENG)"
:
"Description(ENG)"
,
"JobtypeId"
:
"JobtypeId"
"JobtypeId"
:
"JobtypeId"
,
"Degree ID"
:
"Degree ID"
,
"Degree"
:
"Degree"
}
src/assets/i18n/th.json
View file @
6c349735
...
...
@@ -97,5 +97,7 @@
"Country"
:
"ประเทศ"
,
"Description(TH)"
:
"รายละเอียด(ไทย)"
,
"Description(ENG)"
:
"รายละเอียด(อังกฤษ)"
,
"JobtypeId"
:
"รหัสประเภทงาน"
"JobtypeId"
:
"รหัสประเภทงาน"
,
"Degree ID"
:
"รหัสระดับการศึกษา"
,
"Degree"
:
"ระดับการศึกษา"
}
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