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}}
-
+
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"
/>
+
+
+
+ {{ year + 543 }}
+
+
+ {{ parseInt(value + 543) }}
+
+
+
+
+
+
+
+
+
+
+
@@ -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 @@
-
+