Commit 4ad5679c by Nattana Chaiyamat

การจัดการตัวชี้วัดเเละหลักสูตร

parent f9cc9cf9
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
</div> </div>
</div> </div>
<div class="flex justify-end"> <div class="flex justify-end">
<div class="px-1"> <div class="px-1" *ngIf="!seeTab">
<button type="button" class="ti-btn ti-btn-soft-success h-45px m-0 shadow-md" <button type="button" class="ti-btn ti-btn-soft-success h-45px m-0 shadow-md"
data-hs-overlay="#edit-group-indicators-alert-modal"> data-hs-overlay="#edit-group-indicators-alert-modal">
<i class="ri-save-3-line"></i> <i class="ri-save-3-line"></i>
Save Save
</button> </button>
</div> </div>
<div class="px-1"> <div class="px-1" *ngIf="!seeTab">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md" (click)="clearDataList()"> <button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md" (click)="clearDataList()">
<svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00" <svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00"
xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84"
...@@ -63,11 +63,12 @@ ...@@ -63,11 +63,12 @@
</div> </div>
<div class="space-y-2"> <div class="space-y-2">
<label class="ti-form-label">ชื่อสมรรถนะ</label> <label class="ti-form-label">ชื่อสมรรถนะ</label>
<textarea type="text" rows="2" class="ti-form-input" [(ngModel)]="indicatorsCourses.tdesc"> </textarea> <textarea type="text" rows="2" class="ti-form-input bg-input-readonly" readonly
[(ngModel)]="indicatorsCourses.tdesc"> </textarea>
</div> </div>
<div class="space-y-2"> <div class="space-y-2">
<label class="ti-form-label">นิยามสมรรถนะ</label> <label class="ti-form-label">นิยามสมรรถนะ</label>
<textarea type="text" rows="3" class="ti-form-input" <textarea type="text" rows="3" class="ti-form-input bg-input-readonly" readonly
[(ngModel)]="indicatorsCourses.indicatorsCourseDetailTh"></textarea> [(ngModel)]="indicatorsCourses.indicatorsCourseDetailTh"></textarea>
</div> </div>
</div> </div>
...@@ -80,7 +81,7 @@ ...@@ -80,7 +81,7 @@
<thead class="height-50px"> <thead class="height-50px">
<tr class="font-size-12px"> <tr class="font-size-12px">
<ng-container <ng-container
*ngFor="let item of ['รหัสความคาดหวัง','ตัวชี้วัดพฤติกรรม','เครื่องมือประเมิน','หลักสูตร']; let f = first; let l = last"> *ngFor="let item of ['ระดับความคาดหวัง','ตัวชี้วัดพฤติกรรม','เครื่องมือประเมิน','หลักสูตร']; let f = first; let l = last">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l"> [class.!text-center]="f||l">
<span class="font-size-12px font-weight-700">{{ item }}</span> <span class="font-size-12px font-weight-700">{{ item }}</span>
...@@ -118,7 +119,7 @@ ...@@ -118,7 +119,7 @@
</a> </a>
</div> </div>
</div> </div>
<div class="col-span-1 text-center align-center"> <div class="col-span-1 text-center align-center" *ngIf="!seeTab">
<div class="ciricon border cursor-pointer" <div class="ciricon border cursor-pointer"
(click)="dataSelect=data;dataSelectIndex=i;behaviorIndicatorsSelectIndex=l;deleteBehaviorIndicators()"> (click)="dataSelect=data;dataSelectIndex=i;behaviorIndicatorsSelectIndex=l;deleteBehaviorIndicators()">
<i class="ri-close-line text-red-500"></i> <i class="ri-close-line text-red-500"></i>
...@@ -126,7 +127,7 @@ ...@@ -126,7 +127,7 @@
</div> </div>
</span> </span>
</div> </div>
<div class="flex rounded-md"> <div class="flex rounded-md" *ngIf="!seeTab">
<input type="text" <input type="text"
class="ti-form-input rounded-none ltr:rounded-l-md rtl:rounded-r-md focus:z-10" class="ti-form-input rounded-none ltr:rounded-l-md rtl:rounded-r-md focus:z-10"
[(ngModel)]="data.behaviorIndicators[data.behaviorIndicators.length-1]"> [(ngModel)]="data.behaviorIndicators[data.behaviorIndicators.length-1]">
...@@ -159,6 +160,7 @@ ...@@ -159,6 +160,7 @@
</div> </div>
</a> </a>
<div class="ciricon flex text-start items-center cursor-pointer" <div class="ciricon flex text-start items-center cursor-pointer"
*ngIf="!seeTab"
(click)="assessmentToolsSelectIndex=[l,m];deleteAssessmentTools()"> (click)="assessmentToolsSelectIndex=[l,m];deleteAssessmentTools()">
<i class="ri-close-line text-red-500"></i> <i class="ri-close-line text-red-500"></i>
</div> </div>
...@@ -174,13 +176,14 @@ ...@@ -174,13 +176,14 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
</button> </button>
<button type="button" class="flex text-start items-center cursor-default"> <button type="button" class="flex text-start items-center cursor-default"
*ngIf="!seeTab">
<i class="ti ti-circle-plus text-green-500 cursor-pointer" <i class="ti ti-circle-plus text-green-500 cursor-pointer"
(click)="dataSelectIndex=i;dataSelect=data;assessmentToolsSelectIndex=[l,data.assessmentTools.length]" (click)="dataSelectIndex=i;dataSelect=data;assessmentToolsSelectIndex=[l,data.assessmentTools.length]"
data-hs-overlay="#assessment-tools-modal"></i> data-hs-overlay="#assessment-tools-modal"></i>
</button> </button>
</span> </span>
<button *ngIf="!data.assessmentTools.length" type="button" <button *ngIf="!data.assessmentTools.length&&!seeTab" type="button"
class="flex text-start items-center cursor-default"> class="flex text-start items-center cursor-default">
<i class="ti ti-circle-plus text-green-500 cursor-pointer" <i class="ti ti-circle-plus text-green-500 cursor-pointer"
(click)="dataSelectIndex=i;dataSelect=data;assessmentToolsSelectIndex=[0,data.assessmentTools.length]" (click)="dataSelectIndex=i;dataSelect=data;assessmentToolsSelectIndex=[0,data.assessmentTools.length]"
...@@ -190,7 +193,7 @@ ...@@ -190,7 +193,7 @@
</td> </td>
<td class="items-center justify-center"> <td class="items-center justify-center">
<div class="flex items-center w-full space-x-2"> <div class="flex items-center w-full space-x-2">
<i class="ti ti ti-book cursor-pointer i-gray px-1" style="font-size: 28px;" <i *ngIf="!seeTab" class="ti ti ti-book cursor-pointer i-gray px-1" style="font-size: 28px;"
(click)="dataSelectIndex=i" data-hs-overlay="#curriculum-modal"></i> (click)="dataSelectIndex=i" data-hs-overlay="#curriculum-modal"></i>
<div class="flex flex-col flex-grow" *ngIf="data.curriculum.length"> <div class="flex flex-col flex-grow" *ngIf="data.curriculum.length">
<div class="grid grid-cols-1 gap-1"> <div class="grid grid-cols-1 gap-1">
...@@ -209,7 +212,7 @@ ...@@ -209,7 +212,7 @@
</div> </div>
</span> </span>
<div class="col-span-1 flex justify-end items-center "> <div class="col-span-1 flex justify-end items-center " *ngIf="!seeTab">
<div class="ciricon border cursor-pointer" <div class="ciricon border cursor-pointer"
(click)="dataSelectIndex=i;curriculumSelectIndex=l;deleteCurriculumList()"> (click)="dataSelectIndex=i;curriculumSelectIndex=l;deleteCurriculumList()">
<i class="ri-close-line text-red-500"></i> <i class="ri-close-line text-red-500"></i>
......
...@@ -33,6 +33,7 @@ export interface CurriculumModal { ...@@ -33,6 +33,7 @@ export interface CurriculumModal {
}) })
export class EditGroupIndicators implements OnInit { export class EditGroupIndicators implements OnInit {
@Input() competencytopic: CompetencytopicModel = new MyCompetencytopicModel({}) @Input() competencytopic: CompetencytopicModel = new MyCompetencytopicModel({})
@Input() seeTab = false
indicatorsCourses: IndicatorsCoursesModel = new MyIndicatorsCoursesModel({}) indicatorsCourses: IndicatorsCoursesModel = new MyIndicatorsCoursesModel({})
@Output() sendEdit: EventEmitter<boolean> = new EventEmitter<boolean>(); @Output() sendEdit: EventEmitter<boolean> = new EventEmitter<boolean>();
search = "" search = ""
......
<ng-container *ngIf="!editTab"> <ng-container *ngIf="!editTab&&!seeTab">
<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-end"> <div class="flex justify-end">
<div class="px-1"> <div class="px-1">
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<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>
<ng-container *ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเมิน','การจัดการ']; let f = first; let l = last"> <ng-container *ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','การจัดการ']; let f = first; let l = last">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center"> <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span> <span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l"> <div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
...@@ -69,10 +69,12 @@ ...@@ -69,10 +69,12 @@
<td>{{item.name}}</td> <td>{{item.name}}</td>
<td class="text-center">{{item.type}}</td> <td class="text-center">{{item.type}}</td>
<td class="flex justify-center"> <td class="flex justify-center">
<i class="ti ti-eye cursor-pointer i-gray fs-l px-1"></i> <i class="ti ti-eye cursor-pointer i-gray fs-l px-1"
(click)="selectIndicatorsCourses(item);seeTab=true;editTab=false;pathTitleChange()"></i>
<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)="selectIndicatorsCourses(item);editTab=true;pathTitleChange()"></i> (click)="selectIndicatorsCourses(item);seeTab=false;editTab=true;pathTitleChange()"></i>
<i class="ti ti-file-download cursor-pointer i-gray fs-l px-1"></i> <i *ngIf="item.file" class="ti ti-file-download cursor-pointer i-gray fs-l px-1"
(click)="dowloadExam(item.file)"></i>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -119,9 +121,9 @@ ...@@ -119,9 +121,9 @@
</ng-container> </ng-container>
<ng-container *ngIf="editTab"> <ng-container *ngIf="editTab||seeTab">
<app-edit-group-indicators [competencytopic]="indicatorsCourses" <app-edit-group-indicators [competencytopic]="indicatorsCourses" [seeTab]="seeTab"
(sendEdit)="editTab=$event;pathTitleChange()"></app-edit-group-indicators> (sendEdit)="editTab=$event;pathTitleChange()" (sendEdit)="seeTab=$event"></app-edit-group-indicators>
</ng-container> </ng-container>
......
...@@ -7,6 +7,7 @@ export interface DataModel { ...@@ -7,6 +7,7 @@ export interface DataModel {
code: string, code: string,
name: string, name: string,
type: string type: string
file: string
} }
@Component({ @Component({
selector: 'app-indicators-and-curriculum', selector: 'app-indicators-and-curriculum',
...@@ -16,6 +17,7 @@ export interface DataModel { ...@@ -16,6 +17,7 @@ export interface DataModel {
export class IndicatorsAndCurriculumComponent { export class IndicatorsAndCurriculumComponent {
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>(); @Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
editTab = false editTab = false
seeTab = false
currentPage = 1 currentPage = 1
search = "" search = ""
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
...@@ -35,6 +37,25 @@ export class IndicatorsAndCurriculumComponent { ...@@ -35,6 +37,25 @@ export class IndicatorsAndCurriculumComponent {
this.pathTitleChange() this.pathTitleChange()
} }
dowloadExam(fileName: string) {
this.fileService.dowloadFiles(fileName).subscribe({
next: response => {
const url = window.URL.createObjectURL(response);
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
this.cdr.detectChanges()
}, error: error => {
this.showAlert(error.message, 'error')
this.cdr.detectChanges()
}
})
}
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;
this.selectedFileName = this.selectedFile?.name || "กรุณาเลือกไฟล์" this.selectedFileName = this.selectedFile?.name || "กรุณาเลือกไฟล์"
...@@ -98,7 +119,7 @@ export class IndicatorsAndCurriculumComponent { ...@@ -98,7 +119,7 @@ export class IndicatorsAndCurriculumComponent {
this.dataLoading = true this.dataLoading = true
this.competencytopicService.getList().subscribe({ this.competencytopicService.getList().subscribe({
next: response => { next: response => {
this.dataList = response.map(x => ({ code: x.competencyTopicId, name: x.tdesc, type: x.competencyType.tdesc })) this.dataList = response.map(x => ({ code: x.competencyTopicId, name: x.tdesc, type: x.competencyType.tdesc, file: x.competencyFiles || "" }))
this.indicatorsCoursesList = response this.indicatorsCoursesList = response
this.dataLoading = false this.dataLoading = false
this.searchChange() this.searchChange()
...@@ -125,7 +146,7 @@ export class IndicatorsAndCurriculumComponent { ...@@ -125,7 +146,7 @@ export class IndicatorsAndCurriculumComponent {
dataListFilter() { dataListFilter() {
return this.dataList.filter(x => { return this.dataList.filter(x => {
const match = x.code.includes(this.search) || x.name.includes(this.search); const match = x.code.toLowerCase().includes(this.search.toLowerCase()) || x.name.toLowerCase().includes(this.search.toLowerCase());
return match; return match;
}); });
} }
......
...@@ -107,6 +107,7 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -107,6 +107,7 @@ export class SelfEvaluationComponent implements OnInit {
this.appraisalService.getFormCompentencyById(this.appraisalCompentency.select.masfromEvaluationRoundModel.evaluationRoundId, this.employee.data.employeeId).subscribe({ this.appraisalService.getFormCompentencyById(this.appraisalCompentency.select.masfromEvaluationRoundModel.evaluationRoundId, this.employee.data.employeeId).subscribe({
next: response => { next: response => {
this.appraisalCompentencyForm.data = new MyAppraisalFormModel(response) this.appraisalCompentencyForm.data = new MyAppraisalFormModel(response)
this.appraisalCompentencyForm.data = response
this.calnumberCheck() this.calnumberCheck()
this.appraisalCompentencyForm.loading = false this.appraisalCompentencyForm.loading = false
this.cdr.detectChanges() this.cdr.detectChanges()
...@@ -160,7 +161,7 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -160,7 +161,7 @@ export class SelfEvaluationComponent implements OnInit {
}, },
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
const body = new MyAppraisalFormModel({ ...this.appraisalCompentencyForm.data, apsassessyStatus: '1' }) const body = { ...this.appraisalCompentencyForm.data, apsassessyStatus: '2' }
this.appraisalService.postCompetency(body).subscribe({ this.appraisalService.postCompetency(body).subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
...@@ -238,7 +239,7 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -238,7 +239,7 @@ export class SelfEvaluationComponent implements OnInit {
}, },
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
const body = new MyAppraisalFormModel({ ...this.appraisalCompentencyForm.data, apsassessyStatus: '2' }) const body = { ...this.appraisalCompentencyForm.data, apsassessyStatus: '2' }
this.appraisalService.postCompetency(body).subscribe({ this.appraisalService.postCompetency(body).subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
...@@ -291,11 +292,11 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -291,11 +292,11 @@ export class SelfEvaluationComponent implements OnInit {
} }
calnumberCheck() { calnumberCheck() {
this.appraisalCompentencyForm.data.numberCheck1 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map(x => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter(y => y.competencyBehavioral.scoreTopicExpectation == 1).length).reduce((acc, num) => acc + num, 0) this.appraisalCompentencyForm.data.numberCheck1 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 1).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyForm.data.numberCheck2 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map(x => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter(y => y.competencyBehavioral.scoreTopicExpectation == 2).length).reduce((acc, num) => acc + num, 0) this.appraisalCompentencyForm.data.numberCheck2 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 2).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyForm.data.numberCheck3 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map(x => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter(y => y.competencyBehavioral.scoreTopicExpectation == 3).length).reduce((acc, num) => acc + num, 0) this.appraisalCompentencyForm.data.numberCheck3 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 3).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyForm.data.numberCheck4 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map(x => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter(y => y.competencyBehavioral.scoreTopicExpectation == 4).length).reduce((acc, num) => acc + num, 0) this.appraisalCompentencyForm.data.numberCheck4 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 4).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyForm.data.numberCheck5 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map(x => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter(y => y.competencyBehavioral.scoreTopicExpectation == 5).length).reduce((acc, num) => acc + num, 0) this.appraisalCompentencyForm.data.numberCheck5 = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 5).length).reduce((acc: any, num: any) => acc + num, 0)
this.calWeightTotal() this.calWeightTotal()
this.cdr.detectChanges() this.cdr.detectChanges()
...@@ -327,7 +328,7 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -327,7 +328,7 @@ export class SelfEvaluationComponent implements OnInit {
this.calAverageScore() this.calAverageScore()
} }
calAverageScore() { calAverageScore() {
const total = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map(x => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.length).reduce((acc, num) => acc + num, 0) * 5 const total = this.appraisalCompentencyForm.data.masfromEvaluationAssessment1lList.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.length).reduce((acc: any, num: any) => acc + num, 0) * 5
if (total) { if (total) {
this.appraisalCompentencyForm.data.averageScore = 0 this.appraisalCompentencyForm.data.averageScore = 0
this.appraisalCompentencyForm.data.averageScore = (this.appraisalCompentencyForm.data.weightedTotal / total) * 100 this.appraisalCompentencyForm.data.averageScore = (this.appraisalCompentencyForm.data.weightedTotal / total) * 100
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment