Commit ef1ab89a by Nakarin Luankla

เพิ่มหน้า import

parent b9b98825
......@@ -61,6 +61,7 @@ import { JobDetailManagementComponent } from '../job-detail-components/job-detai
import { DevelopmentCourseComponent } from '../course-registration/development-course/development-course.component';
import { IndicatorsAndCurriculumComponent } from '../competency-management/indicators-and-curriculum/indicators-and-curriculum.component';
import { CourseRegistrationComponent } from '../course-registration/course-registration.component';
import { ImportDataComponent } from '../job-detail-components/job-detail-management/import-data/import-data.component';
......@@ -107,6 +108,7 @@ import { CourseRegistrationComponent } from '../course-registration/course-regis
CourseRegistrationComponent,
DevelopmentCourseComponent,
IndicatorsAndCurriculumComponent,
ImportDataComponent
],
imports: [
CommonModule,
......
import { Component } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { JobModel, MyJobModel } from 'src/app/shared/model/job.model';
@Component({
selector: 'app-import-data',
templateUrl: './import-data.component.html',
styleUrls: ['./import-data.component.scss']
})
export class ImportDataComponent {
currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1);
jobList: JobModel[] = []
job: JobModel = new MyJobModel({})
search = ""
constructor(
private toastr: ToastrService
) { }
ngOnInit(): void {
}
searchChange() {
this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.jobListFilter().length / 10) }, (_, i) => i + 1);
}
jobListFilter() {
return this.jobList.filter(x => x.jobid.toLowerCase().includes(this.search) ||
x.tdesc.toLowerCase().includes(this.search) ||
x.edesc.toLowerCase().includes(this.search))
}
selectJob(job: JobModel) {
// this.showSuccess()
this.job = new MyJobModel(job)
}
showSuccess() {
this.toastr.success('This is an example of tip', 'TIP', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
addBu1() {
// this.bu1Service.post(this.bu1).subscribe((response:any) => {
// if (response.success) {
// this.getBu1List()
// }
// })
}
deleteJob(job: JobModel) {
// this.bu1Service.delete(new MyBu1Model(bu1)).subscribe((response:any) => {
// if (response.success) {
// this.getBu1List()
// }
// })
}
}
......@@ -18,11 +18,7 @@
</div>
<div class="mt-3 px-3rem">
<div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
รายละเอียดทะเบียนบริษัท
</div>
<div id="underline-2" class="hidden" role="tabpanel" aria-labelledby="underline-item-2">
<app-branch-business-unit [pathTitle]="pathTitle"
(sendPathTitle)="pathTitle=$event"></app-branch-business-unit>
<app-import-data></app-import-data>
</div>
</div>
</div>
......
export interface JobModel {
jobid: string;
tdesc: string;
edesc: string;
}
export class MyJobModel implements JobModel {
jobid: string;
tdesc: string;
edesc: string;
constructor(data: Partial<JobModel>) {
this.jobid = data.jobid || ""
this.tdesc = data.tdesc || ""
this.edesc = data.edesc || ""
}
}
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