diff --git a/ng-ttc-frontend/angular.json b/ng-ttc-frontend/angular.json index 1e57965..c890e86 100644 --- a/ng-ttc-frontend/angular.json +++ b/ng-ttc-frontend/angular.json @@ -37,12 +37,10 @@ } ], "styles": [ - "node_modules/bootstrap/dist/css/bootstrap.min.css", "node_modules/@fortawesome/fontawesome-free/css/all.min.css", "src/styles.css" ], "scripts": [ - "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" ] }, "configurations": { @@ -116,12 +114,10 @@ } ], "styles": [ - "node_modules/bootstrap/dist/css/bootstrap.min.css", "node_modules/@fortawesome/fontawesome-free/css/all.min.css", "src/styles.css" ], "scripts": [ - "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" ] } } diff --git a/ng-ttc-frontend/package-lock.json b/ng-ttc-frontend/package-lock.json index bbd14cb..d699337 100644 --- a/ng-ttc-frontend/package-lock.json +++ b/ng-ttc-frontend/package-lock.json @@ -26,7 +26,6 @@ "@fortawesome/free-regular-svg-icons": "^7.1.0", "@fortawesome/free-solid-svg-icons": "^7.1.0", "@tailwindcss/postcss": "^4.1.17", - "bootstrap": "^5.3.8", "chart.js": "^4.5.1", "dotenv": "^17.2.3", "jwt-decode": "^4.0.0", @@ -7030,17 +7029,6 @@ "node": ">=14" } }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "license": "MIT", - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.52.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.3.tgz", @@ -9432,25 +9420,6 @@ "license": "MIT", "optional": true }, - "node_modules/bootstrap": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz", - "integrity": "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/twbs" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" - } - ], - "license": "MIT", - "peerDependencies": { - "@popperjs/core": "^2.11.8" - } - }, "node_modules/bplist-parser": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.2.tgz", diff --git a/ng-ttc-frontend/package.json b/ng-ttc-frontend/package.json index 2f00fd2..c6a4308 100644 --- a/ng-ttc-frontend/package.json +++ b/ng-ttc-frontend/package.json @@ -58,7 +58,6 @@ "@fortawesome/free-regular-svg-icons": "^7.1.0", "@fortawesome/free-solid-svg-icons": "^7.1.0", "@tailwindcss/postcss": "^4.1.17", - "bootstrap": "^5.3.8", "chart.js": "^4.5.1", "dotenv": "^17.2.3", "jwt-decode": "^4.0.0", diff --git a/ng-ttc-frontend/src/app/app-routing.module.ts b/ng-ttc-frontend/src/app/app-routing.module.ts index 533010d..572428f 100644 --- a/ng-ttc-frontend/src/app/app-routing.module.ts +++ b/ng-ttc-frontend/src/app/app-routing.module.ts @@ -3,10 +3,11 @@ import { RouterModule, Routes } from '@angular/router'; import { SidebarContentComponent } from './content/sidebar-content/sidebar-content.component'; import { LicensePrivacyTermsComponent } from './component/license-privacy-terms/license-privacy-terms.component'; import { authGuard } from './services/auth.guard'; +import { loginGuard } from './services/login.guard'; const routes: Routes = [ - { path: 'login', loadChildren: () => import('./controls/login-control/login-control.module').then(m => m.LoginControlModule) }, + { path: 'login', loadChildren: () => import('./controls/login-control/login-control.module').then(m => m.LoginControlModule), canActivate: [loginGuard] }, { path: 'license', component: LicensePrivacyTermsComponent}, diff --git a/ng-ttc-frontend/src/app/app.module.ts b/ng-ttc-frontend/src/app/app.module.ts index c2d33fd..30d84c3 100644 --- a/ng-ttc-frontend/src/app/app.module.ts +++ b/ng-ttc-frontend/src/app/app.module.ts @@ -13,7 +13,7 @@ import { SidebarContentComponent } from './content/sidebar-content/sidebar-conte import { SidebarComponent } from './component/sidebar/sidebar.component'; // import { ReactiveFormsModule } from '@angular/forms'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { HttpClientModule } from '@angular/common/http'; +import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { LicensePrivacyTermsComponent } from './component/license-privacy-terms/license-privacy-terms.component'; // import { MainDashboardContentComponent } from './content/main-dashboard-content/main-dashboard-content.component'; // import { MainDashboardComponent } from './component/main-dashboard/main-dashboard.component'; @@ -23,6 +23,7 @@ import { LicensePrivacyTermsComponent } from './component/license-privacy-terms/ import { provideCharts, withDefaultRegisterables } from 'ng2-charts'; +import { CachingInterceptor } from './services/caching.interceptor'; // import { BudgetAproval } from './component/budget-aproval/budget-aproval'; // import { AccDateFormatPipe } from './pipe/dtmtodatetime.pipe'; // import { DtmtodatetimePipe } from './dtmtodatetime.pipe'; @@ -61,7 +62,10 @@ import { provideCharts, withDefaultRegisterables } from 'ng2-charts'; exports: [ // AccDateFormatPipe ], - providers: [provideCharts(withDefaultRegisterables())], + providers: [ + provideCharts(withDefaultRegisterables()), + { provide: HTTP_INTERCEPTORS, useClass: CachingInterceptor, multi: true } + ], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/ng-ttc-frontend/src/app/component/budget-aproval/budget-aproval.html b/ng-ttc-frontend/src/app/component/budget-aproval/budget-aproval.html index 279e184..e8ad575 100644 --- a/ng-ttc-frontend/src/app/component/budget-aproval/budget-aproval.html +++ b/ng-ttc-frontend/src/app/component/budget-aproval/budget-aproval.html @@ -1,9 +1,10 @@ -
+
-
+

- รายการงบประมาณของโครงการ: {{ project?.name }} + รายการงบประมาณของโครงการ: ระบบจัดการน้ำดื่ม +

@@ -13,20 +14,19 @@ -
+ + หมวดงบ
- + error
- + รายการ
- +
- + จำนวน
- + ราคา
+ focus:ring-2 focus:ring-blue-200 focus:border-blue-300"/>
- + Add button +
+ @if(!isFormExpanded){ +
+
+
+ + +
+ +
+ + +
+ +
+ +
+ + + + + + + +
+
+ } +
+ -
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ลำดับรหัสโครงการชื่อโครงการผู้รับผิดชอบงบที่ขออนุมัติหมวดงบจำนวนที่อนุมัติสถานะดำเนินการ
{{ i + 1 }} {{ p.code }}{{ p.name }}{{ p.owner }} {{ p.budget | number:'1.0-0' }} บาท + + {{ p.bdgnam }} + + + {{ p.acp }} บาท + + + อนุมัติแล้ว + รออนุมัติ + ไม่อนุมัติ + + + + + + +
+ +
diff --git a/ng-ttc-frontend/src/app/component/budget-aproval/budget-aproval.ts b/ng-ttc-frontend/src/app/component/budget-aproval/budget-aproval.ts index 07f7c9c..6a752be 100644 --- a/ng-ttc-frontend/src/app/component/budget-aproval/budget-aproval.ts +++ b/ng-ttc-frontend/src/app/component/budget-aproval/budget-aproval.ts @@ -16,6 +16,7 @@ export class BudgetAproval { projectCode: any; project: any; addItemForm!: FormGroup; + isFormExpanded: boolean = false; budgetItems = [ { code: 'ITEM001', name: 'เอกซ์เรย์', qty: 1, price: 1000 }, @@ -23,6 +24,12 @@ export class BudgetAproval { { code: 'ITEM003', name: 'ตรวจพื้นฐาน', qty: 1, price: 1000 }, ]; + projects = [ + { code: 'PRJ001', name: 'ระบบจัดการน้ำดื่ม', owner: 'นาย A', budget: 20000, status: 'WAIT', acp: 0, bdgnam: 'ยังไมจัดสรร' }, + { code: 'PRJ002', name: 'ปรับปรุงอาคาร B', owner: 'นางสาว B', budget: 45000, status: 'WAIT', acp: 0, bdgnam: 'ยังไมจัดสรร'}, + { code: 'PRJ003', name: 'ซื้อคอมพิวเตอร์', owner: 'นาย C', budget: 30000, status: 'APPROVED', acp: 20000, bdgnam: 'งบดำเนินงาน' } + ]; + budgetCategoriesDrop = { expense: [ { dtlcod: 'BDG001', dtlnam: 'เงินรายได้' }, @@ -77,6 +84,10 @@ setupForm() { }); } +toggleFormCollapse(): void { + this.isFormExpanded = !this.isFormExpanded; +} + addBudgetItem() { if (this.addItemForm.invalid) { this.addItemForm.markAllAsTouched(); diff --git a/ng-ttc-frontend/src/app/component/login-forgot/login-forgot.component.css b/ng-ttc-frontend/src/app/component/login-forgot/login-forgot.component.css index cd46dbe..0ae38df 100644 --- a/ng-ttc-frontend/src/app/component/login-forgot/login-forgot.component.css +++ b/ng-ttc-frontend/src/app/component/login-forgot/login-forgot.component.css @@ -8,12 +8,11 @@ --radius: 8px; --shadow: 0 10px 30px rgba(11,26,43,0.08); --glass: rgba(255,255,255,0.6); + --success-color: #10b981; /* Green for success/confirm */ } -/* Page layout */ +/* Page layout (unchanged) */ .login-widget { - /* Fill the viewport and center the card. Do not let the page itself - scroll; the card gets an internal max-height instead. */ min-height: 100vh; height: 100vh; display: flex; @@ -24,8 +23,7 @@ color: var(--text); } - -/* Card */ +/* Card (unchanged) */ .login-widget .card{ width: 380px; max-width: calc(100% - 40px); @@ -37,16 +35,14 @@ display: flex; flex-direction: column; gap: 14px; - /* Constrain the card so it never forces the page to scroll. If content - grows, the card will scroll internally. */ max-height: calc(100vh - 56px); overflow: auto; } -/* Modal/backdrop styles */ +/* Modal/backdrop styles (unchanged) */ .login-backdrop{ position: fixed; - inset: 0; /* top:0; right:0; bottom:0; left:0; */ + inset: 0; background: rgba(0,0,0,0.38); display: flex; align-items: center; @@ -54,43 +50,19 @@ z-index: 1040; padding: 24px; } - .login-modal{ width: 480px; max-width: 480px; } .modal-card{ border-radius: 12px; - padding: 0; /* card children control internal padding */ + padding: 0; overflow: hidden; box-shadow: 0 20px 50px rgba(2,6,23,0.4); } -/* Slightly larger brand area inside modal */ -.modal-card .brand{ padding: 18px; } - -/* Make the primary button pill-shaped and slightly larger */ -button.primary{ - color: #000; - border-radius: 999px; - padding: 10px 18px; - font-size: 15px; -} - -/* Make biometric and other action buttons visually lighter */ -.biometric{ - border-radius: 999px; - padding: 8px 12px; -} - -/* On small screens reduce modal padding and width to avoid overflow */ -@media (max-width: 420px){ - .login-backdrop{ padding: 12px; } - .login-modal{ max-width: 100%; } - .modal-card .brand{ padding: 12px; } -} - -/* Brand area */ +/* Brand area (unchanged) */ .brand{ text-align: center; + padding: 18px; padding-bottom: 4px; border-bottom: 1px solid #eef2f5; } @@ -116,16 +88,13 @@ button.primary{ /* Form area */ .form{ - /* keep compact spacing inside the card */ - /* width: 410px; */ margin-top: 6px; display: flex; flex-direction: column; gap: 12px; - padding: 6px 0 2px; + padding: 6px 22px 22px 22px; } - -/* Field label wrapper */ +/* Field label wrapper (unchanged) */ .field{ display: flex; flex-direction: column; @@ -135,11 +104,11 @@ button.primary{ font-size: 13px; color: var(--muted); } - -/* Inputs */ +/* Inputs (class 'input-field' added to HTML) */ input[type="email"], input[type="password"], -input[type="text"]{ +input[type="text"], +.input-field { /* เพิ่ม class input-field เพื่อให้สไตล์ถูกใช้กับ input ที่กำหนด */ width: 100%; box-sizing: border-box; padding: 10px 12px; @@ -163,31 +132,30 @@ input:focus{ transform: translateZ(0); } -/* Checkbox / stay signed */ -.stay-signed{ - display: inline-flex; - gap: 8px; - align-items: center; - font-size: 13px; - color: var(--muted); -} -.stay-signed input[type="checkbox"]{ - width: 16px; - height: 16px; - accent-color: var(--primary); -} - /* Actions row */ .actions{ display: flex; align-items: center; - justify-content: space-between; gap: 12px; margin-top: 4px; + flex-direction: row-reverse; } + +/* Custom class for justify-end when using flex-row-reverse */ +.actions.justify-end-custom { + justify-content: flex-start; +} + +/* Custom class for lift hover effect (used for 'เปิด Modal' button) */ +.hover-lift:hover { + transform: translateY(-2.5px); + transition: transform .2s ease; +} + +/* PRIMARY BUTTON - แก้ไขสีข้อความให้เป็นสีดำ */ button.primary{ background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%); - color: #000000; + color: #000000; /* ⬅️ แก้ไขเป็นสีดำตามคำขอ */ border: none; padding: 10px 14px; border-radius: 6px; @@ -197,6 +165,7 @@ button.primary{ box-shadow: 0 6px 18px rgba(0,120,212,0.12); transition: transform .06s ease, box-shadow .12s ease, opacity .12s ease; } + button.primary:hover:not(:disabled){ transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,120,212,0.14); @@ -207,45 +176,26 @@ button.primary:active{ button.primary:disabled{ opacity: 0.55; cursor: not-allowed; + color: #000000; /* ข้อความ disabled ก็เป็นสีดำ */ box-shadow: none; } -/* Alternative options */ -.alt-options{ - display: flex; - align-items: center; - gap: 12px; - margin-top: 6px; - flex-wrap: wrap; +/* Secondary Button Style (สำหรับปุ่ม 'เปิด Modal', 'ส่งอีกครั้ง') */ +.primary.secondary-button { + background: transparent; + color: var(--primary); + border: 1px solid var(--primary); + box-shadow: none; + transition: background-color .14s ease; } -.biometric{ - display: inline-flex; - align-items: center; - gap: 10px; - padding: 8px 10px; - background: transparent; - color: var(--primary); - border: 1px solid rgba(0,120,212,0.14); - border-radius: 6px; - cursor: pointer; - font-weight: 600; - font-size: 13px; -} -.biometric svg{ display: block; opacity: .95; } -.biometric:hover{ - background: rgba(0,120,212,0.04); +.primary.secondary-button:hover { + background: rgba(0, 120, 212, 0.05); + transform: none; + box-shadow: none; } -/* Help link */ -.help-link{ - margin-left: auto; - font-size: 13px; - color: var(--primary); - text-decoration: none; -} -.help-link:hover{ text-decoration: underline; } -/* Footer */ +/* Footer (unchanged) */ .footer{ display: flex; justify-content: center; @@ -262,13 +212,9 @@ button.primary:disabled{ text-decoration: none; font-weight: 600; } -.footer a:hover{ text-decoration: underline; } -.divider{ color: #d0d6db; } -/* Focus styles for keyboard users */ -:focus{ - outline: none; -} +/* Focus styles (unchanged) */ +:focus{ outline: none; } :focus-visible{ outline: 3px solid rgba(0,120,212,0.12); outline-offset: 2px; @@ -277,14 +223,13 @@ button.primary:disabled{ /* Small screens */ @media (max-width:420px){ + .login-backdrop{ padding: 12px; } + .login-modal{ max-width: 100%; } + .modal-card .brand{ padding: 12px; } .login-widget .card{ padding: 18px; width: 100%; } .brand h1{ font-size: 18px; } - .brand .subtitle{ - font-family: "Kanit"; - font-weight: 1000; - font-style: normal; } .biometric span, .primary{ font-size: 13px; } } diff --git a/ng-ttc-frontend/src/app/component/login-forgot/login-forgot.component.html b/ng-ttc-frontend/src/app/component/login-forgot/login-forgot.component.html index 660b8f7..515991e 100644 --- a/ng-ttc-frontend/src/app/component/login-forgot/login-forgot.component.html +++ b/ng-ttc-frontend/src/app/component/login-forgot/login-forgot.component.html @@ -1,105 +1,86 @@ @@ -100,8 +128,105 @@
+ + + + + +
sdsdsdasds
- + --> + +
+
+
+
+ Trang Technical College Logo +
+
+ +
+

อัพเดตซอฟต์แวร์ล่าสุด

+ +
+ รายการ + ประเภท + เวอร์ชัน + สถานะ +
+ +
+
+
+

แก้ไขบั๊ก (Patch Fix)

+

18 พ.ย. 2568

+
+
+ + + + ปรับปรุง + + + + + 1.0.1 + + + + เสร็จสมบูรณ์ + +
+ +
+
+
+

อัปเดตระบบหลัก (Major Update)

+

25 ต.ค. 2568

+
+
+ + + + คุณสมบัติใหม่ + + + + + 2.0.0 + + + + รอตรวจสอบ + +
+ +
+
+
+

แก้ไขช่องโหว่ความปลอดภัย

+

5 พ.ย. 2568

+
+
+ + + + ปรับปรุง + + + + + 1.0.0 + + + + เสร็จสมบูรณ์ + +
+ +
+
+
diff --git a/ng-ttc-frontend/src/app/component/main-landing/main-landing.component.ts b/ng-ttc-frontend/src/app/component/main-landing/main-landing.component.ts index 12414c8..c684dd1 100644 --- a/ng-ttc-frontend/src/app/component/main-landing/main-landing.component.ts +++ b/ng-ttc-frontend/src/app/component/main-landing/main-landing.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; @Component({ selector: 'app-main-landing', @@ -9,10 +10,15 @@ import { Component, OnInit } from '@angular/core'; export class MainLandingComponent implements OnInit { constructor( - + private router: Router ) {} ngOnInit() { + } + + navigate(path: string) { + this.router.navigate([path]); + } } diff --git a/ng-ttc-frontend/src/app/component/main-manager/main-manager.component.css b/ng-ttc-frontend/src/app/component/main-manager/main-manager.component.css index 70db525..4ff9e72 100644 --- a/ng-ttc-frontend/src/app/component/main-manager/main-manager.component.css +++ b/ng-ttc-frontend/src/app/component/main-manager/main-manager.component.css @@ -1,7 +1,9 @@ :host { display: block; padding: 2rem clamp(1.25rem, 4vw, 3rem) 3rem; - background: radial-gradient(120% 120% at 0% 0%, #f6f8ff 0%, #eef5ff 55%, #ffffff 100%); + /* background: radial-gradient(120% 120% at 0% 0%, #f6f8ff 0%, #eef5ff 55%, #ffffff 100%); */ + /* background: white; */ + background-color: var(--color-gray-100); min-height: 100%; } @@ -643,4 +645,4 @@ max-height: 25rem; overflow-y: auto; padding-right: 0.5rem; -} \ No newline at end of file +} diff --git a/ng-ttc-frontend/src/app/component/main-manager/main-manager.component.html b/ng-ttc-frontend/src/app/component/main-manager/main-manager.component.html index 277c5a3..fd584ab 100644 --- a/ng-ttc-frontend/src/app/component/main-manager/main-manager.component.html +++ b/ng-ttc-frontend/src/app/component/main-manager/main-manager.component.html @@ -2,7 +2,7 @@
- +
@@ -38,6 +38,8 @@
+ +
@@ -55,90 +57,67 @@ - - - + + + + + + + - + - + - + - + - - - - - - - - + + + +
{{ i + 1 }}
{{ i + 1 }} {{ p.code }}{{ p.name }}{{ p.owner }} {{ p.budget | number:'1.0-0' }} บาท - {{ p.code }} - + + {{ p.bdgnam }} + - {{ p.name }} - + + {{ p.acp }} บาท + - {{ p.owner }} - + + อนุมัติแล้ว + รออนุมัติ + ไม่อนุมัติ + + - {{ p.budget | number:'1.0-0' }} บาท - - - - - - - - อนุมัติแล้ว - รออนุมัติ - ไม่อนุมัติ - - - - + -
+ +
- - -
-
@@ -11,21 +11,21 @@
-
+
-

สมุดรายวัน

-

บันทึกรายรับรายจ่ายทั้งหมดในช่วงเวลา

+

รายงาน

+
@@ -85,7 +85,7 @@

Print Preview

รายงานรายรับรายจ่าย

-

ช่วงวันที่ {{ reportRange.start }} - {{ reportRange.end }}

+
diff --git a/ng-ttc-frontend/src/app/component/sidebar/sidebar.component.html b/ng-ttc-frontend/src/app/component/sidebar/sidebar.component.html index 1ab33a0..0b458c5 100644 --- a/ng-ttc-frontend/src/app/component/sidebar/sidebar.component.html +++ b/ng-ttc-frontend/src/app/component/sidebar/sidebar.component.html @@ -9,9 +9,9 @@
-

- -

+
+ +