Commit 396dec01 by Nattana Chaiyamat

แก้ไข Individual KPI ตัวเอง

parent 9bae4e07
......@@ -27,7 +27,7 @@
[dataSource]="indicatorsCoursesList" [checkBoxSetting]="false" [columns]="columns" [childView]="true"
[canDownload]="true" (sendNextPageView)="onViewClicked($event)"
(sendSelectData)="selectIndicatorsCourses($event); onEditClicked($event)"
(sendFileDownload)="dowloadExam($event)">
(sendFileDownload)="downloadExam($event)">
</app-datagrid-syncfution>
</div>
</ng-container>
......
......@@ -63,8 +63,8 @@ export class IndicatorsAndCurriculumComponent {
this.getIndicatorsCoursesList()
}
dowloadExam(data: CompetencytopicModel) {
this.fileService.dowloadFiles(data.competencyFiles).subscribe({
downloadExam(data: CompetencytopicModel) {
this.fileService.downloadFiles(data.competencyFiles).subscribe({
next: response => {
const url = window.URL.createObjectURL(response);
const a = document.createElement("a");
......
......@@ -124,7 +124,7 @@
<div class="flex" *ngIf="examFileName==competencyTopic.select.competencyFiles">
<h1 class="cursor-pointer justify-center -mb-px inline-flex items-center gap-2 font-weight-500 font-size-12px
text-center text-secondary border-secondary border-b-2 align-items-end"
(click)="dowloadExam(examFileName)">
(click)="downloadExam(examFileName)">
ดาวน์โหลดไฟล์ข้อสอบ</h1>
</div>
</mat-dialog-content>
......
......@@ -102,12 +102,12 @@ export class CompetencyTopic implements OnInit {
private cdr: ChangeDetectorRef,
private fileService: FileService,
private competencytopicService: CompetencytopicService,
// private competencytypeService: CompetencytypeService,
private competencytypeService: CompetencytypeService,
private tokenService: TokenService
) { }
ngOnInit(): void {
this.getCompetencytopicList()
// this.getCompetencytypeList()
this.getCompetencytypeList()
}
onExamSelected(event: any) {
......@@ -140,8 +140,8 @@ export class CompetencyTopic implements OnInit {
dowloadExam(fileName: string) {
this.fileService.dowloadFiles(fileName).subscribe({
downloadExam(fileName: string) {
this.fileService.downloadFiles(fileName).subscribe({
next: response => {
const url = window.URL.createObjectURL(response);
const a = document.createElement("a");
......@@ -176,7 +176,7 @@ export class CompetencyTopic implements OnInit {
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
// this.getCompetencytypeList()
this.getCompetencytypeList()
this.getCompetencytopicList()
} else {
this.showAlert(response.message, 'error')
......@@ -211,23 +211,20 @@ export class CompetencyTopic implements OnInit {
}
getCompetencytypeList() {
// this.competencytypeListLoading = true
// this.selectedItems.data.clear()
// this.competencytypeService.getList().subscribe({
// next: response => {
// this.typeList = response.map(x => {
// this.selectedItems.data.set(x.competencyTypeId, false)
// return new MyCompetencytypeModel(x)
// })
// this.selectedItems.key = 'competencyTypeId'
// this.selectedItems.count = 0
// this.competencytypeListLoading = false
// this.cdr.detectChanges()
// }, error: error => {
// this.competencytypeListLoading = false
// this.cdr.detectChanges()
// }
// })
this.competencytypeListLoading = true
this.selectedItems.data.clear()
this.competencytypeService.getList().subscribe({
next: response => {
this.typeList = response.map(x => {
return new MyCompetencytypeModel(x)
})
this.competencytypeListLoading = false
this.cdr.detectChanges()
}, error: error => {
this.competencytypeListLoading = false
this.cdr.detectChanges()
}
})
}
......@@ -292,7 +289,7 @@ export class CompetencyTopic implements OnInit {
next: response => {
if (response.success) {
this.showAlert(response.message, 'success');
// this.getCompetencytypeList();
this.getCompetencytypeList();
this.getCompetencytopicList();
this.closeDialog()
} else {
......@@ -355,7 +352,7 @@ export class CompetencyTopic implements OnInit {
this.competencyTopic.loading = false;
if (response.success) {
this.showAlert(response.message, 'success');
// this.getCompetencytypeList();
this.getCompetencytypeList();
this.getCompetencytopicList();
} else {
this.showAlert(response.message, 'error');
......@@ -370,7 +367,7 @@ export class CompetencyTopic implements OnInit {
});
}
});
}
}
showAlert(text: string, type: 'success' | 'error') {
......
......@@ -12,7 +12,7 @@ export class FileService {
uploadFiles(formData: any): Observable<AlertModel> {
return this.http.post<AlertModel>(environment.baseUrl + '/files/upload', formData)
}
dowloadFiles(filename: string) {
downloadFiles(filename: string) {
return this.http.get(environment.baseUrl + '/files/download/' + filename, { responseType: "blob" })
}
uploadExcel(formData: any, table: string): Observable<AlertModel> {
......
......@@ -122,26 +122,26 @@ export class NavService implements OnDestroy {
// { id: 'm12', path: 'ess/supervisor-evaluation', title: 'ประเมินโดยหัวหน้า', type: 'link', show: true },
// ],
},
// {
// title: 'แก้ไข Individual KPI ตนเอง',
// type: 'link',
// selected: false,
// active: false,
// path: 'ess/self-setting-individual-kpi',
// id: 'm3',
// show: false,
// icon: ''
// },
// {
// title: 'แก้ไข Individual KPI โดยหัวหน้า',
// type: 'link',
// selected: false,
// active: false,
// path: 'ess/supervisor-setting-individual-kpi',
// id: 'm4',
// show: false,
// icon: ''
// },
{
title: 'แก้ไข Individual KPI ตนเอง',
type: 'link',
selected: false,
active: false,
path: 'ess/self-setting-individual-kpi',
id: 'm3',
show: true,
icon: ''
},
{
title: 'แก้ไข Individual KPI โดยหัวหน้า',
type: 'link',
selected: false,
active: false,
path: 'ess/supervisor-setting-individual-kpi',
id: 'm4',
show: true,
icon: ''
},
];
}
......
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