From 792f30d6066e06b3d5ed30512a40784cb7c52e23 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 15 Mar 2023 14:20:18 +0700 Subject: [PATCH 01/24] =?UTF-8?q?ui=20=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=AA=E0=B8=A1=E0=B8=B1=E0=B8=84=E0=B8=A3=E0=B8=AA=E0=B8=AD?= =?UTF-8?q?=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableView.vue | 481 +++++++ src/interface/main/index.ts | 13 +- src/main.ts | 7 +- src/modules/01_exam/components/ExamDetail.vue | 65 + .../01_exam/components/ExamFinished.vue | 43 + src/modules/01_exam/components/ExamForm.vue | 1278 +++++++++++++++++ .../01_exam/components/ExamPayment.vue | 11 + src/modules/01_exam/interface/index/Main.ts | 10 + .../01_exam/interface/request/Certificate.ts | 29 + src/modules/01_exam/interface/request/Coin.ts | 27 + .../01_exam/interface/request/Discipline.ts | 29 + .../01_exam/interface/request/Document.ts | 19 + .../01_exam/interface/request/Education.ts | 31 + .../01_exam/interface/request/Insignia.ts | 36 + .../01_exam/interface/request/Leave.ts | 38 + src/modules/01_exam/interface/request/Main.ts | 30 + .../01_exam/interface/request/Other.ts | 25 + .../01_exam/interface/request/Record.ts | 27 + .../01_exam/interface/request/Salary.ts | 33 + .../01_exam/interface/request/Talent.ts | 27 + .../01_exam/interface/request/Train.ts | 31 + src/modules/01_exam/interface/request/Work.ts | 28 + .../01_exam/interface/response/Certificate.ts | 11 + .../01_exam/interface/response/Coin.ts | 9 + .../01_exam/interface/response/Discipline.ts | 11 + .../01_exam/interface/response/Document.ts | 6 + .../01_exam/interface/response/Education.ts | 13 + .../01_exam/interface/response/Insignia.ts | 18 + .../01_exam/interface/response/Leave.ts | 20 + .../01_exam/interface/response/Main.ts | 17 + .../01_exam/interface/response/Other.ts | 7 + .../01_exam/interface/response/Record.ts | 9 + .../01_exam/interface/response/Salary.ts | 15 + .../01_exam/interface/response/Talent.ts | 9 + .../01_exam/interface/response/Train.ts | 13 + .../01_exam/interface/response/Work.ts | 10 + src/modules/01_exam/router.ts | 23 + src/modules/01_exam/store.ts | 26 + src/modules/01_exam/views/ExamDetail.vue | 87 ++ src/modules/01_exam/views/ExamMain.vue | 231 +++ src/modules/01_meta/interface/index/main.ts | 0 .../01_meta/interface/request/index.ts | 0 .../01_meta/interface/response/index.ts | 0 src/modules/01_meta/router.ts | 13 - src/modules/01_meta/store.ts | 0 src/modules/01_meta/views/Meta01View.vue | 15 - src/router/index.ts | 4 +- src/views/MainLayout.vue | 3 +- 48 files changed, 2845 insertions(+), 43 deletions(-) create mode 100644 src/components/TableView.vue create mode 100644 src/modules/01_exam/components/ExamDetail.vue create mode 100644 src/modules/01_exam/components/ExamFinished.vue create mode 100644 src/modules/01_exam/components/ExamForm.vue create mode 100644 src/modules/01_exam/components/ExamPayment.vue create mode 100644 src/modules/01_exam/interface/index/Main.ts create mode 100644 src/modules/01_exam/interface/request/Certificate.ts create mode 100644 src/modules/01_exam/interface/request/Coin.ts create mode 100644 src/modules/01_exam/interface/request/Discipline.ts create mode 100644 src/modules/01_exam/interface/request/Document.ts create mode 100644 src/modules/01_exam/interface/request/Education.ts create mode 100644 src/modules/01_exam/interface/request/Insignia.ts create mode 100644 src/modules/01_exam/interface/request/Leave.ts create mode 100644 src/modules/01_exam/interface/request/Main.ts create mode 100644 src/modules/01_exam/interface/request/Other.ts create mode 100644 src/modules/01_exam/interface/request/Record.ts create mode 100644 src/modules/01_exam/interface/request/Salary.ts create mode 100644 src/modules/01_exam/interface/request/Talent.ts create mode 100644 src/modules/01_exam/interface/request/Train.ts create mode 100644 src/modules/01_exam/interface/request/Work.ts create mode 100644 src/modules/01_exam/interface/response/Certificate.ts create mode 100644 src/modules/01_exam/interface/response/Coin.ts create mode 100644 src/modules/01_exam/interface/response/Discipline.ts create mode 100644 src/modules/01_exam/interface/response/Document.ts create mode 100644 src/modules/01_exam/interface/response/Education.ts create mode 100644 src/modules/01_exam/interface/response/Insignia.ts create mode 100644 src/modules/01_exam/interface/response/Leave.ts create mode 100644 src/modules/01_exam/interface/response/Main.ts create mode 100644 src/modules/01_exam/interface/response/Other.ts create mode 100644 src/modules/01_exam/interface/response/Record.ts create mode 100644 src/modules/01_exam/interface/response/Salary.ts create mode 100644 src/modules/01_exam/interface/response/Talent.ts create mode 100644 src/modules/01_exam/interface/response/Train.ts create mode 100644 src/modules/01_exam/interface/response/Work.ts create mode 100644 src/modules/01_exam/router.ts create mode 100644 src/modules/01_exam/store.ts create mode 100644 src/modules/01_exam/views/ExamDetail.vue create mode 100644 src/modules/01_exam/views/ExamMain.vue delete mode 100644 src/modules/01_meta/interface/index/main.ts delete mode 100644 src/modules/01_meta/interface/request/index.ts delete mode 100644 src/modules/01_meta/interface/response/index.ts delete mode 100644 src/modules/01_meta/router.ts delete mode 100644 src/modules/01_meta/store.ts delete mode 100644 src/modules/01_meta/views/Meta01View.vue diff --git a/src/components/TableView.vue b/src/components/TableView.vue new file mode 100644 index 0000000..4f17b78 --- /dev/null +++ b/src/components/TableView.vue @@ -0,0 +1,481 @@ + + + diff --git a/src/interface/main/index.ts b/src/interface/main/index.ts index f5bc0bc..3c39ec2 100644 --- a/src/interface/main/index.ts +++ b/src/interface/main/index.ts @@ -33,15 +33,8 @@ const menuList = readonly([ key: 2, icon: 'o_person', activeIcon: 'person', - label: 'ข้อมูลหลัก01', - path: 'meta01' - }, - { - key: 3, - icon: 'o_person', - activeIcon: 'person', - label: 'ข้อมูลหลัก02', - path: 'meta02' + label: 'รายการสอบทั้งหมด', + path: 'exam' } ]) @@ -70,7 +63,7 @@ const notiList = readonly([ { id: 1, sender: 'ท', - body: 'ขอแก้ไขข้อมูลทะเบียนประวัติ', + body: 'ขอแก้ไขข้อมูลรายการสอบทั้งหมด', timereceive: '13/12/2565' } ]) diff --git a/src/main.ts b/src/main.ts index eec266f..2e526e1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { createApp } from 'vue' +import { createApp, defineAsyncComponent } from 'vue' import { createPinia } from 'pinia' import { Dialog, Notify, Quasar } from 'quasar' @@ -34,4 +34,9 @@ app.use( quasarUserOptions ) +app.component( + 'data-table', + defineAsyncComponent(() => import('./components/TableView.vue')) +) + app.mount('#app') diff --git a/src/modules/01_exam/components/ExamDetail.vue b/src/modules/01_exam/components/ExamDetail.vue new file mode 100644 index 0000000..5088497 --- /dev/null +++ b/src/modules/01_exam/components/ExamDetail.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/modules/01_exam/components/ExamFinished.vue b/src/modules/01_exam/components/ExamFinished.vue new file mode 100644 index 0000000..0f69f3b --- /dev/null +++ b/src/modules/01_exam/components/ExamFinished.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/modules/01_exam/components/ExamForm.vue b/src/modules/01_exam/components/ExamForm.vue new file mode 100644 index 0000000..699a8d0 --- /dev/null +++ b/src/modules/01_exam/components/ExamForm.vue @@ -0,0 +1,1278 @@ + + + + + diff --git a/src/modules/01_exam/components/ExamPayment.vue b/src/modules/01_exam/components/ExamPayment.vue new file mode 100644 index 0000000..ed149dc --- /dev/null +++ b/src/modules/01_exam/components/ExamPayment.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/src/modules/01_exam/interface/index/Main.ts b/src/modules/01_exam/interface/index/Main.ts new file mode 100644 index 0000000..46133c9 --- /dev/null +++ b/src/modules/01_exam/interface/index/Main.ts @@ -0,0 +1,10 @@ +interface Pagination { + rowsPerPage: number; +} + +interface DataOption { + id: string; + name: string; +} + +export type { Pagination, DataOption }; diff --git a/src/modules/01_exam/interface/request/Certificate.ts b/src/modules/01_exam/interface/request/Certificate.ts new file mode 100644 index 0000000..76a39d2 --- /dev/null +++ b/src/modules/01_exam/interface/request/Certificate.ts @@ -0,0 +1,29 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; + } + + //ข้อมูล + interface RequestItemsObject { + id: string; + name: string; + certiNumber: string; + start: Date; + end: Date; + } + + //columns + interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; + } + + export type { RequestItemsObject, Columns, DataProps }; + \ No newline at end of file diff --git a/src/modules/01_exam/interface/request/Coin.ts b/src/modules/01_exam/interface/request/Coin.ts new file mode 100644 index 0000000..b5d3d05 --- /dev/null +++ b/src/modules/01_exam/interface/request/Coin.ts @@ -0,0 +1,27 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + receiveDate: Date; + detail: string; + agency: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Discipline.ts b/src/modules/01_exam/interface/request/Discipline.ts new file mode 100644 index 0000000..334f2e8 --- /dev/null +++ b/src/modules/01_exam/interface/request/Discipline.ts @@ -0,0 +1,29 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + status: string; + level: string; + refNo: string; + refDate: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Document.ts b/src/modules/01_exam/interface/request/Document.ts new file mode 100644 index 0000000..9e1c218 --- /dev/null +++ b/src/modules/01_exam/interface/request/Document.ts @@ -0,0 +1,19 @@ +//ข้อมูล +interface RequestItemsObject { + name: String; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns }; diff --git a/src/modules/01_exam/interface/request/Education.ts b/src/modules/01_exam/interface/request/Education.ts new file mode 100644 index 0000000..3b4a37f --- /dev/null +++ b/src/modules/01_exam/interface/request/Education.ts @@ -0,0 +1,31 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + level: string; + levelId: string; + name: string; + start: number; + end: number; + education: string; + major: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Insignia.ts b/src/modules/01_exam/interface/request/Insignia.ts new file mode 100644 index 0000000..fb7eb81 --- /dev/null +++ b/src/modules/01_exam/interface/request/Insignia.ts @@ -0,0 +1,36 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + year: number; + receiveDate: Date; + insigniaType: string; + insigniaTypeId: string; + insignia: string; + insigniaId: string; + no: string; + gazetteNo: string; + volume: string; + book: string; + section: string; + page: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Leave.ts b/src/modules/01_exam/interface/request/Leave.ts new file mode 100644 index 0000000..5e36e33 --- /dev/null +++ b/src/modules/01_exam/interface/request/Leave.ts @@ -0,0 +1,38 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + year: number; + holiday: string; + sick: string; + government: string; + late: string; + other: string; + business: string; + maternity: string; + helpMaternity: string; + ordination: string; + study: string; + international: string; + spouse: string; + rehabilitation: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Main.ts b/src/modules/01_exam/interface/request/Main.ts new file mode 100644 index 0000000..dc6b137 --- /dev/null +++ b/src/modules/01_exam/interface/request/Main.ts @@ -0,0 +1,30 @@ +//ข้อมูล +interface RequestItemsObject { + id: number; + fullname: String; + avatar: String; + citizenId: String; + position: String; + line: String; + linePosition: String; + level: String; + positionFormalManage: String; + positionManage: String; + numberPosition: String; + government: String; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns }; diff --git a/src/modules/01_exam/interface/request/Other.ts b/src/modules/01_exam/interface/request/Other.ts new file mode 100644 index 0000000..986ae23 --- /dev/null +++ b/src/modules/01_exam/interface/request/Other.ts @@ -0,0 +1,25 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + detail: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Record.ts b/src/modules/01_exam/interface/request/Record.ts new file mode 100644 index 0000000..2a7235a --- /dev/null +++ b/src/modules/01_exam/interface/request/Record.ts @@ -0,0 +1,27 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + detail: string; + reference: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Salary.ts b/src/modules/01_exam/interface/request/Salary.ts new file mode 100644 index 0000000..f80c788 --- /dev/null +++ b/src/modules/01_exam/interface/request/Salary.ts @@ -0,0 +1,33 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + position: string; + positionId: string; + posNo: string; + posNoId: string; + level: string; + levelId: string; + salary: string; + reference: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Talent.ts b/src/modules/01_exam/interface/request/Talent.ts new file mode 100644 index 0000000..dada96a --- /dev/null +++ b/src/modules/01_exam/interface/request/Talent.ts @@ -0,0 +1,27 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + side: string; + detail: string; + note: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Train.ts b/src/modules/01_exam/interface/request/Train.ts new file mode 100644 index 0000000..107895e --- /dev/null +++ b/src/modules/01_exam/interface/request/Train.ts @@ -0,0 +1,31 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + course: string; + start: Date; + end: Date; + location: string; + detail: string; + organize: string; + gen: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Work.ts b/src/modules/01_exam/interface/request/Work.ts new file mode 100644 index 0000000..4631317 --- /dev/null +++ b/src/modules/01_exam/interface/request/Work.ts @@ -0,0 +1,28 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + start: Date; + end: Date; + detail: string; + reference: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/response/Certificate.ts b/src/modules/01_exam/interface/response/Certificate.ts new file mode 100644 index 0000000..a3d4017 --- /dev/null +++ b/src/modules/01_exam/interface/response/Certificate.ts @@ -0,0 +1,11 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + status: string; + level: string; + refNo: string; + refDate: Date; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Coin.ts b/src/modules/01_exam/interface/response/Coin.ts new file mode 100644 index 0000000..ea73301 --- /dev/null +++ b/src/modules/01_exam/interface/response/Coin.ts @@ -0,0 +1,9 @@ +//ข้อมูล +interface ResponseObject { + id: string; + receiveDate: Date; + detail: string; + agency: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Discipline.ts b/src/modules/01_exam/interface/response/Discipline.ts new file mode 100644 index 0000000..a3d4017 --- /dev/null +++ b/src/modules/01_exam/interface/response/Discipline.ts @@ -0,0 +1,11 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + status: string; + level: string; + refNo: string; + refDate: Date; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Document.ts b/src/modules/01_exam/interface/response/Document.ts new file mode 100644 index 0000000..4365fe3 --- /dev/null +++ b/src/modules/01_exam/interface/response/Document.ts @@ -0,0 +1,6 @@ +//ข้อมูล +interface ResponseObject { + name: String; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Education.ts b/src/modules/01_exam/interface/response/Education.ts new file mode 100644 index 0000000..2910198 --- /dev/null +++ b/src/modules/01_exam/interface/response/Education.ts @@ -0,0 +1,13 @@ +//ข้อมูล +interface ResponseObject { + id: string; + level: string; + levelId: string; + name: string; + start: number; + end: number; + education: string; + major: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Insignia.ts b/src/modules/01_exam/interface/response/Insignia.ts new file mode 100644 index 0000000..f42502d --- /dev/null +++ b/src/modules/01_exam/interface/response/Insignia.ts @@ -0,0 +1,18 @@ +//ข้อมูล +interface ResponseObject { + id: string; + year: number; + receiveDate: Date; + insigniaType: string; + insigniaTypeId: string; + insignia: string; + insigniaId: string; + no: string; + gazetteNo: string; + volume: string; + book: string; + section: string; + page: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Leave.ts b/src/modules/01_exam/interface/response/Leave.ts new file mode 100644 index 0000000..320552a --- /dev/null +++ b/src/modules/01_exam/interface/response/Leave.ts @@ -0,0 +1,20 @@ +//ข้อมูล +interface ResponseObject { + id: string; + year: number; + holiday: string; + sick: string; + government: string; + late: string; + other: string; + business: string; + maternity: string; + helpMaternity: string; + ordination: string; + study: string; + international: string; + spouse: string; + rehabilitation: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Main.ts b/src/modules/01_exam/interface/response/Main.ts new file mode 100644 index 0000000..6771a73 --- /dev/null +++ b/src/modules/01_exam/interface/response/Main.ts @@ -0,0 +1,17 @@ +//ข้อมูล +interface ResponseObject { + id: number; + fullname: String; + avatar: String; + citizenId: String; + position: String; + line: String; + linePosition: String; + level: String; + positionFormalManage: String; + positionManage: String; + numberPosition: String; + government: String; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Other.ts b/src/modules/01_exam/interface/response/Other.ts new file mode 100644 index 0000000..c2469ac --- /dev/null +++ b/src/modules/01_exam/interface/response/Other.ts @@ -0,0 +1,7 @@ +//ข้อมูล +interface ResponseObject { + id: string; + detail: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Record.ts b/src/modules/01_exam/interface/response/Record.ts new file mode 100644 index 0000000..5ed887b --- /dev/null +++ b/src/modules/01_exam/interface/response/Record.ts @@ -0,0 +1,9 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + detail: string; + reference: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Salary.ts b/src/modules/01_exam/interface/response/Salary.ts new file mode 100644 index 0000000..e8bc9ed --- /dev/null +++ b/src/modules/01_exam/interface/response/Salary.ts @@ -0,0 +1,15 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + position: string; + positionId: string; + posNo: string; + posNoId: string; + level: string; + levelId: string; + salary: string; + reference: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Talent.ts b/src/modules/01_exam/interface/response/Talent.ts new file mode 100644 index 0000000..7f6ec19 --- /dev/null +++ b/src/modules/01_exam/interface/response/Talent.ts @@ -0,0 +1,9 @@ +//ข้อมูล +interface ResponseObject { + id: string; + side: string; + detail: string; + note: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Train.ts b/src/modules/01_exam/interface/response/Train.ts new file mode 100644 index 0000000..2566c6a --- /dev/null +++ b/src/modules/01_exam/interface/response/Train.ts @@ -0,0 +1,13 @@ +//ข้อมูล +interface ResponseObject { + id: string; + course: string; + start: Date; + end: Date; + location: string; + detail: string; + organize: string; + gen: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Work.ts b/src/modules/01_exam/interface/response/Work.ts new file mode 100644 index 0000000..cb0b0a1 --- /dev/null +++ b/src/modules/01_exam/interface/response/Work.ts @@ -0,0 +1,10 @@ +//ข้อมูล +interface ResponseObject { + id: string; + start: Date; + end: Date; + detail: string; + reference: string; +} + +export type { ResponseObject }; diff --git a/src/modules/01_exam/router.ts b/src/modules/01_exam/router.ts new file mode 100644 index 0000000..697bfad --- /dev/null +++ b/src/modules/01_exam/router.ts @@ -0,0 +1,23 @@ +const Main = () => import('@/modules/01_exam/views/ExamMain.vue') +const Detail = () => import('@/modules/01_exam/views/ExamDetail.vue') + +export default [ + { + path: '/exam', + name: 'exam', + component: Main, + meta: { + Auth: true + // Key: [7] + } + }, + { + path: '/exam/:id', + name: 'examDetail', + component: Detail, + meta: { + Auth: true, + Key: [7] + } + } +] diff --git a/src/modules/01_exam/store.ts b/src/modules/01_exam/store.ts new file mode 100644 index 0000000..26f5d89 --- /dev/null +++ b/src/modules/01_exam/store.ts @@ -0,0 +1,26 @@ +import { ref, computed } from 'vue' +import { defineStore } from 'pinia' + +export const useExamDataStore = defineStore('exam', () => { + interface exam { + main: { columns: String[] } + } + + const examData = ref({ + main: { columns: [] } + }) + + const changeExamColumns = (system: String, val: String[]) => { + if (system == 'main') examData.value.main.columns = val + localStorage.setItem('exam', JSON.stringify(examData.value)) + } + + if (localStorage.getItem('exam') !== null) { + examData.value = JSON.parse(localStorage.getItem('exam') || '{}') + } + + return { + examData, + changeExamColumns + } +}) diff --git a/src/modules/01_exam/views/ExamDetail.vue b/src/modules/01_exam/views/ExamDetail.vue new file mode 100644 index 0000000..73fdcea --- /dev/null +++ b/src/modules/01_exam/views/ExamDetail.vue @@ -0,0 +1,87 @@ + + + + diff --git a/src/modules/01_exam/views/ExamMain.vue b/src/modules/01_exam/views/ExamMain.vue new file mode 100644 index 0000000..9f4d7e7 --- /dev/null +++ b/src/modules/01_exam/views/ExamMain.vue @@ -0,0 +1,231 @@ + + + + + diff --git a/src/modules/01_meta/interface/index/main.ts b/src/modules/01_meta/interface/index/main.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/modules/01_meta/interface/request/index.ts b/src/modules/01_meta/interface/request/index.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/modules/01_meta/interface/response/index.ts b/src/modules/01_meta/interface/response/index.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/modules/01_meta/router.ts b/src/modules/01_meta/router.ts deleted file mode 100644 index b9982e7..0000000 --- a/src/modules/01_meta/router.ts +++ /dev/null @@ -1,13 +0,0 @@ -const Meta = () => import('@/modules/01_meta/views/Meta01View.vue') - -export default [ - { - path: '/meta01', - name: 'meta01', - component: Meta, - meta: { - Auth: true - // Key: [7] - } - } -] diff --git a/src/modules/01_meta/store.ts b/src/modules/01_meta/store.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/modules/01_meta/views/Meta01View.vue b/src/modules/01_meta/views/Meta01View.vue deleted file mode 100644 index 17ad0af..0000000 --- a/src/modules/01_meta/views/Meta01View.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/src/router/index.ts b/src/router/index.ts index c9a28d6..8ab2472 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,6 @@ import { createRouter, createWebHistory } from 'vue-router' import HomeView from '../views/HomeView.vue' -import Meta01 from '@/modules/01_meta/router' +import Exam from '@/modules/01_exam/router' import Meta02 from '@/modules/02_meta/router' const MainLayout = () => import('@/views/MainLayout.vue') @@ -22,7 +22,7 @@ const router = createRouter({ Key: [7] } }, - ...Meta01, + ...Exam, ...Meta02 ] } diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 91d182b..eb2c506 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -63,7 +63,7 @@ const doLogout = () => { - diff --git a/src/modules/01_exam/components/Profile.vue b/src/modules/01_exam/components/Profile.vue new file mode 100644 index 0000000..e7d1f3a --- /dev/null +++ b/src/modules/01_exam/components/Profile.vue @@ -0,0 +1,4 @@ + + diff --git a/src/modules/01_exam/interface/request/Certificate.ts b/src/modules/01_exam/interface/request/Certificate.ts deleted file mode 100644 index 76a39d2..0000000 --- a/src/modules/01_exam/interface/request/Certificate.ts +++ /dev/null @@ -1,29 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; - } - - //ข้อมูล - interface RequestItemsObject { - id: string; - name: string; - certiNumber: string; - start: Date; - end: Date; - } - - //columns - interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; - } - - export type { RequestItemsObject, Columns, DataProps }; - \ No newline at end of file diff --git a/src/modules/01_exam/interface/request/Coin.ts b/src/modules/01_exam/interface/request/Coin.ts deleted file mode 100644 index b5d3d05..0000000 --- a/src/modules/01_exam/interface/request/Coin.ts +++ /dev/null @@ -1,27 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - receiveDate: Date; - detail: string; - agency: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Discipline.ts b/src/modules/01_exam/interface/request/Discipline.ts deleted file mode 100644 index 334f2e8..0000000 --- a/src/modules/01_exam/interface/request/Discipline.ts +++ /dev/null @@ -1,29 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - date: Date; - status: string; - level: string; - refNo: string; - refDate: Date; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Document.ts b/src/modules/01_exam/interface/request/Document.ts deleted file mode 100644 index 9e1c218..0000000 --- a/src/modules/01_exam/interface/request/Document.ts +++ /dev/null @@ -1,19 +0,0 @@ -//ข้อมูล -interface RequestItemsObject { - name: String; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns }; diff --git a/src/modules/01_exam/interface/request/Education.ts b/src/modules/01_exam/interface/request/Education.ts index 3b4a37f..d1c190a 100644 --- a/src/modules/01_exam/interface/request/Education.ts +++ b/src/modules/01_exam/interface/request/Education.ts @@ -1,31 +1,30 @@ interface DataProps { - row: RequestItemsObject; - rowIndex: number; + row: RequestItemsObject + rowIndex: number } //ข้อมูล interface RequestItemsObject { - id: string; - level: string; - levelId: string; - name: string; - start: number; - end: number; - education: string; - major: string; + id: string + qualificationId: string + qualification: string + major: string + scores: number | null + name: string + duration: any } //columns interface Columns { [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; + name: String + align: String + label: String + sortable: Boolean + field: String + headerStyle: String + style: String + } } -export type { RequestItemsObject, Columns, DataProps }; +export type { RequestItemsObject, Columns, DataProps } diff --git a/src/modules/01_exam/interface/request/Insignia.ts b/src/modules/01_exam/interface/request/Insignia.ts deleted file mode 100644 index fb7eb81..0000000 --- a/src/modules/01_exam/interface/request/Insignia.ts +++ /dev/null @@ -1,36 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - year: number; - receiveDate: Date; - insigniaType: string; - insigniaTypeId: string; - insignia: string; - insigniaId: string; - no: string; - gazetteNo: string; - volume: string; - book: string; - section: string; - page: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Leave.ts b/src/modules/01_exam/interface/request/Leave.ts deleted file mode 100644 index 5e36e33..0000000 --- a/src/modules/01_exam/interface/request/Leave.ts +++ /dev/null @@ -1,38 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - year: number; - holiday: string; - sick: string; - government: string; - late: string; - other: string; - business: string; - maternity: string; - helpMaternity: string; - ordination: string; - study: string; - international: string; - spouse: string; - rehabilitation: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Other.ts b/src/modules/01_exam/interface/request/Other.ts deleted file mode 100644 index 986ae23..0000000 --- a/src/modules/01_exam/interface/request/Other.ts +++ /dev/null @@ -1,25 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - detail: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Record.ts b/src/modules/01_exam/interface/request/Record.ts deleted file mode 100644 index 2a7235a..0000000 --- a/src/modules/01_exam/interface/request/Record.ts +++ /dev/null @@ -1,27 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - date: Date; - detail: string; - reference: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Salary.ts b/src/modules/01_exam/interface/request/Salary.ts deleted file mode 100644 index f80c788..0000000 --- a/src/modules/01_exam/interface/request/Salary.ts +++ /dev/null @@ -1,33 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - date: Date; - position: string; - positionId: string; - posNo: string; - posNoId: string; - level: string; - levelId: string; - salary: string; - reference: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Talent.ts b/src/modules/01_exam/interface/request/Talent.ts deleted file mode 100644 index dada96a..0000000 --- a/src/modules/01_exam/interface/request/Talent.ts +++ /dev/null @@ -1,27 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - side: string; - detail: string; - note: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Train.ts b/src/modules/01_exam/interface/request/Train.ts deleted file mode 100644 index 107895e..0000000 --- a/src/modules/01_exam/interface/request/Train.ts +++ /dev/null @@ -1,31 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - course: string; - start: Date; - end: Date; - location: string; - detail: string; - organize: string; - gen: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/request/Work.ts b/src/modules/01_exam/interface/request/Work.ts deleted file mode 100644 index 4631317..0000000 --- a/src/modules/01_exam/interface/request/Work.ts +++ /dev/null @@ -1,28 +0,0 @@ -interface DataProps { - row: RequestItemsObject; - rowIndex: number; -} - -//ข้อมูล -interface RequestItemsObject { - id: string; - start: Date; - end: Date; - detail: string; - reference: string; -} - -//columns -interface Columns { - [index: number]: { - name: String; - align: String; - label: String; - sortable: Boolean; - field: String; - headerStyle: String; - style: String; - }; -} - -export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/modules/01_exam/interface/response/Certificate.ts b/src/modules/01_exam/interface/response/Certificate.ts deleted file mode 100644 index a3d4017..0000000 --- a/src/modules/01_exam/interface/response/Certificate.ts +++ /dev/null @@ -1,11 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - date: Date; - status: string; - level: string; - refNo: string; - refDate: Date; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Coin.ts b/src/modules/01_exam/interface/response/Coin.ts deleted file mode 100644 index ea73301..0000000 --- a/src/modules/01_exam/interface/response/Coin.ts +++ /dev/null @@ -1,9 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - receiveDate: Date; - detail: string; - agency: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Discipline.ts b/src/modules/01_exam/interface/response/Discipline.ts deleted file mode 100644 index a3d4017..0000000 --- a/src/modules/01_exam/interface/response/Discipline.ts +++ /dev/null @@ -1,11 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - date: Date; - status: string; - level: string; - refNo: string; - refDate: Date; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Document.ts b/src/modules/01_exam/interface/response/Document.ts deleted file mode 100644 index 4365fe3..0000000 --- a/src/modules/01_exam/interface/response/Document.ts +++ /dev/null @@ -1,6 +0,0 @@ -//ข้อมูล -interface ResponseObject { - name: String; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Education.ts b/src/modules/01_exam/interface/response/Education.ts index 2910198..e9d22c0 100644 --- a/src/modules/01_exam/interface/response/Education.ts +++ b/src/modules/01_exam/interface/response/Education.ts @@ -1,13 +1,12 @@ //ข้อมูล interface ResponseObject { - id: string; - level: string; - levelId: string; - name: string; - start: number; - end: number; - education: string; - major: string; + id: string + qualificationId: string + qualification: string + major: string + scores: number | null + name: string + duration: any } -export type { ResponseObject }; +export type { ResponseObject } diff --git a/src/modules/01_exam/interface/response/Insignia.ts b/src/modules/01_exam/interface/response/Insignia.ts deleted file mode 100644 index f42502d..0000000 --- a/src/modules/01_exam/interface/response/Insignia.ts +++ /dev/null @@ -1,18 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - year: number; - receiveDate: Date; - insigniaType: string; - insigniaTypeId: string; - insignia: string; - insigniaId: string; - no: string; - gazetteNo: string; - volume: string; - book: string; - section: string; - page: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Leave.ts b/src/modules/01_exam/interface/response/Leave.ts deleted file mode 100644 index 320552a..0000000 --- a/src/modules/01_exam/interface/response/Leave.ts +++ /dev/null @@ -1,20 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - year: number; - holiday: string; - sick: string; - government: string; - late: string; - other: string; - business: string; - maternity: string; - helpMaternity: string; - ordination: string; - study: string; - international: string; - spouse: string; - rehabilitation: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Other.ts b/src/modules/01_exam/interface/response/Other.ts deleted file mode 100644 index c2469ac..0000000 --- a/src/modules/01_exam/interface/response/Other.ts +++ /dev/null @@ -1,7 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - detail: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Record.ts b/src/modules/01_exam/interface/response/Record.ts deleted file mode 100644 index 5ed887b..0000000 --- a/src/modules/01_exam/interface/response/Record.ts +++ /dev/null @@ -1,9 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - date: Date; - detail: string; - reference: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Salary.ts b/src/modules/01_exam/interface/response/Salary.ts deleted file mode 100644 index e8bc9ed..0000000 --- a/src/modules/01_exam/interface/response/Salary.ts +++ /dev/null @@ -1,15 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - date: Date; - position: string; - positionId: string; - posNo: string; - posNoId: string; - level: string; - levelId: string; - salary: string; - reference: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Talent.ts b/src/modules/01_exam/interface/response/Talent.ts deleted file mode 100644 index 7f6ec19..0000000 --- a/src/modules/01_exam/interface/response/Talent.ts +++ /dev/null @@ -1,9 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - side: string; - detail: string; - note: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Train.ts b/src/modules/01_exam/interface/response/Train.ts deleted file mode 100644 index 2566c6a..0000000 --- a/src/modules/01_exam/interface/response/Train.ts +++ /dev/null @@ -1,13 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - course: string; - start: Date; - end: Date; - location: string; - detail: string; - organize: string; - gen: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/interface/response/Work.ts b/src/modules/01_exam/interface/response/Work.ts deleted file mode 100644 index cb0b0a1..0000000 --- a/src/modules/01_exam/interface/response/Work.ts +++ /dev/null @@ -1,10 +0,0 @@ -//ข้อมูล -interface ResponseObject { - id: string; - start: Date; - end: Date; - detail: string; - reference: string; -} - -export type { ResponseObject }; diff --git a/src/modules/01_exam/store.ts b/src/modules/01_exam/store.ts index 26f5d89..c0ac940 100644 --- a/src/modules/01_exam/store.ts +++ b/src/modules/01_exam/store.ts @@ -4,14 +4,17 @@ import { defineStore } from 'pinia' export const useExamDataStore = defineStore('exam', () => { interface exam { main: { columns: String[] } + education: { columns: String[] } } const examData = ref({ - main: { columns: [] } + main: { columns: [] }, + education: { columns: [] } }) const changeExamColumns = (system: String, val: String[]) => { if (system == 'main') examData.value.main.columns = val + if (system == 'education') examData.value.education.columns = val localStorage.setItem('exam', JSON.stringify(examData.value)) } diff --git a/src/plugins/FullLoader.vue b/src/plugins/FullLoader.vue new file mode 100644 index 0000000..c517d7f --- /dev/null +++ b/src/plugins/FullLoader.vue @@ -0,0 +1,21 @@ + + + + diff --git a/src/plugins/axios.ts b/src/plugins/axios.ts new file mode 100644 index 0000000..79bba4e --- /dev/null +++ b/src/plugins/axios.ts @@ -0,0 +1,25 @@ +import axios from "axios" +import config from "process" +// import { dotnetPath } from "../path/axiosPath"; +// import { getToken } from "@baloise/vue-keycloak"; +import keycloak from "../plugins/keycloak" + +const axiosInstance = axios.create({ + withCredentials: false, +}) + +// axiosInstance.defaults.baseURL = dotnetPath; +axiosInstance.interceptors.request.use( + async (config) => { + const token = await keycloak.token + config.headers = { + Authorization: `Bearer ${token}`, + } + return config + }, + (error) => { + Promise.reject(error) + } +) + +export default axiosInstance diff --git a/src/plugins/http.ts b/src/plugins/http.ts new file mode 100644 index 0000000..494c9aa --- /dev/null +++ b/src/plugins/http.ts @@ -0,0 +1,45 @@ +import Axios, { type AxiosRequestConfig, type AxiosResponse } from "axios"; +import keycloak from "./keycloak"; + +const http = Axios.create({ + timeout: 1000000000, // เพิ่มค่า timeout + headers: { + "X-Requested-With": "XMLHttpRequest", + }, +}); + +http.interceptors.request.use( + async function (config: AxiosRequestConfig) { + await keycloak.updateToken(1); + config.headers = config.headers ?? {}; + const token = keycloak.token; + // const token = localStorage.getItem("access_token") + // const token = + // "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIxU2VKV2dVRFVlNXZwNS13Q1ZHaG9lT2l4bDJTTkdKemthLU5ZN211NXZJIn0.eyJleHAiOjE2NzI0MTI1NDksImlhdCI6MTY3MjM3NjU0OSwiYXV0aF90aW1lIjoxNjcyMzc2NTQ5LCJqdGkiOiI1MTVhY2IwNC1jODQ3LTQzM2YtYjUxOC03ODUzMzJhY2ZjNWYiLCJpc3MiOiJodHRwczovL2tleWNsb2FrLmZyYXBwZXQuc3lub2xvZ3kubWUvYXV0aC9yZWFsbXMvYm1hLWVociIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJlZmM5YjRlMC1mZGU2LTQ1NDQtYmU1OS1lMTA0MjEwMjUzZjAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJibWEtZWhyIiwibm9uY2UiOiI3NjMyMGI3ZS0xZTMxLTQ5ODYtYWIzOC1iOTUyYjFlODY3OGYiLCJzZXNzaW9uX3N0YXRlIjoiMDZlNTBkZjktNzAyNi00ZGIwLTkxMjgtMWY3Y2FiYTRkNDEyIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwczovL2xvY2FsaG9zdDo3MDA2Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJkZWZhdWx0LXJvbGVzLWJtYS1laHIiLCJvZmZsaW5lX2FjY2VzcyIsImFkbWluIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6Im9wZW5pZCBlbWFpbCBwcm9maWxlIiwic2lkIjoiMDZlNTBkZjktNzAyNi00ZGIwLTkxMjgtMWY3Y2FiYTRkNDEyIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsInJvbGUiOlsiZGVmYXVsdC1yb2xlcy1ibWEtZWhyIiwib2ZmbGluZV9hY2Nlc3MiLCJhZG1pbiIsInVtYV9hdXRob3JpemF0aW9uIl0sIm5hbWUiOiJTeXN0ZW0gQWRtaW5pc3RyYXRvciIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiZ2l2ZW5fbmFtZSI6IlN5c3RlbSIsImZhbWlseV9uYW1lIjoiQWRtaW5pc3RyYXRvciIsImVtYWlsIjoiYWRtaW5AbG9jYWxob3N0In0.xmfJ3pzI-jLYsaiFXyjTW7gfAEpvUmMVsp9BsB1CfRCVOKiGBbuZhnQY8W-1SWVAx1NjJ55L-zMHPK6hk1dRPLbEse3DlIBZw04W9j8m-Wz3eqdHf_UCjmrXb8qAwkeq0Iaxq9mVfJJeQWeKhFBi-Ff8ek4hCXTYDICXS8ny_BaC5WkyrefHQ2xBqQjwRyoxsg4IoVMjXYNb8L9A-4BNlRfs928SqgFYCRlF5h6zw_rC0XoLrGTmqeacBdpey-r3j2g_lTqWy8mQg2T9s65IDqW3kFPOsr0SVO88sjlFbN9Et0L57RmiqORk_RwzbWg-_Yb6dOuolXsnjBOhOoTzkA"; + if (token) config.headers.Authorization = `Bearer ${token}`; + return config; + }, + function (error: any) { + return Promise.reject(error); + } +); + +http.interceptors.response.use( + function (response: AxiosResponse) { + return response; + }, + function (error: any) { + if (typeof error !== undefined) { + // eslint-disable-next-line no-prototype-builtins + if (error.hasOwnProperty("response")) { + if (error.response.status === 401 || error.response.status === 403) { + // Store.commit("SET_ERROR_MESSAGE", error.response.data.message); + // Store.commit("REMOVE_ACCESS_TOKEN") + } + } + } + return Promise.reject(error); + } +); + +export default http; diff --git a/src/plugins/keycloak.ts b/src/plugins/keycloak.ts new file mode 100644 index 0000000..5d64de9 --- /dev/null +++ b/src/plugins/keycloak.ts @@ -0,0 +1,23 @@ +/** + * front connect to keycloak + */ +import Keycloak from "keycloak-js"; +// import config from "../app.config"; +// import http from "../shared/http"; +// import router from "../router"; + +const initOptions = { + // url: "https://keycloak.frappet.synology.me/auth/", + // realm: "bma-ehr", + // clientId: "bma-ehr-vue3", + url: "https://identity.frappet.com/", + realm: "bma-ehr", + clientId: "bma-ehr-vue3", +}; //option keycloak ที่จะ connect + +const keycloak = Keycloak(initOptions); + +keycloak.onAuthSuccess = () => {}; //เพิ่มlogin สำเร็จจะมาทำฟังก์ชันนี้ + +await keycloak.init({ checkLoginIframe: false }); //ทำการ connect keycloak +export default keycloak; From 6d0627594314c0e139d882bdfc846646a6cd1719 Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Thu, 16 Mar 2023 09:56:16 +0700 Subject: [PATCH 03/24] Update ExamFinished.vue --- src/modules/01_exam/components/ExamFinished.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/01_exam/components/ExamFinished.vue b/src/modules/01_exam/components/ExamFinished.vue index 0f69f3b..5b921f4 100644 --- a/src/modules/01_exam/components/ExamFinished.vue +++ b/src/modules/01_exam/components/ExamFinished.vue @@ -1,7 +1,7 @@ From 9179a14ed82fd033351050e4c3251dfc4ec28c0f Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 16 Mar 2023 13:52:21 +0700 Subject: [PATCH 04/24] =?UTF-8?q?ui=20=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=97=E0=B8=B3=E0=B8=87=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=20=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A8=E0=B8=B6?= =?UTF-8?q?=E0=B8=81=E0=B8=A9=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 14 + package.json | 1 + src/components/top.vue | 103 +--- src/main.ts | 1 + src/modules/01_exam/components/Address.vue | 233 +++++++ src/modules/01_exam/components/Career.vue | 576 +++++++++++++++++- src/modules/01_exam/components/Education.vue | 86 ++- src/modules/01_exam/components/ExamForm.vue | 2 +- src/modules/01_exam/components/Family.vue | 341 +++++++++++ .../01_exam/components/Information.vue | 343 +++++++++++ src/modules/01_exam/components/Profile.vue | 29 +- src/modules/01_exam/interface/index/Main.ts | 142 ++++- .../01_exam/interface/request/Career.ts | 29 + .../01_exam/interface/request/Education.ts | 2 +- .../01_exam/interface/response/Career.ts | 11 + .../01_exam/interface/response/Education.ts | 2 +- src/modules/01_exam/store.ts | 5 +- src/stores/mixin.ts | 348 +++++++++++ 18 files changed, 2162 insertions(+), 106 deletions(-) create mode 100644 src/modules/01_exam/components/Address.vue create mode 100644 src/modules/01_exam/components/Family.vue create mode 100644 src/modules/01_exam/components/Information.vue create mode 100644 src/modules/01_exam/interface/request/Career.ts create mode 100644 src/modules/01_exam/interface/response/Career.ts create mode 100644 src/stores/mixin.ts diff --git a/package-lock.json b/package-lock.json index 21fd5b7..4c78509 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@quasar/extras": "^1.15.11", "@vuepic/vue-datepicker": "^4.2.1", "keycloak-js": "^21.0.1", + "moment": "^2.29.4", "pinia": "^2.0.32", "quasar": "^2.11.7", "vue": "^3.2.47", @@ -5851,6 +5852,14 @@ "ufo": "^1.1.1" } }, + "node_modules/moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -12462,6 +12471,11 @@ "ufo": "^1.1.1" } }, + "moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index 65ddde9..5cfe785 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@quasar/extras": "^1.15.11", "@vuepic/vue-datepicker": "^4.2.1", "keycloak-js": "^21.0.1", + "moment": "^2.29.4", "pinia": "^2.0.32", "quasar": "^2.11.7", "vue": "^3.2.47", diff --git a/src/components/top.vue b/src/components/top.vue index e6c3cc3..403412f 100644 --- a/src/components/top.vue +++ b/src/components/top.vue @@ -2,24 +2,11 @@
-
+
{{ header }}
- แก้ไขข้อมูล - บันทึกข้อมูล - เพิ่มข้อมูล
- - - ประวัติ{{header}} - +
diff --git a/src/modules/01_exam/components/Education.vue b/src/modules/01_exam/components/Education.vue index 4f6751d..4446693 100644 --- a/src/modules/01_exam/components/Education.vue +++ b/src/modules/01_exam/components/Education.vue @@ -21,11 +21,8 @@ @click="selectData(props)" class="cursor-pointer" > -
- {{ col.value + 543 }} -
-
- {{ col.value + 543 }} +
+ {{ dateThaiRange(col.value) }}
{{ col.value }} @@ -54,8 +51,8 @@ :readonly="!edit" :borderless="!edit" v-model="qualificationId" - :rules="[(val) => !!val || `${'กรุณาเลือกระดับการศึกษา'}`]" - :label="`${'ระดับการศึกษา'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวุฒิที่ได้รับ'}`]" + :label="`${'วุฒิที่ได้รับ'}`" @update:modelValue="clickEditRow" emit-value map-options @@ -73,9 +70,25 @@ lazy-rules :readonly="!edit" :borderless="!edit" - v-model="name" - :rules="[(val) => !!val || `${'กรุณากรอกสถานศึกษา'}`]" - :label="`${'สถานศึกษา'}`" + v-model="major" + :rules="[(val) => !!val || `${'กรุณากรอกสาขาวิชา/วิชาเอก'}`]" + :label="`${'สาขาวิชา/วิชาเอก'}`" + @update:modelValue="clickEditRow" + /> +
+
+
@@ -88,12 +101,47 @@ lazy-rules :readonly="!edit" :borderless="!edit" - v-model="major" - :rules="[(val) => !!val || `${'กรุณากรอกสาขา/วิชาเอก'}`]" - :label="`${'สาขา/วิชาเอก'}`" + v-model="name" + :rules="[(val) => !!val || `${'กรุณากรอกชื่อสถานศึกษา'}`]" + :label="`${'ชื่อสถานศึกษา'}`" @update:modelValue="clickEditRow" />
+
+ + + + + +
@@ -126,6 +174,7 @@ import ProfileTable from '@/components/Table.vue' import DialogHeader from '@/components/DialogHeader.vue' import DialogFooter from '@/components/DialogFooter.vue' import { useQuasar } from 'quasar' +import { useCounterMixin } from '@/stores/mixin' import type { RequestItemsObject, Columns, @@ -145,6 +194,8 @@ const props = defineProps({ }) const $q = useQuasar() +const mixin = useCounterMixin() //เรียกฟังก์ชันกลาง +const { dateThaiRange } = mixin const store = useExamDataStore() const { examData, changeExamColumns } = store const loader = ref(false) @@ -155,7 +206,7 @@ const qualificationOptions = ref([]) const major = ref() const scores = ref() const name = ref() -const duration = ref() +const duration = ref<[Date, Date]>([new Date(), new Date()]) const myForm = ref() //form data input const edit = ref(false) //เช็คการกดปุ่มแก้ไขใน dialog const modal = ref(false) //modal add detail @@ -188,7 +239,7 @@ const rows = ref([ major: 'คอมพิวเตอร์', scores: 3.99, name: 'มหาลัยเอ', - duration: 2015 + duration: [new Date('1995-04-15'), new Date('1999-02-25')] }, { id: '2', @@ -197,7 +248,7 @@ const rows = ref([ major: 'คอมพิวเตอร์', scores: 3.54, name: 'มหาลัยบี', - duration: 2015 + duration: [new Date('2020-06-30'), new Date('2023-10-14')] } ]) @@ -415,6 +466,7 @@ const saveData = async () => { */ const editData = async () => { edit.value = false + editRow.value = false // loader.value = true; // await http @@ -492,7 +544,7 @@ const addData = () => { major.value = '' scores.value = null name.value = '' - duration.value = '' + duration.value = [new Date(), new Date()] } /** diff --git a/src/modules/01_exam/components/ExamForm.vue b/src/modules/01_exam/components/ExamForm.vue index 85b8e46..d270bf6 100644 --- a/src/modules/01_exam/components/ExamForm.vue +++ b/src/modules/01_exam/components/ExamForm.vue @@ -21,7 +21,7 @@ - + + +
+ + +
+ +
+
+
+
+ ***ถ้าต้องการเเก้ไขหลักฐานการโอนเงินกรุณาอัพโหลดซ้ำ*** +
diff --git a/src/modules/01_exam/interface/index/Main.ts b/src/modules/01_exam/interface/index/Main.ts index ec44f01..01c6d24 100644 --- a/src/modules/01_exam/interface/index/Main.ts +++ b/src/modules/01_exam/interface/index/Main.ts @@ -94,6 +94,109 @@ interface zipCodeOption { zipCode: string } +interface ExamCard { + id: string + title: string + announcementDate: Date + registerRound: Number + registerDateStart: Date + registerDateEnd: Date + yearly: Date +} + +const defaultCard: ExamCard[] = [ + { + id: '1', + title: 'การสอบภาค ข. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 2, + announcementDate: new Date('2022-11-23'), + registerDateStart: new Date('2022-11-09'), + registerDateEnd: new Date('2022-11-10'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + }, + { + id: '2', + title: 'การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว', + registerRound: 1, + announcementDate: new Date('2022-10-14'), + registerDateStart: new Date('2022-10-09'), + registerDateEnd: new Date('2022-11-30'), + yearly: new Date('2022-01-01') + } +] + const defaultAddress: Address = { address: 'บ้านเลขที่ 1/2 ซอย 56 ถนนตัดใหม่', provinceId: 'กรุงเทพ', @@ -163,7 +266,7 @@ const defaultOccupation: Occupation = { other: null } -export { defaultInformation, defaultFamily, defaultAddress, defaultOccupation } +export { defaultInformation, defaultFamily, defaultAddress, defaultOccupation, defaultCard } export type { Pagination, DataOption, @@ -173,5 +276,6 @@ export type { Family, Address, zipCodeOption, - Occupation + Occupation, + ExamCard } diff --git a/src/modules/01_exam/views/ExamMain.vue b/src/modules/01_exam/views/ExamMain.vue index 9f4d7e7..9daf7cf 100644 --- a/src/modules/01_exam/views/ExamMain.vue +++ b/src/modules/01_exam/views/ExamMain.vue @@ -6,8 +6,9 @@ > - - + + + From dca0d28c92048ae9d3517a20f0a31ab4f051d322 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Fri, 17 Mar 2023 11:31:20 +0700 Subject: [PATCH 14/24] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B9=88=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B9=84=E0=B8=82=E0=B8=AB=E0=B9=89=E0=B8=B2=E0=B8=A1=E0=B9=81?= =?UTF-8?q?=E0=B8=81=E0=B9=89=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9?= =?UTF-8?q?=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/top.vue | 8 ++++---- src/modules/01_exam/components/Address.vue | 2 ++ src/modules/01_exam/components/Family.vue | 2 ++ src/modules/01_exam/components/Image.vue | 9 ++++++++- src/modules/01_exam/components/Information.vue | 9 ++++++++- src/modules/01_exam/components/Occupation.vue | 9 ++++++++- src/modules/01_exam/components/OtherFile.vue | 2 ++ 7 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/components/top.vue b/src/components/top.vue index 403412f..4d8e9c3 100644 --- a/src/components/top.vue +++ b/src/components/top.vue @@ -6,7 +6,7 @@ {{ header }} -
+
- +
@@ -71,7 +71,7 @@ const props = defineProps({ }, addData: { type: Boolean, - defualt: false + defualt: true }, add: { type: Function, diff --git a/src/modules/01_exam/components/Address.vue b/src/modules/01_exam/components/Address.vue index 6b1041e..52afe72 100644 --- a/src/modules/01_exam/components/Address.vue +++ b/src/modules/01_exam/components/Address.vue @@ -13,6 +13,7 @@ icon="mdi-map-marker" :save="saveData" :history="true" + :addData="addData" />
@@ -236,6 +237,7 @@ const mixin = useCounterMixin() const { date2Thai, calAge } = mixin const edit = ref(false) +const addData = ref(false) const addressData = ref
(defaultAddress) const myform = ref() const codep = ref('') diff --git a/src/modules/01_exam/components/Family.vue b/src/modules/01_exam/components/Family.vue index ac35329..7d37a5d 100644 --- a/src/modules/01_exam/components/Family.vue +++ b/src/modules/01_exam/components/Family.vue @@ -6,6 +6,7 @@ header="ข้อมูลครอบครัว" icon="mdi-account-group" :save="saveData" + :addData="addData" />
@@ -279,6 +280,7 @@ const mixin = useCounterMixin() const { date2Thai, calAge } = mixin const edit = ref(false) +const addData = ref(false) const myform = ref() const familyData = ref(defaultFamily) const statusOptions = ref([]) diff --git a/src/modules/01_exam/components/Image.vue b/src/modules/01_exam/components/Image.vue index 3e10382..f469333 100644 --- a/src/modules/01_exam/components/Image.vue +++ b/src/modules/01_exam/components/Image.vue @@ -1,7 +1,13 @@ + + diff --git a/src/modules/01_exam/components/Occupation.vue b/src/modules/01_exam/components/Occupation.vue index 04d642e..825b1d6 100644 --- a/src/modules/01_exam/components/Occupation.vue +++ b/src/modules/01_exam/components/Occupation.vue @@ -7,6 +7,7 @@ icon="mdi-briefcase" :save="saveData" :addData="addData" + :cancel="cancelData" />
@@ -33,7 +34,7 @@ label="ข้าราชการกรุงเทพมหานคร ตำแหน่ง" dense :disable="!edit" - size="xs" + size="md" style="font-size: 14px; color: black" /> @@ -60,7 +61,7 @@ label="บุคลากรกรุงเทพมหานคร ตำแหน่ง" dense :disable="!edit" - size="xs" + size="md" style="font-size: 14px; color: black" /> @@ -87,7 +88,7 @@ label="ข้าราชการประเภทอื่น ตำแหน่ง" dense :disable="!edit" - size="xs" + size="md" style="font-size: 14px; color: black" /> @@ -114,7 +115,7 @@ label="ลูกจ้าง/พนักงานราชการของส่วนราชการอื่น ตำแหน่ง" dense :disable="!edit" - size="xs" + size="md" style="font-size: 14px; color: black" /> @@ -127,7 +128,7 @@ label="กำลังศึกษาต่อ" dense :disable="!edit" - size="xs" + size="md" style="font-size: 14px; color: black" /> @@ -227,7 +228,7 @@ diff --git a/src/modules/01_exam/components/OtherFile.vue b/src/modules/01_exam/components/OtherFile.vue index 5b00b71..3fad262 100644 --- a/src/modules/01_exam/components/OtherFile.vue +++ b/src/modules/01_exam/components/OtherFile.vue @@ -7,6 +7,7 @@ icon="mdi-file-document" :history="false" :addData="addData" + :cancel="cancelData" />
@@ -63,7 +64,7 @@ import { ref } from 'vue' import HeaderTop from '@/components/top.vue' const edit = ref(false) -const addData = ref(false) +const addData = ref(true) const files = ref([ { key: 1, @@ -84,4 +85,6 @@ const fileUpload = async (file: any) => { method: 'POST' } } + +const cancelData = () => {} diff --git a/src/modules/01_exam/components/Profile.vue b/src/modules/01_exam/components/Profile.vue index 8ac0ffa..1941104 100644 --- a/src/modules/01_exam/components/Profile.vue +++ b/src/modules/01_exam/components/Profile.vue @@ -1,5 +1,6 @@ diff --git a/src/modules/01_exam/router.ts b/src/modules/01_exam/router.ts index 697bfad..cba08b6 100644 --- a/src/modules/01_exam/router.ts +++ b/src/modules/01_exam/router.ts @@ -2,15 +2,15 @@ const Main = () => import('@/modules/01_exam/views/ExamMain.vue') const Detail = () => import('@/modules/01_exam/views/ExamDetail.vue') export default [ - { - path: '/exam', - name: 'exam', - component: Main, - meta: { - Auth: true - // Key: [7] - } - }, + // { + // path: '/exam', + // name: 'exam', + // component: Main, + // meta: { + // Auth: true + // // Key: [7] + // } + // }, { path: '/exam/:id', name: 'examDetail', diff --git a/src/modules/01_exam/views/ExamDetail.vue b/src/modules/01_exam/views/ExamDetail.vue index 73fdcea..0620bed 100644 --- a/src/modules/01_exam/views/ExamDetail.vue +++ b/src/modules/01_exam/views/ExamDetail.vue @@ -1,10 +1,9 @@ diff --git a/src/router/index.ts b/src/router/index.ts index 1606940..a99fef6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -3,31 +3,32 @@ import HomeView from '../views/HomeView.vue' import Exam from '@/modules/01_exam/router' import Meta02 from '@/modules/02_meta/router' -import keycloak from "@/plugins/keycloak"; +import keycloak from '@/plugins/keycloak' const MainLayout = () => import('@/views/MainLayout.vue') +const Error404NotFound = () => import('@/views/Error404NotFound.vue') const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { - path: '/', - name: 'home', + path: '/exam/:id', + // name: 'home', component: MainLayout, children: [ - { - path: '/', - name: 'dashboard', - component: HomeView, - meta: { - Auth: true, - Key: [7] - } - }, - ...Exam, - ...Meta02 + // { + // path: '/', + // name: 'dashboard', + // component: HomeView, + // meta: { + // Auth: true, + // Key: [7] + // } + // }, + ...Exam + // ...Meta02 ] - } + }, /** * 404 Not Found * ref: https://router.vuejs.org/guide/essentials/dynamic-matching.html#catch-all-404-not-found-route @@ -37,6 +38,11 @@ const router = createRouter({ // path: "/:pathMatch(.*)*", // component: Error404NotFound, // }, + { + // path: "/:catchAll(.*)*", // TODO: ใช้ pathMatch แทนตามในเอกสารแนะนำ คงไว้เผื่อจำเป็น + path: '/:pathMatch(.*)*', + component: Error404NotFound + } ] }) @@ -59,20 +65,20 @@ const router = createRouter({ // ] // }) router.beforeEach((to, from, next) => { - if (to.meta.Auth) { - if (!keycloak.authenticated) { - keycloak.login({ - redirectUri: `${window.location.protocol}//${window.location.host}${to.path}`, - locale: "th", - }); - } else { - // keycloak.updateToken(60); - next(); - } + if (to.meta.Auth) { + if (!keycloak.authenticated) { + keycloak.login({ + redirectUri: `${window.location.protocol}//${window.location.host}${to.path}`, + locale: 'th' + }) } else { - next(); + // keycloak.updateToken(60); + next() } - // next(); - }); + } else { + next() + } + // next(); +}) export default router diff --git a/src/views/Error404NotFound.vue b/src/views/Error404NotFound.vue new file mode 100644 index 0000000..e06a8c1 --- /dev/null +++ b/src/views/Error404NotFound.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index eb2c506..23f3347 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -68,7 +68,7 @@ const doLogout = () => { - { size="20px" color="grey-7" /> - + --> @@ -208,7 +208,7 @@ const doLogout = () => { - {
- { dense exact > - @@ -299,7 +271,7 @@ const doLogout = () => {
-
+ --> diff --git a/vite.config.ts b/vite.config.ts index 503d8e0..2e9eeec 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,7 +8,9 @@ import { quasar, transformAssetUrls } from '@quasar/vite-plugin' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ - vue(), + vue({ + template: { transformAssetUrls } + }), quasar({ sassVariables: 'src/style/quasar-variables.sass' }), @@ -18,5 +20,8 @@ export default defineConfig({ alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } + }, + build: { + target: 'esnext' } }) From 6ab1a862d6fa5a2276e6cc186389901ed934ba88 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Sun, 19 Mar 2023 00:43:28 +0700 Subject: [PATCH 20/24] =?UTF-8?q?=E0=B9=80=E0=B8=8A=E0=B9=87=E0=B8=84?= =?UTF-8?q?=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=81=E0=B9=88=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B8=A5=E0=B8=B5=E0=B9=88=E0=B8=A2=E0=B8=99?= =?UTF-8?q?=20tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DialogFooter.vue | 116 +++++++++--------- src/components/Table.vue | 13 +- src/components/top.vue | 6 + src/modules/01_exam/components/Document.vue | 10 -- src/modules/01_exam/components/ExamDetail.vue | 19 +++ .../01_exam/components/ExamFinished.vue | 17 ++- src/modules/01_exam/components/ExamForm.vue | 113 ++++++++++++++--- .../01_exam/components/ExamPayment.vue | 96 ++++++++++----- .../01_exam/components/{ => Form}/Career.vue | 14 ++- .../{OtherFile.vue => Form/Document.vue} | 37 +++++- .../components/{ => Form}/Education.vue | 15 ++- .../01_exam/components/Form/Profile.vue | 86 +++++++++++++ .../components/{ => Form/Profile}/Address.vue | 32 +++-- .../components/{ => Form/Profile}/Family.vue | 31 ++++- .../{ => Form/Profile}/Information.vue | 33 +++-- .../{ => Form/Profile}/Occupation.vue | 31 ++++- src/modules/01_exam/components/Profile.vue | 57 --------- src/modules/01_exam/views/ExamDetail.vue | 64 +++++----- 18 files changed, 547 insertions(+), 243 deletions(-) delete mode 100644 src/modules/01_exam/components/Document.vue rename src/modules/01_exam/components/{ => Form}/Career.vue (98%) rename src/modules/01_exam/components/{OtherFile.vue => Form/Document.vue} (73%) rename src/modules/01_exam/components/{ => Form}/Education.vue (98%) create mode 100644 src/modules/01_exam/components/Form/Profile.vue rename src/modules/01_exam/components/{ => Form/Profile}/Address.vue (96%) rename src/modules/01_exam/components/{ => Form/Profile}/Family.vue (95%) rename src/modules/01_exam/components/{ => Form/Profile}/Information.vue (96%) rename src/modules/01_exam/components/{ => Form/Profile}/Occupation.vue (94%) delete mode 100644 src/modules/01_exam/components/Profile.vue diff --git a/src/components/DialogFooter.vue b/src/components/DialogFooter.vue index 8975b2b..3855e85 100644 --- a/src/components/DialogFooter.vue +++ b/src/components/DialogFooter.vue @@ -19,108 +19,110 @@ :color="!next ? 'grey-7' : 'public'" /> - - แก้ไขข้อมูล - -
+
- ยกเลิก - - - บันทึก + แก้ไขข้อมูล +
+ + ยกเลิก + + + บันทึก + +
diff --git a/src/components/Table.vue b/src/components/Table.vue index 7620a0a..4329748 100644 --- a/src/components/Table.vue +++ b/src/components/Table.vue @@ -6,13 +6,14 @@ :header="name" :icon="icon" :add="checkAdd" - :addData="true" :history="false" v-if="nameHeader" /> - - เพิ่มข้อมูล - +
+ + เพิ่มข้อมูล + +
@@ -102,6 +103,10 @@ const props = defineProps({ inputvisible: Array, editvisible: Boolean, nameHeader: Boolean, + addData: { + type: Boolean, + defualt: true + }, edit: { type: Function, default: () => console.log('not function') diff --git a/src/components/top.vue b/src/components/top.vue index 4d8e9c3..87144c1 100644 --- a/src/components/top.vue +++ b/src/components/top.vue @@ -88,6 +88,10 @@ const props = defineProps({ cancel: { type: Function, default: () => console.log('not function') + }, + changeBtn: { + type: Function, + default: () => console.log('not function') } }) @@ -99,11 +103,13 @@ const updateEdit = (value: any) => { const ClickEdit = () => { updateEdit(!props.edit) + props.changeBtn() } const ClickCancel = () => { updateEdit(!props.edit) props.cancel() + props.changeBtn() } const save = () => { diff --git a/src/modules/01_exam/components/Document.vue b/src/modules/01_exam/components/Document.vue deleted file mode 100644 index 3f0b923..0000000 --- a/src/modules/01_exam/components/Document.vue +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/src/modules/01_exam/components/ExamDetail.vue b/src/modules/01_exam/components/ExamDetail.vue index 4741ff6..171b13a 100644 --- a/src/modules/01_exam/components/ExamDetail.vue +++ b/src/modules/01_exam/components/ExamDetail.vue @@ -52,6 +52,10 @@ จะต้องเป็นชื่อที่ตรงกับบัตรประจำตัวประชาชน
+ +
+ +
@@ -59,6 +63,17 @@ import { ref } from 'vue' import { useCounterMixin } from '@/stores/mixin' +const props = defineProps({ + fetchStep: { + type: Function, + default: () => console.log('not function') + }, + step: { + type: Number, + required: true + } +}) + const mixin = useCounterMixin() const { date2Thai } = mixin const exam = ref({ @@ -78,6 +93,10 @@ const exam = ref({ } ] }) + +const applyCandidate = () => { + props.fetchStep() +} diff --git a/src/modules/01_exam/components/ExamFinished.vue b/src/modules/01_exam/components/ExamFinished.vue index 8fe7cad..1ab0a06 100644 --- a/src/modules/01_exam/components/ExamFinished.vue +++ b/src/modules/01_exam/components/ExamFinished.vue @@ -62,14 +62,25 @@ - -
+
diff --git a/src/modules/01_exam/components/ExamPayment.vue b/src/modules/01_exam/components/ExamPayment.vue index 1bf88ac..f9c6496 100644 --- a/src/modules/01_exam/components/ExamPayment.vue +++ b/src/modules/01_exam/components/ExamPayment.vue @@ -1,5 +1,5 @@ diff --git a/src/modules/01_exam/components/Address.vue b/src/modules/01_exam/components/Form/Profile/Address.vue similarity index 96% rename from src/modules/01_exam/components/Address.vue rename to src/modules/01_exam/components/Form/Profile/Address.vue index d8e3842..1a0811c 100644 --- a/src/modules/01_exam/components/Address.vue +++ b/src/modules/01_exam/components/Form/Profile/Address.vue @@ -15,6 +15,7 @@ :history="true" :addData="addData" :cancel="cancelData" + :changeBtn="changeBtn" />
@@ -254,19 +255,23 @@ const props = defineProps({ statusEdit: { type: Boolean, required: true + }, + notiNoEdit: { + type: Function, + default: () => console.log('not function') + }, + step: { + type: Number, + required: true } }) const emit = defineEmits(['update:statusEdit']) -watch(edit, (count: boolean, prevCount: boolean) => { - if (props.statusEdit == true) { - edit.value = false - emit('update:statusEdit', count) - } -}) - onMounted(() => { + if (props.step !== 2) { + addData.value = false + } // fetchProvince() // fetchDistrict(addressData.value.provinceId, '1') // fetchDistrict(addressData.value.provinceIdC, '2') @@ -280,6 +285,19 @@ const saveData = async () => { }) } +const changeBtn = async () => { + if (edit.value == true) { + if (props.statusEdit === true) { + edit.value = false + props.notiNoEdit() + } else { + emit('update:statusEdit', true) + } + } else { + emit('update:statusEdit', false) + } +} + const selectProvince = (e: string, name: string) => { if (name == '1') { addressData.value.districtId = '' diff --git a/src/modules/01_exam/components/Family.vue b/src/modules/01_exam/components/Form/Profile/Family.vue similarity index 95% rename from src/modules/01_exam/components/Family.vue rename to src/modules/01_exam/components/Form/Profile/Family.vue index 67197d2..e804fb7 100644 --- a/src/modules/01_exam/components/Family.vue +++ b/src/modules/01_exam/components/Form/Profile/Family.vue @@ -8,6 +8,7 @@ :save="saveData" :addData="addData" :cancel="cancelData" + :changeBtn="changeBtn" />
@@ -270,7 +271,7 @@ diff --git a/src/modules/01_exam/views/ExamDetail.vue b/src/modules/01_exam/views/ExamDetail.vue index 0620bed..e315967 100644 --- a/src/modules/01_exam/views/ExamDetail.vue +++ b/src/modules/01_exam/views/ExamDetail.vue @@ -7,42 +7,58 @@
+ - - + + - - + + - + - - + +
- From a61dfb8789699ecd18d7e9f7f0d96b048312df73 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Sun, 19 Mar 2023 00:59:27 +0700 Subject: [PATCH 21/24] =?UTF-8?q?=E0=B8=9B=E0=B8=B4=E0=B8=94=20api=20?= =?UTF-8?q?=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=A2=E0=B8=B1=E0=B8=87=E0=B9=84?= =?UTF-8?q?=E0=B8=A1=E0=B9=88=E0=B9=84=E0=B8=94=E0=B9=88=E0=B9=83=E0=B8=8A?= =?UTF-8?q?=E0=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 13 +- .../01_exam/components/Form/Education.vue | 28 ++-- .../components/Form/Profile/Address.vue | 120 +++++++++--------- .../components/Form/Profile/Information.vue | 32 ++--- src/modules/02_meta/store.ts | 10 ++ src/views/MainLayout.vue | 2 +- 6 files changed, 109 insertions(+), 96 deletions(-) diff --git a/src/main.ts b/src/main.ts index 8ee987c..5cfd907 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,22 +1,23 @@ import { createApp, defineAsyncComponent } from 'vue' -import { createPinia } from 'pinia' -import { Dialog, Notify, Quasar } from 'quasar' - import App from './App.vue' import router from './router' +import { Dialog, Notify, Quasar } from 'quasar' import quasarUserOptions from './quasar-user-options' -import '@vuepic/vue-datepicker/dist/main.css' import 'quasar/src/css/index.sass' import th from 'quasar/lang/th' +import '@vuepic/vue-datepicker/dist/main.css' +import http from './plugins/http' +import { createPinia } from 'pinia' + // import './assets/main.css' const app = createApp(App) const pinia = createPinia() -app.use(pinia) app.use(router) +app.use(pinia) app.use( Quasar, @@ -52,4 +53,6 @@ app.component( defineAsyncComponent(() => import('./plugins/FullLoader.vue')) ) +app.config.globalProperties.$http = http + app.mount('#app') diff --git a/src/modules/01_exam/components/Form/Education.vue b/src/modules/01_exam/components/Form/Education.vue index 23d164d..42933f5 100644 --- a/src/modules/01_exam/components/Form/Education.vue +++ b/src/modules/01_exam/components/Form/Education.vue @@ -333,20 +333,20 @@ onMounted(async () => { const fetchQualification = async () => { // loader.value = true; - await http - .get(config.API.educationQualification) - .then((res) => { - const data = res.data.result - let option: DataOption[] = [] - data.map((r: any) => { - option.push({ id: r.id.toString(), name: r.name.toString() }) - }) - qualificationOptions.value = option - }) - .catch((e: any) => {}) - .finally(() => { - // loader.value = false; - }) + // await http + // .get(config.API.educationQualification) + // .then((res) => { + // const data = res.data.result + // let option: DataOption[] = [] + // data.map((r: any) => { + // option.push({ id: r.id.toString(), name: r.name.toString() }) + // }) + // qualificationOptions.value = option + // }) + // .catch((e: any) => {}) + // .finally(() => { + // // loader.value = false; + // }) } const fetchData = async () => {} diff --git a/src/modules/01_exam/components/Form/Profile/Address.vue b/src/modules/01_exam/components/Form/Profile/Address.vue index 1a0811c..a2e284d 100644 --- a/src/modules/01_exam/components/Form/Profile/Address.vue +++ b/src/modules/01_exam/components/Form/Profile/Address.vue @@ -342,72 +342,72 @@ const selectSubDistrict = (e: string, name: string) => { } const fetchProvince = async () => { - // loader.value = true; - await http - .get(config.API.province) - .then((res) => { - const data = res.data.result - let option: DataOption[] = [] - // console.log(data); - data.map((r: any) => { - option.push({ id: r.id.toString(), name: r.name.toString() }) - }) - provinceOptions.value = option - }) - .catch((e: any) => {}) - .finally(() => { - // loader.value = false; - }) + // // loader.value = true; + // await http + // .get(config.API.province) + // .then((res) => { + // const data = res.data.result + // let option: DataOption[] = [] + // // console.log(data); + // data.map((r: any) => { + // option.push({ id: r.id.toString(), name: r.name.toString() }) + // }) + // provinceOptions.value = option + // }) + // .catch((e: any) => {}) + // .finally(() => { + // // loader.value = false; + // }) } const fetchDistrict = async (id: string, position: string) => { - // loader.value = true; - await http - .get(config.API.listDistrict(id)) - .then((res) => { - const data = res.data.result - let option: DataOption[] = [] - // console.log(data); - data.map((r: any) => { - option.push({ id: r.id.toString(), name: r.name.toString() }) - }) - if (position == '1') { - districtOptions.value = option - } else { - districtCOptions.value = option - } - }) - .catch((e: any) => {}) - .finally(() => { - // loader.value = false; - }) + // // loader.value = true; + // await http + // .get(config.API.listDistrict(id)) + // .then((res) => { + // const data = res.data.result + // let option: DataOption[] = [] + // // console.log(data); + // data.map((r: any) => { + // option.push({ id: r.id.toString(), name: r.name.toString() }) + // }) + // if (position == '1') { + // districtOptions.value = option + // } else { + // districtCOptions.value = option + // } + // }) + // .catch((e: any) => {}) + // .finally(() => { + // // loader.value = false; + // }) } const fetchSubDistrict = async (id: string, position: string) => { - // loader.value = true; - await http - .get(config.API.listSubDistrict(id)) - .then((res) => { - const data = res.data.result - let option: zipCodeOption[] = [] - // console.log(res); - data.map((r: any) => { - option.push({ - id: r.id.toString(), - name: r.name.toString(), - zipCode: r.zipCode.toString() - }) - }) - if (position == '1') { - subdistrictOptions.value = option - } else { - subdistrictCOptions.value = option - } - }) - .catch((e: any) => {}) - .finally(() => { - // loader.value = false; - }) + // // loader.value = true; + // await http + // .get(config.API.listSubDistrict(id)) + // .then((res) => { + // const data = res.data.result + // let option: zipCodeOption[] = [] + // // console.log(res); + // data.map((r: any) => { + // option.push({ + // id: r.id.toString(), + // name: r.name.toString(), + // zipCode: r.zipCode.toString() + // }) + // }) + // if (position == '1') { + // subdistrictOptions.value = option + // } else { + // subdistrictCOptions.value = option + // } + // }) + // .catch((e: any) => {}) + // .finally(() => { + // // loader.value = false; + // }) } const cancelData = () => {} diff --git a/src/modules/01_exam/components/Form/Profile/Information.vue b/src/modules/01_exam/components/Form/Profile/Information.vue index 4df08cf..ccd2e58 100644 --- a/src/modules/01_exam/components/Form/Profile/Information.vue +++ b/src/modules/01_exam/components/Form/Profile/Information.vue @@ -415,22 +415,22 @@ const changeBtn = async () => { } const fetchProvince = async () => { - // loader.value = true; - await http - .get(config.API.province) - .then((res) => { - const data = res.data.result - let option: DataOption[] = [] - // console.log(data); - data.map((r: any) => { - option.push({ id: r.id.toString(), name: r.name.toString() }) - }) - provinceOptions.value = option - }) - .catch((e: any) => {}) - .finally(() => { - // loader.value = false; - }) + // // loader.value = true; + // await http + // .get(config.API.province) + // .then((res) => { + // const data = res.data.result + // let option: DataOption[] = [] + // // console.log(data); + // data.map((r: any) => { + // option.push({ id: r.id.toString(), name: r.name.toString() }) + // }) + // provinceOptions.value = option + // }) + // .catch((e: any) => {}) + // .finally(() => { + // // loader.value = false; + // }) } const savePic = () => { diff --git a/src/modules/02_meta/store.ts b/src/modules/02_meta/store.ts index e69de29..b0e868c 100644 --- a/src/modules/02_meta/store.ts +++ b/src/modules/02_meta/store.ts @@ -0,0 +1,10 @@ +import { ref, computed } from 'vue' +import { defineStore } from 'pinia' + +export const useMetaStore = defineStore('meta', () => { + const meta = ref('') + + return { + meta + } +}) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 23f3347..941e7b7 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -64,7 +64,7 @@ const doLogout = () => { - + From e7198525a2b59e0fed127976f7eeec4db2c21480 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Sun, 19 Mar 2023 01:03:36 +0700 Subject: [PATCH 22/24] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A8=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B9=83=E0=B8=99?= =?UTF-8?q?=E0=B9=84=E0=B8=9F=E0=B8=A5=E0=B9=8C=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/02_meta/interface/index/main.ts | 10 +++++++ src/modules/02_meta/interface/request/Main.ts | 28 +++++++++++++++++++ .../02_meta/interface/request/index.ts | 0 .../02_meta/interface/response/Main.ts | 11 ++++++++ .../02_meta/interface/response/index.ts | 0 5 files changed, 49 insertions(+) create mode 100644 src/modules/02_meta/interface/request/Main.ts delete mode 100644 src/modules/02_meta/interface/request/index.ts create mode 100644 src/modules/02_meta/interface/response/Main.ts delete mode 100644 src/modules/02_meta/interface/response/index.ts diff --git a/src/modules/02_meta/interface/index/main.ts b/src/modules/02_meta/interface/index/main.ts index e69de29..254d833 100644 --- a/src/modules/02_meta/interface/index/main.ts +++ b/src/modules/02_meta/interface/index/main.ts @@ -0,0 +1,10 @@ +interface Pagination { + rowsPerPage: number +} + +interface DataOption { + id: string + name: string +} + +export type { Pagination, DataOption } diff --git a/src/modules/02_meta/interface/request/Main.ts b/src/modules/02_meta/interface/request/Main.ts new file mode 100644 index 0000000..1d8f36d --- /dev/null +++ b/src/modules/02_meta/interface/request/Main.ts @@ -0,0 +1,28 @@ +interface DataProps { + row: RequestItemsObject + rowIndex: number +} + +//ข้อมูล +interface RequestItemsObject { + id: string + name: string + certiNumber: string + start: Date + end: Date +} + +//columns +interface Columns { + [index: number]: { + name: String + align: String + label: String + sortable: Boolean + field: String + headerStyle: String + style: String + } +} + +export type { RequestItemsObject, Columns, DataProps } diff --git a/src/modules/02_meta/interface/request/index.ts b/src/modules/02_meta/interface/request/index.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/modules/02_meta/interface/response/Main.ts b/src/modules/02_meta/interface/response/Main.ts new file mode 100644 index 0000000..9a1f525 --- /dev/null +++ b/src/modules/02_meta/interface/response/Main.ts @@ -0,0 +1,11 @@ +//ข้อมูล +interface ResponseObject { + id: string + date: Date + status: string + level: string + refNo: string + refDate: Date +} + +export type { ResponseObject } diff --git a/src/modules/02_meta/interface/response/index.ts b/src/modules/02_meta/interface/response/index.ts deleted file mode 100644 index e69de29..0000000 From 6b78719b5912d8b8554c72ee4bf590df2d1effdc Mon Sep 17 00:00:00 2001 From: Kittapath Date: Mon, 20 Mar 2023 13:01:27 +0700 Subject: [PATCH 23/24] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B8=A1?= =?UTF-8?q?=E0=B9=88=E0=B8=9B=E0=B8=B8=E0=B9=88=E0=B8=A1=E0=B8=A5=E0=B8=9A?= =?UTF-8?q?=20=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95?= =?UTF-8?q?=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A8=E0=B8=B6=E0=B8=81?= =?UTF-8?q?=E0=B8=A9=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 5 + Dockerfile | 12 +++ nginx.conf | 30 ++++++ src/components/DialogFooter.vue | 4 +- src/components/Table.vue | 30 ++++-- src/components/top.vue | 48 ++++++++- src/main.ts | 4 +- src/modules/01_exam/components/ExamDetail.vue | 2 +- src/modules/01_exam/components/ExamForm.vue | 69 +++++++++++-- .../01_exam/components/Form/Career.vue | 98 ++++++++++++++----- .../01_exam/components/Form/Document.vue | 63 +++++++----- .../01_exam/components/Form/Education.vue | 98 ++++++++++++++----- .../components/Form/Profile/Information.vue | 2 +- src/modules/01_exam/views/ExamDetail.vue | 49 ++++++++-- src/router/index.ts | 28 +++--- src/views/MainLayout.vue | 37 ++++--- 16 files changed, 432 insertions(+), 147 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b82d800 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +**/node_modules +**/dist +Dockerfile +docker-compose.yaml + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5c805e9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# docker build . -t docker.frappet.com/demo/fe:latest +FROM node:latest as build-stage +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY ./ . +RUN npm run build + +FROM nginx as production-stage +RUN mkdir /app +COPY --from=build-stage /app/dist /app +COPY nginx.conf /etc/nginx/nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..6f61d6c --- /dev/null +++ b/nginx.conf @@ -0,0 +1,30 @@ +user nginx; +worker_processes 1; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; +events { + worker_connections 1024; +} +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + access_log /var/log/nginx/access.log main; + sendfile on; + keepalive_timeout 65; + server { + listen 80; + server_name localhost; + location / { + root /app; + index index.html; + try_files $uri $uri/ /index.html; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +} diff --git a/src/components/DialogFooter.vue b/src/components/DialogFooter.vue index 3855e85..c2426f3 100644 --- a/src/components/DialogFooter.vue +++ b/src/components/DialogFooter.vue @@ -32,7 +32,7 @@ แก้ไขข้อมูล
- ยกเลิก - + --> -
+ +
@@ -75,6 +78,7 @@ {{ col.label }} + diff --git a/src/router/index.ts b/src/router/index.ts index a99fef6..24f600a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -65,20 +65,20 @@ const router = createRouter({ // ] // }) router.beforeEach((to, from, next) => { - if (to.meta.Auth) { - if (!keycloak.authenticated) { - keycloak.login({ - redirectUri: `${window.location.protocol}//${window.location.host}${to.path}`, - locale: 'th' - }) - } else { - // keycloak.updateToken(60); - next() - } - } else { - next() - } - // next(); + // if (to.meta.Auth) { + // if (!keycloak.authenticated) { + // keycloak.login({ + // redirectUri: `${window.location.protocol}//${window.location.host}${to.path}`, + // locale: 'th' + // }) + // } else { + // // keycloak.updateToken(60); + // next() + // } + // } else { + // next() + // } + next() }) export default router diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 941e7b7..7a5dad9 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -1,11 +1,14 @@