No description
Find a file
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 fd5e32e53c
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m49s
Merge branch 'develop' into dev
2026-04-17 14:38:55 +07:00
.forgejo/workflows Update .forgejo/workflows/ci-cd.yml 2026-03-25 13:51:42 +07:00
.github/workflows test 2025-09-05 15:33:51 +07:00
cypress MainLayout , Dashboard, Transfer 2023-07-07 16:54:53 +07:00
docker fixing redirect 2025-02-13 15:37:30 +07:00
public MainLayout , Dashboard, Transfer 2023-07-07 16:54:53 +07:00
src refactor:(position-review) add Call API profileSalaryTemp /done 2026-04-17 14:38:31 +07:00
.env.production fixing redirect 2025-02-13 15:37:30 +07:00
.eslintrc.cjs updated format code & eslint rule 2024-09-02 14:01:01 +07:00
.gitignore no message 2024-10-28 13:25:40 +07:00
.onedev-buildspec.yml add @server@ to CI for UAT, PROD 2025-02-04 09:21:37 +00:00
cypress.config.ts MainLayout , Dashboard, Transfer 2023-07-07 16:54:53 +07:00
env.d.ts MainLayout , Dashboard, Transfer 2023-07-07 16:54:53 +07:00
index.html updated menu on mobile 2024-05-31 11:15:21 +07:00
package-lock.json load orgchart 2025-07-18 15:06:41 +07:00
package.json fix:export Chart 2026-02-25 13:00:38 +07:00
README.md Update README.md 2023-07-07 16:55:58 +07:00
tsconfig.app.json updated format code & eslint rule 2024-09-02 14:01:01 +07:00
tsconfig.config.json fix config 2024-11-13 09:41:32 +07:00
tsconfig.json MainLayout , Dashboard, Transfer 2023-07-07 16:54:53 +07:00
tsconfig.vitest.json MainLayout , Dashboard, Transfer 2023-07-07 16:54:53 +07:00
vite.config.ts log logout 2024-11-13 15:26:23 +07:00

ระบบ BMA eHR (eHR กรุงเทพมหานคร)

สำหรับ User

โครงสร้างโฟลเดอร์

ภายใต้ src จะประกอบด้วยโฟลเดอร์ที่จำเป็นดังนี้

  1. assets : สำหรับเก็บไฟล์ภาพกราฟิก + css
  2. components : สำหรับเก็บ Component ส่วนกลางที่สามารถเรียกใช้จากระบบใดก็ได้
  3. helpers : สำหรับเก็บ filter, composable ที่เรียกใช้จากระบบใดก็ได้
  4. modules : สำหรับเก็บไฟล์โค้ดหลัก ภายในจะแบ่งเป็นโฟลเดอร์ย่อยของระบบต่าง ๆ ทั้ง 17 ระบบ 17 โฟลเดอร์ ภายใต้โฟลเดอร์ย่อยของระบบจะเป็นโครงสร้างแบบเดียวกับ vue template เช่น ภายใต้โฟลเดอร์ 01_metadata (ระบบข้อมูลหลัก) ประกอบด้วยโฟลเดอร์
    • components : โฟลเดอร์เก็บ Component ที่ใช้เฉพาะระบบข้อมูลหลัก
    • views : โฟลเดอร์เก็บ View/Layout ที่ใช้เฉพาะระบบข้อมูลหลัก

รูปแบบ SFC ที่แนะนำให้ใช้ใน Vue 3

ลำดับการวางโค้ดใน Vue 3 จะย้ายแท็ก script ขึ้นก่อนแท็ก template ส่วนแท็ก style จะอยู่ลำดับล่างสุดเหมือนเดิม

  • แท็ก script ควรมี setup และ lang="ts" บอกเสมอ
  • แท็ก style ควรกำหนด lang และ scoped ด้วย

ตัวอย่างด้านล่าง

<script setup lang="ts">
</script>

<template>
</template>

<style lang="scss" scoped>
</style>

การอ้างอิง Path

Vue Template ได้สร้าง shortcut ไว้ให้แล้วด้วยการใส่เครื่องหมาย '@' นำหน้า ซึ่ง @ แทน src ดังนั้นพาธใด ๆ ก็ต้องจะอยู่ภายใน @ ทั้งหมด เช่น ต้องการเรียก src/components ให้ใส่ว่า "@/components" ถ้าเป็นไปได้ไม่ควรใช้ relative path

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

Run Unit Tests with Vitest

npm run test:unit

Run End-to-End Tests with Cypress

npm run test:e2e:dev

This runs the end-to-end tests against the Vite development server. It is much faster than the production build.

But it's still recommended to test the production build with test:e2e before deploying (e.g. in CI environments):

npm run build
npm run test:e2e

Lint with ESLint

npm run lint