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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
292 additions
and
41 deletions
+292
-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
+0
-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
This diff is collapsed.
Click to expand it.
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