diff --git a/ng-ttc-frontend/src/app/component/main-landing/main-landing.component.html b/ng-ttc-frontend/src/app/component/main-landing/main-landing.component.html index c1d6be5..f935e06 100644 --- a/ng-ttc-frontend/src/app/component/main-landing/main-landing.component.html +++ b/ng-ttc-frontend/src/app/component/main-landing/main-landing.component.html @@ -1,4 +1,4 @@ -
+

หน้าหลัก ( landing )

diff --git a/ng-ttc-frontend/src/app/component/main-project/main-project.html b/ng-ttc-frontend/src/app/component/main-project/main-project.html index 12ed964..0b22c58 100644 --- a/ng-ttc-frontend/src/app/component/main-project/main-project.html +++ b/ng-ttc-frontend/src/app/component/main-project/main-project.html @@ -29,15 +29,31 @@ + @for (item of myPrjMst; track item.prjseq; let i = $index) { - 1 - โครงการปรับปรุงอาคาร - รออนุมัติ + {{ i + 1 }} + {{ item.prjnam }} + + @if(item.prjcomstt === 'UAC'){ รออนุมัติ } + @else if(item.prjcomstt === 'BAP'){ อนุมัติแล้ว } + @else if(item.prjcomstt === 'CN'){ ไม่อนุมัติ } + @else { {{ item.prjcomstt }} } + + } @empty { + + ไม่พบข้อมูลโครงการ + + }
diff --git a/ng-ttc-frontend/src/app/component/main-project/main-project.ts b/ng-ttc-frontend/src/app/component/main-project/main-project.ts index 4ca2706..8da56e7 100644 --- a/ng-ttc-frontend/src/app/component/main-project/main-project.ts +++ b/ng-ttc-frontend/src/app/component/main-project/main-project.ts @@ -4,6 +4,8 @@ import { GeneralService } from '../../services/generalservice'; import { IDropAct, IStateDrop, IStateResultResponse, IActData, IActSumData } from '../../interfaces/dashboard.interface' import { DashboardStateService } from '../../services/state/dashboard-state.service'; import { Router } from '@angular/router'; +import { IPrjMst } from '../../interfaces/main.interface'; // เพิ่ม Import Interface +import { ProjectStateService } from '../../services/state/project-state.service'; @Component({ @@ -13,16 +15,44 @@ import { Router } from '@angular/router'; styleUrl: './main-project.css', }) export class MainProject implements OnInit { + + myPrjMst: IPrjMst[] = []; // ตัวแปรเก็บข้อมูลโครงการ + constructor( private generalService: GeneralService, private dashboardStateService: DashboardStateService, + private projectStateService: ProjectStateService, // Inject ProjectStateService private router: Router ) {} ngOnInit(): void { - + this.projectStateService.getStateResult().subscribe((result: IPrjMst[] | null) => { + if (result) { + this.myPrjMst = result; + } + }); + // this.onSearchPrj(); // เรียกดึงข้อมูลเมื่อเริ่มทำงาน } + // // ฟังก์ชันดึงข้อมูลโครงการ + // onSearchPrj(): void { + // const uri = '/api/ttc/projectsearch?column=user'; + // const request = {}; // body ว่างตามที่ระบุ + + // this.generalService.postRequest(uri, request).subscribe({ + // next: (result: any) => { + // if (result.code === '200') { + // // สำเร็จ: นำข้อมูลใส่ตัวแปร + // this.myPrjMst = result.data; + // } else { + // this.generalService.trowApi(result); + // } + // }, + // error: (error: any) => { + // this.generalService.trowApi(error); + // } + // }); + // } navigate(path: string) { this.router.navigate([path]); diff --git a/ng-ttc-frontend/src/app/content/main-project-content/main-project-content.html b/ng-ttc-frontend/src/app/content/main-project-content/main-project-content.html index 636812b..3544b2e 100644 --- a/ng-ttc-frontend/src/app/content/main-project-content/main-project-content.html +++ b/ng-ttc-frontend/src/app/content/main-project-content/main-project-content.html @@ -1,8 +1,9 @@ -
+
-
+ +
@if (mode == 'default') { -
+

รายการโครงการทั้งหมด @@ -10,9 +11,8 @@

ติดตาม สถานะโครงการ และ เสนอโครงการ

- } @else if (mode == 'add') { -
+