6.9 KiB
6.9 KiB
Employee Information UI Standard Implementation Report
1. Executive Summary
รอบนี้ได้เริ่มวางมาตรฐาน Employee Information UI กลางของระบบ โดยโฟกัสกับหน้าที่ใช้ตารางและรายการพนักงานบ่อยที่สุดก่อน เพื่อให้ลำดับข้อมูล รหัสพนักงาน -> ชื่อพนักงาน และช่องค้นหาทำงานสอดคล้องกันในหลายโมดูลหลักของระบบ
มาตรฐานที่เริ่มใช้งานแล้วครอบคลุมการแสดงผล, search placeholder, และ sorting สำหรับ training records, pending review, employee management, employee directory, users, permission management, รวมถึง card/list บางส่วนของ dashboard overview และ training matrix
2. Standard Definition
- แสดง
รหัสพนักงานเป็นคอลัมน์แรกเสมอใน DataTable ที่มีข้อมูลพนักงาน - แสดง
ชื่อพนักงานเป็นคอลัมน์ถัดจากรหัสพนักงาน - ใช้ placeholder มาตรฐานผ่าน helper กลาง:
ค้นหาด้วยรหัสพนักงาน ชื่อพนักงาน ... - รองรับ search ด้วย
employee_codeและemployee_nameใน API/DB layer ที่เกี่ยวข้อง - รองรับ sorting ด้วย
employee_codeและemployee_nameในตารางที่เกี่ยวข้อง - บน card/list ที่ไม่ใช่ DataTable ให้เรียง
รหัสพนักงานเหนือชื่อพนักงาน
3. Pages Updated
dashboard/training-recordsdashboard/pending-reviewdashboard/employeesdashboard/employee-directorydashboard/usersdashboard/permissions/usersdashboard/overviewส่วน recent activitydashboard/training-matrixส่วน compliance card
4. Files Modified
src/components/employee/employee-information.tsxsrc/lib/employee-information.tssrc/features/training-records/api/types.tssrc/features/training-records/server/training-record-data.tssrc/features/training-records/components/training-record-tables/columns.tsxsrc/features/training-records/components/pending-review-columns.tsxsrc/app/api/training-records/route.tssrc/app/api/training-records/[id]/route.tssrc/features/users/components/users-table/columns.tsxsrc/features/permission-management/components/user-permission-columns.tsxsrc/features/permission-management/server/user-permission-data.tssrc/features/employees/components/employee-tables/columns.tsxsrc/features/employees/server/employee-data.tssrc/features/employee-directory/components/employee-directory-columns.tsxsrc/features/employee-directory/components/employee-directory-toolbar.tsxsrc/features/overview/components/recent-sales.tsxsrc/features/training-matrix/components/training-compliance-card.tsx
5. API Changes
- เพิ่ม
employee_codeใน contract ของtraining records - เพิ่มการ search ด้วย
employee_codeใน training record listing - เพิ่มการ sort ด้วย
employee_codeใน training record listing - เพิ่มการ sort ด้วย
employee_codeใน permission-management user assignment - เพิ่มการ sort ด้วย
employee_codeและfull_nameใน employee management - route handler ของ training records ถูกอัปเดตให้เติม
employeeCodeใน serialized response ให้ครบกับ contract ใหม่
6. UI Changes
- เพิ่มคอลัมน์
รหัสพนักงานเป็นคอลัมน์แรกในตารางหลักที่เกี่ยวกับพนักงาน - ปรับคอลัมน์
ชื่อพนักงานให้เป็นคอลัมน์แยกจากรหัสพนักงาน - เพิ่ม shared helper/component สำหรับแสดง employee identity แบบสม่ำเสมอ
- ปรับ card/list บางส่วนให้แสดง
รหัสพนักงานก่อนชื่อพนักงาน
7. Search Changes
- ใช้ placeholder มาตรฐานจาก helper กลาง
- ตารางที่ค้นหาพนักงานอยู่แล้วจะสื่อชัดขึ้นว่ารองรับทั้ง
รหัสพนักงานและชื่อพนักงาน - หน้าที่มี search แบบ module-specific สามารถต่อท้ายคำค้นเฉพาะงานได้ เช่น
หลักสูตร,ผู้จัดอบรม
8. Sorting Changes
- เพิ่ม sorting สำหรับ
รหัสพนักงานในหน้าที่โครงสร้าง API รองรับแล้ว - รักษา sorting เดิมของคอลัมน์ธุรกิจอื่นไว้โดยไม่เปลี่ยน workflow
9. Responsive Changes
- card/list บน overview และ training matrix ปรับให้
รหัสพนักงานอยู่ก่อนชื่อพนักงาน - DataTable หลักยังคงใช้ shared table stack เดิม และจัดลำดับคอลัมน์ตามมาตรฐานใหม่
10. Regression Review
- ไม่เปลี่ยน permission
- ไม่เปลี่ยน business workflow
- ไม่เปลี่ยน persistence pattern
- ไม่เปลี่ยน navigation
- ใช้ shared DataTable stack และ auth/data pattern เดิมของ repo
11. Test Checklist
npx tsc --noEmitnpm run build
ทั้งสองคำสั่งผ่าน
12. Recommendation
- รอบถัดไปควรไล่ปรับ
dashboard/reportsและหน้ารายงานแบบ custom table ที่ยังไม่ได้ย้ายเข้ามาตรฐานเดียวกันทั้งหมด - หากมีหน้าใหม่ที่แสดงข้อมูลพนักงาน ควร reuse
employee-information.tsxและbuildEmployeeSearchPlaceholder()ต่อโดยตรง