diff --git a/src/api/exam/api.candidate.ts b/src/api/exam/api.candidate.ts new file mode 100644 index 0000000..461878a --- /dev/null +++ b/src/api/exam/api.candidate.ts @@ -0,0 +1,7 @@ +import env from '../index' +const candidate = `${env.API_URI}/candidate/` + +export default { + countDashbordSubHistory: (examId: string) => `${candidate}information/${examId}`, + candidate +} diff --git a/src/app.config.ts b/src/app.config.ts index 972b2b6..574d10c 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,9 +1,11 @@ /**ใช้รวมไฟล์ย่อยๆ ของ api แต่ละไฟล์ */ import metadata from './api/exam/api.metadata' +import candidate from './api/exam/api.candidate' const API = { - ...metadata + ...metadata, + ...candidate } export default { diff --git a/src/modules/01_exam/components/Form/Profile/Information.vue b/src/modules/01_exam/components/Form/Profile/Information.vue index 4ab50b7..aa46643 100644 --- a/src/modules/01_exam/components/Form/Profile/Information.vue +++ b/src/modules/01_exam/components/Form/Profile/Information.vue @@ -179,7 +179,6 @@ (val) => val.length >= 13 || `${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}` ]" label="เลขบัตรประจำตัวประชาชน" - mask="#############" />
@@ -198,7 +197,7 @@ option-label="name" :options="provinceOptions" option-value="id" - :label="`${'จังหวัด'}`" + :label="`${'ออกให้ ณ จังหวัด'}`" @update:model-value="(value) => selectProvince(value)" />
@@ -364,7 +363,7 @@ import { ref, onMounted, watch } from 'vue' import { useCounterMixin } from '@/stores/mixin' import type { PropType } from 'vue' -import type { Information, DataOption } from '@/modules/01_exam/interface/index/Main' +import { Information, DataOption } from '@/modules/01_exam/interface/index/Main' import { defaultInformation } from '@/modules/01_exam/interface/index/Main' import HeaderTop from '@/components/top.vue' import http from '@/plugins/http' @@ -380,6 +379,8 @@ const prefixOptions = ref([]) const relationshipOptions = ref([]) const districtOptions = ref([]) +const candidateId = ref('2223ba53-2fb2-470b-8dc1-27e5471b0331') + const edit = ref(false) const informaData = ref(defaultInformation) const provinceOptions = ref([]) @@ -436,11 +437,28 @@ onMounted(async () => { await fetchProvince() await fetchDistrict(informaData.value.provinceId) }) -const fetchData = () => { - informaData.value.prefix = 'e4e6a4f8-39c6-467f-bd84-7650d105fc4c' - informaData.value.relationship = '02fbc0e3-1da0-45b5-90da-783d344b5896' - informaData.value.provinceId = '02fbc0e3-1da0-45b5-90da-783d344b5896' - informaData.value.districtId = 'e4e6a4f8-39c6-467f-bd84-7650d105fc4c' +const fetchData = async () => { + await http + .get(config.API.countDashbordSubHistory(candidateId.value)) + .then((res) => { + const data = res.data.result + informaData.value.prefix = data.prefixId + informaData.value.lastname = data.lastName + informaData.value.province = data.citizenProvinceId + informaData.value.districtId = data.citizenDistrictId + informaData.value.birthDate = new Date(data.dateOfBirth) + informaData.value.cardIdDate = new Date(data.dateOfBirth) + informaData.value.cardid = data.citizenId + informaData.value.firstname = data.firstName + informaData.value.relationship = data.relationshipId + informaData.value.nationality = data.nationality + informaData.value.email = data.email + // informaData.value = data + }) + .catch((e: any) => {}) + .finally(() => { + // loader.value = false; + }) } const selectProvince = (e: string) => { informaData.value.districtId = ''