hrms-edm/Services/client
Methapon2001 7c28d3f3ae
All checks were successful
Build / build (push) Successful in 32s
fix: roles
2025-09-09 16:35:01 +07:00
..
public edit edm .env 2024-12-10 13:58:21 +07:00
src fix: roles 2025-09-09 16:35:01 +07:00
tests refactor: เพิ่มการทดสอบ สร้างไฟล์ 2023-12-15 14:59:32 +07:00
.gitignore chore: add playwright dep 2023-12-04 12:36:20 +07:00
.prettierrc.json refactor: add onclick on search icon,prettier 2023-12-04 11:11:06 +07:00
env.d.ts client initial commit 2023-11-23 08:47:44 +07:00
index.html style: add logo on title bar 2023-12-08 16:07:28 +07:00
package.json chore: update keycloak dep 2025-04-10 09:10:39 +07:00
playwright.config.ts chore: add playwright dep 2023-12-04 12:36:20 +07:00
pnpm-lock.yaml chore: update keycloak dep 2025-04-10 09:10:39 +07:00
README.md chore: cypress clean 2023-12-06 09:51:24 +07:00
tsconfig.app.json refactor: notification on file exist and main view 2023-11-30 09:35:18 +07:00
tsconfig.config.json chore: cypress clean 2023-12-06 09:51:24 +07:00
tsconfig.json client initial commit 2023-11-23 08:47:44 +07:00
tsconfig.vitest.json client initial commit 2023-11-23 08:47:44 +07:00
typedoc.json chore: format 2023-12-04 02:45:11 +00:00
vite.config.ts client initial commit 2023-11-23 08:47:44 +07:00

EDM Frontend

Enterprise Document Management (EDM) ส่วน frontend

ส่วนประกอบ

  • Vue.js (TypeScript) ใช้ Quasar Framework เป็น UI Framework หลักสำหรับการพัฒนา
  • pnpm เป็น package manager
  • Library Document ใช้ typedoc, typedoc-plugin-vue
pnpm i -D typedoc typedoc-plugin-vue

สำหรับ 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
npm run build

Lint with ESLint

npm run lint