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
5795ed21
Commit
5795ed21
authored
Jul 07, 2025
by
sawit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เพิ่มทะเบียนจัดการกลุ่มอาชีพ
parent
a253c195
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
334 additions
and
2 deletions
+334
-2
common.module.ts
src/app/DPU/common/common.module.ts
+5
-0
career-cluster.component.css
...ny-department/career-cluster/career-cluster.component.css
+0
-0
career-cluster.component.html
...y-department/career-cluster/career-cluster.component.html
+0
-0
career-cluster.component.ts
...any-department/career-cluster/career-cluster.component.ts
+268
-0
career-cluster.model.ts
src/app/DPU/models/career-cluster.model.ts
+3
-0
career-cluster.service.ts
src/app/DPU/services/career-cluster.service.ts
+51
-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 @
5795ed21
...
@@ -76,6 +76,11 @@ export const admin: Routes = [
...
@@ -76,6 +76,11 @@ export const admin: Routes = [
loadComponent
:
()
=>
loadComponent
:
()
=>
import
(
'./company-department/company-position/company-position.component'
).
then
((
m
)
=>
m
.
CompanyPositionComponent
),
import
(
'./company-department/company-position/company-position.component'
).
then
((
m
)
=>
m
.
CompanyPositionComponent
),
},
},
{
path
:
'career-cluster'
,
loadComponent
:
()
=>
import
(
'./company-department/career-cluster/career-cluster.component'
).
then
((
m
)
=>
m
.
CareerClusterComponent
),
},
//////////////emp/////////////////
//////////////emp/////////////////
{
{
path
:
'emp/department'
,
path
:
'emp/department'
,
...
...
src/app/DPU/common/company-department/career-cluster/career-cluster.component.css
0 → 100644
View file @
5795ed21
src/app/DPU/common/company-department/career-cluster/career-cluster.component.html
0 → 100644
View file @
5795ed21
This diff is collapsed.
Click to expand it.
src/app/DPU/common/company-department/career-cluster/career-cluster.component.ts
0 → 100644
View file @
5795ed21
import
{
Component
,
ElementRef
,
ViewChild
}
from
'@angular/core'
;
import
{
DomSanitizer
,
SafeHtml
}
from
'@angular/platform-browser'
;
import
{
Router
,
RouterModule
}
from
'@angular/router'
;
import
{
SharedModule
}
from
'../../../../shared/shared.module'
;
import
{
TranslateModule
,
TranslateService
}
from
'@ngx-translate/core'
;
import
swal
from
'sweetalert'
;
import
{
MatPaginator
}
from
'@angular/material/paginator'
;
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
NgSelectModule
}
from
'@ng-select/ng-select'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
FileUploadModule
}
from
'ng2-file-upload'
;
import
{
FileItem
,
FileUploader
,
ParsedResponseHeaders
}
from
"ng2-file-upload"
;
import
{
environment
}
from
'../../../../../environments/environment'
;
import
{
TokenService
}
from
'../../../../shared/services/token.service'
import
{
QuillModule
}
from
'ngx-quill'
;
import
{
MatDialog
,
MatDialogModule
}
from
'@angular/material/dialog'
;
import
{
CareerClusterService
}
from
'../../../services/career-cluster.service'
;
import
{
CareerClusterModel
}
from
'../../../models/career-cluster.model'
;
@
Component
({
selector
:
'app-career-cluster'
,
standalone
:
true
,
imports
:
[
CommonModule
,
SharedModule
,
TranslateModule
,
NgSelectModule
,
FormsModule
,
MatPaginator
,
RouterModule
,
FileUploadModule
,
QuillModule
,
MatDialogModule
],
templateUrl
:
'./career-cluster.component.html'
,
styleUrl
:
'./career-cluster.component.css'
,
})
export
class
CareerClusterComponent
{
quillConfig
=
{
toolbar
:
[
[
'link'
],
// เพิ่มปุ่มลิงก์
[
'bold'
,
'italic'
,
'underline'
,
'strike'
],
// toggled buttons
[
'blockquote'
,
'code-block'
],
[{
'header'
:
1
},
{
'header'
:
2
}],
// custom button values
[{
'list'
:
'ordered'
},
{
'list'
:
'bullet'
}],
[{
'script'
:
'sub'
},
{
'script'
:
'super'
}],
// superscript/subscript
[{
'indent'
:
'-1'
},
{
'indent'
:
'+1'
}],
// outdent/indent
[{
'direction'
:
'rtl'
}],
// text direction
[{
'size'
:
[
'small'
,
false
,
'large'
,
'huge'
]
}],
// custom dropdown
[{
'header'
:
[
1
,
2
,
3
,
4
,
5
,
6
,
false
]
}],
[{
'color'
:
[]
},
{
'background'
:
[]
}],
// dropdown with defaults from theme
[{
'align'
:
[]
}],
[
'clean'
],
// remove formatting button
]
};
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
public
modalDetail
?:
ElementRef
;
@
ViewChild
(
"CareerClusterModel"
)
CareerClusterModel
:
any
;
@
ViewChild
(
'profileChangeInput'
)
profileChangeInputRef
!
:
ElementRef
;
dialogRef
:
any
currentContentTab
:
number
=
1
;
currentExcerptTab
:
number
=
1
;
action
=
"new"
;
allSelected
=
false
;
someSelected
=
false
;
itemsList
:
CareerClusterModel
[]
=
[];
filterList
:
CareerClusterModel
[]
=
[];
selectModel
:
CareerClusterModel
=
new
CareerClusterModel
();
selectedItems
=
new
Map
<
string
,
boolean
>
();
// empList: CareerClusterModel[] = [];
// descName = 'engName';
pageIndex
=
0
;
uploaderProfile
:
FileUploader
|
undefined
;
uploadErrorMsg
:
string
=
""
;
modalStatus
:
"add"
|
"edit"
=
"add"
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
careercluster
:
CareerClusterService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
,
private
router
:
Router
,
private
dialog
:
MatDialog
,
)
{
}
getPosition
()
{
this
.
careercluster
.
getList
().
subscribe
({
next
:
(
response
:
CareerClusterModel
[])
=>
{
this
.
itemsList
=
response
.
map
((
x
:
any
)
=>
new
CareerClusterModel
(
x
,
this
.
translate
));
console
.
log
(
'ข้อมูลตำแหน่ง (itemsList)'
,
this
.
itemsList
);
this
.
updatePagedItems
();
},
error
:
(
error
)
=>
{
console
.
error
(
'error cant get position'
,
error
);
swal
(
"ข้อผิดพลาด"
,
"ไม่สามารถดึงข้อมูลตำแหน่งได้"
,
"error"
);
}
});
}
ngOnInit
():
void
{
this
.
getPosition
();
}
filter
(
v
:
string
)
{
return
this
.
itemsList
?.
filter
(
(
x
)
=>
x
.
careerClusterId
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
thName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
engName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
remark
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
// x.getStatus().toLowerCase().indexOf(v.toLowerCase()) !== -1
);
}
delete
(
item
:
CareerClusterModel
)
{
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณจะไม่สามารถกู้คืนข้อมูลนี้ได้!"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ใช่, ลบเลย!"
],
})
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
const
newPosition
=
new
CareerClusterModel
(
item
)
this
.
careercluster
.
deleteCareerCluster
(
newPosition
).
subscribe
(
result
=>
{
swal
(
"ลบสำเร็จ!!"
,
"ลบข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
();
},
error
=>
{
console
.
error
(
"เกิดข้อผิดพลาดในการลบ:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถลบข้อมูลได้"
,
"error"
);
});
}
});
}
new
()
{
this
.
action
=
'add'
;
this
.
selectModel
=
new
CareerClusterModel
();
// this.selectModel.status = 1;
this
.
selectModel
.
careerClusterId
=
""
;
this
.
selectModel
.
thName
=
""
;
this
.
selectModel
.
engName
=
""
;
this
.
selectModel
.
remark
=
""
;
}
view
(
item
:
CareerClusterModel
)
{
this
.
action
=
'edit'
;
this
.
selectModel
=
new
CareerClusterModel
(
item
);
console
.
log
(
this
.
selectModel
);
}
save
()
{
console
.
log
(
'Before Save, selectModel is:'
,
this
.
selectModel
);
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
})
.
then
((
willSave
:
any
)
=>
{
if
(
willSave
)
{
this
.
careercluster
.
postCareerCluster
(
this
.
selectModel
).
subscribe
(
result
=>
{
console
.
log
(
result
);
swal
(
"บันทึกสำเร็จ!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
ngOnInit
();
this
.
childModal
?.
nativeElement
.
click
();
},
error
=>
{
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
}
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
.
careerClusterId
,
this
.
allSelected
);
});
this
.
someSelected
=
this
.
itemsList
.
some
(
item
=>
this
.
selectedItems
.
get
(
item
.
careerClusterId
));
}
onCheckboxChange
(
careerClusterId
:
string
)
{
const
isSelected
=
this
.
selectedItems
.
get
(
careerClusterId
)
||
false
;
this
.
selectedItems
.
set
(
careerClusterId
,
!
isSelected
);
this
.
allSelected
=
this
.
itemsList
.
every
(
item
=>
this
.
selectedItems
.
get
(
item
.
careerClusterId
));
this
.
someSelected
=
this
.
itemsList
.
some
(
item
=>
this
.
selectedItems
.
get
(
item
.
careerClusterId
));
}
deleteSelect
()
{
let
employeeInfo
=
''
;
this
.
selectedItems
.
forEach
((
isSelected
,
careerClusterId
)
=>
{
if
(
isSelected
)
{
const
user
=
this
.
itemsList
.
find
(
user
=>
user
.
careerClusterId
===
careerClusterId
);
if
(
user
)
{
employeeInfo
+=
`
${
this
.
translate
.
instant
(
'thName'
)}
:
${
user
.
thName
}
\n`
;
}
}
});
swal
({
title
:
"Are you sure?"
,
text
:
employeeInfo
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"Cancel"
,
"Yes, Delete it!"
],
})
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
this
.
selectedItems
.
forEach
((
isSelected
,
careerClusterId
)
=>
{
if
(
isSelected
)
{
const
user
=
this
.
itemsList
.
find
(
user
=>
user
.
careerClusterId
===
careerClusterId
);
if
(
user
)
{
const
newPosition
=
new
CareerClusterModel
(
user
)
this
.
careercluster
.
deleteCareerCluster
(
newPosition
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
();
});
}
}
});
}
});
}
// openDialog() {
// this.dialogRef = this.dialog.open(this.CareerClusterModel, {
// width: '1100px',
// disableClose: false,
// });
// }
// closeDialog() {
// this.dialogRef.close()
// }
}
src/app/DPU/models/career-cluster.model.ts
View file @
5795ed21
...
@@ -5,17 +5,20 @@ export interface CareerClusterModel {
...
@@ -5,17 +5,20 @@ export interface CareerClusterModel {
careerClusterId
:
string
careerClusterId
:
string
thName
:
string
thName
:
string
engName
:
string
engName
:
string
remark
:
string
}
}
export
class
CareerClusterModel
extends
BaseModel
implements
CareerClusterModel
{
export
class
CareerClusterModel
extends
BaseModel
implements
CareerClusterModel
{
careerClusterId
:
string
careerClusterId
:
string
thName
:
string
thName
:
string
engName
:
string
engName
:
string
remark
:
string
;
constructor
(
data
?:
Partial
<
CareerClusterModel
>
,
translateService
?:
TranslateService
)
{
constructor
(
data
?:
Partial
<
CareerClusterModel
>
,
translateService
?:
TranslateService
)
{
super
(
data
,
translateService
)
super
(
data
,
translateService
)
this
.
careerClusterId
=
checkData
(
data
?.
careerClusterId
)
this
.
careerClusterId
=
checkData
(
data
?.
careerClusterId
)
this
.
thName
=
checkData
(
data
?.
thName
)
this
.
thName
=
checkData
(
data
?.
thName
)
this
.
engName
=
checkData
(
data
?.
engName
)
this
.
engName
=
checkData
(
data
?.
engName
)
this
.
remark
=
checkData
(
data
?.
remark
)
}
}
getName
()
{
getName
()
{
return
baseGetName
(
this
.
thName
,
this
.
engName
,
this
.
translateService
?.
currentLang
)
return
baseGetName
(
this
.
thName
,
this
.
engName
,
this
.
translateService
?.
currentLang
)
...
...
src/app/DPU/services/career-cluster.service.ts
0 → 100644
View file @
5795ed21
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs'
;
import
{
environment
}
from
"../../../environments/environment"
;
import
{
CompanyModelS
}
from
'../models/companys.mode'
;
import
{
CareerClusterModel
}
from
'../models/career-cluster.model'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
CareerClusterService
{
api
=
"/career-cluster"
urlApi
=
environment
.
baseUrl
+
"/career-cluster"
constructor
(
private
http
:
HttpClient
)
{
}
getById
(
careerClusterId
:
string
):
Observable
<
CareerClusterModel
>
{
return
this
.
http
.
get
<
CareerClusterModel
>
(
this
.
urlApi
+
"/"
+
careerClusterId
)
}
getList
():
Observable
<
CareerClusterModel
[]
>
{
return
this
.
http
.
get
<
CareerClusterModel
[]
>
(
this
.
urlApi
+
"/list"
)
}
postCareerCluster
(
body
:
CareerClusterModel
):
Observable
<
any
>
{
return
this
.
http
.
post
(
this
.
urlApi
,
body
)
}
deleteCareerCluster
(
body
:
CareerClusterModel
)
{
const
options
=
{
headers
:
new
HttpHeaders
({
"Content-Type"
:
"application/json"
,
}),
body
:
body
,
};
return
this
.
http
.
delete
(
this
.
urlApi
,
options
)
}
deleteCareerClusterById
(
careerClusterId
:
string
)
{
const
options
=
{
headers
:
new
HttpHeaders
({
"Content-Type"
:
"application/json"
,
}),
body
:
{
careerClusterId
:
careerClusterId
},
};
return
this
.
http
.
delete
(
this
.
urlApi
,
options
)
}
}
src/app/shared/services/nav.service.ts
View file @
5795ed21
...
@@ -134,6 +134,7 @@ export class NavService implements OnDestroy {
...
@@ -134,6 +134,7 @@ export class NavService implements OnDestroy {
{
path
:
'/admin/degree-manage'
,
title
:
'ทะเบียนระดับวุฒิการศึกษา'
,
type
:
'link'
},
{
path
:
'/admin/degree-manage'
,
title
:
'ทะเบียนระดับวุฒิการศึกษา'
,
type
:
'link'
},
{
path
:
'/admin/job-types'
,
title
:
'จัดการประเภทงาน'
,
type
:
'link'
},
{
path
:
'/admin/job-types'
,
title
:
'จัดการประเภทงาน'
,
type
:
'link'
},
{
path
:
'/admin/provinces'
,
title
:
'จัดการจังหวัด'
,
type
:
'link'
},
{
path
:
'/admin/provinces'
,
title
:
'จัดการจังหวัด'
,
type
:
'link'
},
{
path
:
'/admin/career-cluster'
,
title
:
'จัดการกลุ่มอาชีพ'
,
type
:
'link'
},
],
],
},
},
...
...
src/assets/i18n/en.json
View file @
5795ed21
...
@@ -102,5 +102,7 @@
...
@@ -102,5 +102,7 @@
"Description(ENG)"
:
"Description(ENG)"
,
"Description(ENG)"
:
"Description(ENG)"
,
"JobtypeId"
:
"JobtypeId"
,
"JobtypeId"
:
"JobtypeId"
,
"Degree ID"
:
"Degree ID"
,
"Degree ID"
:
"Degree ID"
,
"Degree"
:
"Degree"
"Degree"
:
"Degree"
,
"Career Cluster Information"
:
"ข้อมูลกลุ่มอาชีพ"
,
"Career Cluster ID"
:
"Career Cluster ID"
}
}
src/assets/i18n/th.json
View file @
5795ed21
...
@@ -102,5 +102,7 @@
...
@@ -102,5 +102,7 @@
"Description(ENG)"
:
"รายละเอียด(อังกฤษ)"
,
"Description(ENG)"
:
"รายละเอียด(อังกฤษ)"
,
"JobtypeId"
:
"รหัสประเภทงาน"
,
"JobtypeId"
:
"รหัสประเภทงาน"
,
"Degree ID"
:
"รหัสระดับการศึกษา"
,
"Degree ID"
:
"รหัสระดับการศึกษา"
,
"Degree"
:
"ระดับการศึกษา"
"Degree"
:
"ระดับการศึกษา"
,
"Career Cluster Information"
:
"ข้อมูลกลุ่มอาชีพ"
,
"Career Cluster ID"
:
"รหัสกลุ่มอาชีพ"
}
}
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