Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myAppraisal
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
myAppraisal
Commits
dee8abcf
Commit
dee8abcf
authored
Feb 24, 2025
by
Nakarin Luankla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPDATE evaluation-cycle-manager
parent
0407d6c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
191 additions
and
50 deletions
+191
-50
define-document-form.component.html
.../define-document-form/define-document-form.component.html
+10
-22
define-document-form.component.ts
...er/define-document-form/define-document-form.component.ts
+7
-3
edit-define-document-form.component.html
...ne-document-form/edit-define-document-form.component.html
+0
-0
edit-define-document-form.component.ts
...fine-document-form/edit-define-document-form.component.ts
+124
-20
evaluation-cycle-manager.component.html
...ion-cycle-manager/evaluation-cycle-manager.component.html
+1
-4
evaluation-cycle-manager.component.ts
...ation-cycle-manager/evaluation-cycle-manager.component.ts
+4
-1
dashboard.module.ts
src/app/components/dashboard/dashboard.module.ts
+2
-0
evaluation-assessment.service.ts
src/app/shared/services/evaluation-assessment.service.ts
+40
-0
evaluation-cycle.service.ts
src/app/shared/services/evaluation-cycle.service.ts
+3
-0
No files found.
src/app/components/competency-assessment/evaluation-cycle-manager/define-document-form/define-document-form.component.html
View file @
dee8abcf
<ng-container
*
ngIf=
"!showFrom"
>
<div
class=
"w-full min-height-50px mb-10px justify-between items-center"
>
<div
class=
"flex justify-between"
>
<div
class=
"flex pr-2"
>
<!-- <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()"
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">Select All</label>
</div>
</div> -->
</div>
<div
class=
"flex justify-end"
>
<div
class=
"px-1"
>
...
...
@@ -111,12 +96,12 @@
</td>
<td
class=
"flex justify-center items-center"
>
<i
*
ngIf=
"item.statusCode.code !== '2'"
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
modalStatus=
'edit'
;
onEdit
()"
></i>
<i
*
ngIf=
"item.statusCode.code !== '2'"
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#define-document-form-delete-modal"
></i>
(
click
)="
modalStatus=
'edit'
;
onEdit
(
item
)"
></i>
<
!-- <
i *ngIf="item.statusCode.code !== '2'" class="ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#define-document-form-delete-modal"></i>
-->
<span
*
ngIf=
"item.statusCode.code !== '2'"
class=
"badge text-white m-1 cursor-pointer bg-primary"
(
click
)="
basicAlert3
()"
>
สร้างแบบฟอร์ม
</span>
<
!-- <
span *ngIf="item.statusCode.code !== '2'" class="badge text-white m-1 cursor-pointer bg-primary"
(click)="basicAlert3()">สร้างแบบฟอร์ม</span>
-->
</td>
</tr>
...
...
@@ -162,7 +147,7 @@
</ul>
</nav>
</div>
</ng-container>
<div
id=
"define-document-form-modal"
class=
"hs-overlay hidden ti-modal "
>
<div
class=
" ti-modal-box ease-out modal-md"
>
...
...
@@ -329,4 +314,7 @@
</div>
</div>
<ng-container
*
ngIf=
"showFrom"
>
<app-edit-define-document-form
[
evaluationRound
]="
evaluationRound
"
(
showFrom
)="
showFrom=
$event"
></app-edit-define-document-form>
</ng-container>
src/app/components/competency-assessment/evaluation-cycle-manager/define-document-form/define-document-form.component.ts
View file @
dee8abcf
...
...
@@ -26,8 +26,9 @@ export interface DataModel {
styleUrls
:
[
'./define-document-form.component.scss'
],
})
export
class
DefineDocumentFormComponent
{
[
x
:
string
]:
any
;
@
Output
()
sendGroupShow
:
EventEmitter
<
string
>
=
new
EventEmitter
<
string
>
();
// @Output() evaluationRound: EventEmitter<DataModel> = new EventEmitter<DataModel>();
currentPage
=
1
;
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
search
=
''
;
...
...
@@ -36,6 +37,8 @@ export class DefineDocumentFormComponent {
isDataListCheckedAll
=
false
;
modalStatus
:
'add'
|
'edit'
=
'add'
;
evaluation_cyclelist
:
DataModel
[]
=
[]
evaluationRound
?:
DataModel
showFrom
=
false
constructor
(
private
cdr
:
ChangeDetectorRef
,
private
swalService
:
SwalService
,
...
...
@@ -43,8 +46,9 @@ export class DefineDocumentFormComponent {
private
toastr
:
ToastrService
)
{}
onEdit
()
{
this
.
sendGroupShow
.
emit
(
'2'
);
onEdit
(
evaluationRound
:
DataModel
)
{
this
.
evaluationRound
=
evaluationRound
;
this
.
showFrom
=
true
}
ngOnInit
():
void
{
this
.
getEvaluationCycleList
();
...
...
src/app/components/competency-assessment/evaluation-cycle-manager/define-document-form/edit-define-document-form/edit-define-document-form.component.html
View file @
dee8abcf
This diff is collapsed.
Click to expand it.
src/app/components/competency-assessment/evaluation-cycle-manager/define-document-form/edit-define-document-form/edit-define-document-form.component.ts
View file @
dee8abcf
import
{
Component
,
ElementRef
,
EventEmitter
,
Input
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
C
hangeDetectorRef
,
C
omponent
,
ElementRef
,
EventEmitter
,
Input
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
StatusCodeModel
}
from
'src/app/shared/model/status-code.model'
;
import
{
EvaluationAssessmentService
}
from
'src/app/shared/services/evaluation-assessment.service'
;
import
{
EvaluationCycleService
}
from
'src/app/shared/services/evaluation-cycle.service'
;
export
interface
DataModel
{
evaluationRoundId
:
string
;
tdesc
:
string
;
edesc
:
string
;
apsyear
:
string
;
apsPeriodStart
:
string
;
apsPeriodEnd
:
string
;
statusCode
:
StatusCodeModel
;
}
@
Component
({
selector
:
'app-edit-define-document-form'
,
templateUrl
:
'./edit-define-document-form.component.html'
,
styleUrls
:
[
'./edit-define-document-form.component.scss'
]
})
export
class
EditDefineDocumentFormComponent
{
@
ViewChild
(
'modalEdit'
)
modalEdit
!
:
ElementRef
;
@
Input
()
pathTitle
=
[
'การประเมินสมรรถนะ'
,
'การจัดการสมรรถนะ'
,
'จัดกลุ่มสมรรถนะ'
];
@
Output
()
sendPathTitle
:
EventEmitter
<
string
[]
>
=
new
EventEmitter
<
string
[]
>
();
@
Output
()
sendGroupShow
:
EventEmitter
<
string
>
=
new
EventEmitter
<
string
>
();
activeTab
:
string
=
'tab1'
;
// กำหนด tab เริ่มต้น
@
Input
()
evaluationRound
?:
DataModel
;
@
Output
()
showFrom
:
EventEmitter
<
boolean
>
=
new
EventEmitter
<
boolean
>
();
currentPage
=
1
;
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
currentModal
=
""
;
search
=
''
;
assessmentList
:
any
[]
=
[]
loadingAssess
=
false
// ฟังก์ชันในการเปลี่ยนแท็บ
changeTab
(
tab
:
{
id
:
string
,
text
:
string
})
{
this
.
sendPathTitle
.
emit
([
'การประเมินสมรรถนะ'
,
'การจัดการสมรรถนะ'
,
tab
.
text
]);
this
.
activeTab
=
tab
.
id
;
evaluationRoundId
=
""
apsassessy
=
""
constructor
(
private
toastr
:
ToastrService
,
private
evaluationAssessmentService
:
EvaluationAssessmentService
,
private
cdr
:
ChangeDetectorRef
)
{
}
ngOnInit
():
void
{
if
(
this
.
evaluationRound
){
this
.
getEvaluationCycleList
()
}
}
saveAssessmentList
(){
let
body
=
this
.
assessmentList
.
filter
(
x
=>
x
.
active
==
true
)
if
(
body
.
length
>
0
){
this
.
evaluationAssessmentService
.
postList
(
body
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getEvaluationCycleList
()
}
else
{
}
}
})
}
else
{
this
.
showAlert
(
'ไม่พบรายการ'
,
'error'
)
}
}
getApsassessy
(){
this
.
loadingAssess
=
true
this
.
evaluationAssessmentService
.
getApsassessy
(
this
.
evaluationRoundId
,
this
.
apsassessy
).
subscribe
({
next
:
response
=>
{
this
.
loadingAssess
=
false
this
.
cdr
.
detectChanges
();
},
error
:
err
=>
{
this
.
loadingAssess
=
false
console
.
error
(
'Error fetching evaluation cycles:'
,
err
);
}
})
}
searchChange
()
{
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
assessmentListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
getEvaluationCycleList
()
{
this
.
evaluationAssessmentService
.
getById
(
this
.
evaluationRound
!
.
evaluationRoundId
).
subscribe
({
next
:
response
=>
{
this
.
assessmentList
=
response
this
.
cdr
.
detectChanges
();
},
error
:
err
=>
{
console
.
error
(
'Error fetching evaluation cycles:'
,
err
);
}
});
}
assessmentListFilter
(){
return
this
.
assessmentList
.
filter
(
x
=>
x
.
apsassessy
.
fname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsassessy
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsassessy
.
efname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsassessy
.
elname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsassessy
.
employeeId
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
)
}
onBack
()
{
this
.
s
endGroupShow
.
emit
(
'1'
);
// เปลี่ยนกลับไปหน้า 1
this
.
s
howFrom
.
emit
(
false
);
}
// การจัดการการเปิดปิด modal
modalOptions
:
{
...
...
@@ -40,15 +122,35 @@ export class EditDefineDocumentFormComponent {
backdropClose
:
true
,
}
};
openEdit
()
{
const
modalElement
=
this
.
modalEdit
.
nativeElement
;
openModalTest
(
id
:
string
)
{
document
.
getElementById
(
id
)?.
classList
.
add
(
'open'
);
document
.
getElementById
(
id
)?.
classList
.
remove
(
'hidden'
);
setTimeout
(()
=>
{
modalElement
.
setAttribute
(
'aria-overlay'
,
'false'
);
document
.
getElementById
(
id
)?.
setAttribute
(
'aria-overlay'
,
'true'
)
document
.
getElementById
(
id
)?.
setAttribute
(
'tabindex'
,
'0'
)
},
10
);
console
.
log
(
"🚀 ~ EditDefineDocumentFormComponent ~ openModalTest ~ document.getElementById(id):"
,
document
.
getElementById
(
id
))
}
openEdit
(
evaluationRoundId
:
string
,
apsassessy
:
string
)
{
if
(
evaluationRoundId
&&
apsassessy
){
const
modalElement
=
this
.
modalEdit
.
nativeElement
;
setTimeout
(()
=>
{
modalElement
.
setAttribute
(
'aria-overlay'
,
'false'
);
console
.
log
(
"🚀 ~ EditDefineDocumentFormComponent ~ openEdit ~ modalElement:"
,
modalElement
)
},
10
);
this
.
evaluationRoundId
=
evaluationRoundId
this
.
apsassessy
=
apsassessy
this
.
getApsassessy
()
}
}
dataListCheck
(){
console
.
log
(
this
.
assessmentList
);
}
openModal
(
name
:
string
,
size
:
string
,
closeOnBackdrop
?:
boolean
)
{
this
.
modalOptions
[
name
].
modalSize
=
size
;
this
.
modalOptions
[
name
].
backdropClose
=
closeOnBackdrop
||
false
;
...
...
@@ -79,10 +181,12 @@ export class EditDefineDocumentFormComponent {
addUser
()
{
}
currentModal
=
""
;
constructor
(
private
toastr
:
ToastrService
)
{
}
showAlert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
this
.
toastr
[
type
](
text
,
'แจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
showSuccess
()
{
this
.
toastr
.
success
(
'บันทึกข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
...
...
src/app/components/competency-assessment/evaluation-cycle-manager/evaluation-cycle-manager.component.html
View file @
dee8abcf
...
...
@@ -28,10 +28,7 @@
</div>
<div
id=
"underline-2"
role=
"tabpanel"
aria-labelledby=
"underline-item-2"
*
ngIf=
"activeTab === 'underline-2'"
>
<app-define-document-form
*
ngIf=
"groupShow=='1'"
(
sendGroupShow
)="
groupShow=
$event"
></app-define-document-form>
<app-edit-define-document-form
*
ngIf=
"groupShow=='2'"
(
sendGroupShow
)="
groupShow=
$event"
></app-edit-define-document-form>
<app-define-document-form
*
ngIf=
"groupShow=='1'"
(
sendGroupShow
)="
groupShow=
$event"
></app-define-document-form>
</div>
</div>
...
...
src/app/components/competency-assessment/evaluation-cycle-manager/evaluation-cycle-manager.component.ts
View file @
dee8abcf
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
StatusCodeModel
}
from
'src/app/shared/model/status-code.model'
;
@
Component
({
selector
:
'app-evaluation-cycle-manager'
,
templateUrl
:
'./evaluation-cycle-manager.component.html'
,
styleUrls
:
[
'./evaluation-cycle-manager.component.scss'
]
})
export
class
EvaluationCycleManagerComponent
{
@
Input
()
pathTitle
=
[
'การประเมินสมรรถนะ'
,
'การจัดการรอบการประเมิน'
,
'รอบการประเมิน'
]
activeTab
:
string
=
'underline-
1
'
;
// Tab แรกแสดงเป็นค่าเริ่มต้น
activeTab
:
string
=
'underline-
2
'
;
// Tab แรกแสดงเป็นค่าเริ่มต้น
groupShow
=
'1'
}
\ No newline at end of file
src/app/components/dashboard/dashboard.module.ts
View file @
dee8abcf
...
...
@@ -150,6 +150,7 @@ import { PmsGradeRegistrationComponent } from '../performance-management-evaluat
import
{
PmsGradeManagementComponent
}
from
'../performance-management-evaluation/pms-grade-registration/pms-grade-management/pms-grade-management.component'
;
import
{
PmsSubGradeRegistrationComponent
}
from
'../performance-management-evaluation/pms-grade-registration/pms-grade-management/pms-sub-grade-registration/pms-sub-grade-registration.component'
;
import
{
PmsGroupGradeComponent
}
from
'../performance-management-evaluation/pms-grade-registration/pms-grade-management/pms-group-grade/pms-group-grade.component'
;
import
{
EvaluationAssessmentService
}
from
'src/app/shared/services/evaluation-assessment.service'
;
export
const
MY_DATE_FORMATS
=
{
parse
:
{
...
...
@@ -330,6 +331,7 @@ export class CustomDateAdapter extends NativeDateAdapter {
PmsMasfromEvaluationCycleService
,
PmsGroupGradeService
,
PmsSettingAssessmentService
,
EvaluationAssessmentService
,
{
provide
:
HTTP_INTERCEPTORS
,
useClass
:
HttpRequestInterceptor
,
...
...
src/app/shared/services/evaluation-assessment.service.ts
0 → 100644
View file @
dee8abcf
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs'
;
import
{
environment
}
from
'src/environments/environment'
;
import
{
AlertModel
}
from
'../model/alert.model'
;
import
{
EvaluationCycleModel
}
from
'../model/evaluation-cycle.model'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
EvaluationAssessmentService
{
api
=
"/evaluation-assessment"
urlApi
=
environment
.
baseUrl
+
this
.
api
constructor
(
private
http
:
HttpClient
)
{
}
getList
():
Observable
<
EvaluationCycleModel
[]
>
{
return
this
.
http
.
get
<
EvaluationCycleModel
[]
>
(
this
.
urlApi
+
"/lists"
)
}
getById
(
evaluationRoundId
:
string
):
Observable
<
any
[]
>
{
return
this
.
http
.
get
<
any
[]
>
(
this
.
urlApi
+
"/"
+
evaluationRoundId
)
}
getApsassessy
(
evaluationRoundId
:
string
,
apsassessy
:
string
):
Observable
<
EvaluationCycleModel
>
{
return
this
.
http
.
get
<
EvaluationCycleModel
>
(
this
.
urlApi
+
"/"
+
evaluationRoundId
+
"/"
+
apsassessy
)
}
post
(
body
:
EvaluationCycleModel
):
Observable
<
AlertModel
>
{
return
this
.
http
.
post
<
AlertModel
>
(
this
.
urlApi
,
body
)
}
postList
(
body
:
any
[]):
Observable
<
AlertModel
>
{
return
this
.
http
.
post
<
AlertModel
>
(
this
.
urlApi
+
"/create-list"
,
body
)
}
delete
(
body
:
EvaluationCycleModel
|
EvaluationCycleModel
[]):
Observable
<
AlertModel
>
{
const
options
=
{
headers
:
new
HttpHeaders
({
"Content-Type"
:
"application/json"
,
}),
body
:
body
};
return
this
.
http
.
delete
<
AlertModel
>
(
this
.
urlApi
,
options
)
}
}
src/app/shared/services/evaluation-cycle.service.ts
View file @
dee8abcf
...
...
@@ -19,6 +19,9 @@ export class EvaluationCycleService {
getById
(
evaluationRoundId
:
string
):
Observable
<
EvaluationCycleModel
>
{
return
this
.
http
.
get
<
EvaluationCycleModel
>
(
this
.
urlApi
+
"/"
+
evaluationRoundId
)
}
getApsassessy
(
evaluationRoundId
:
string
,
apsassessy
:
string
):
Observable
<
EvaluationCycleModel
>
{
return
this
.
http
.
get
<
EvaluationCycleModel
>
(
this
.
urlApi
+
"/"
+
evaluationRoundId
+
"/"
+
apsassessy
)
}
post
(
body
:
EvaluationCycleModel
):
Observable
<
AlertModel
>
{
return
this
.
http
.
post
<
AlertModel
>
(
this
.
urlApi
,
body
)
}
...
...
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