From 9d77ed62988a5801e0707da1117e355d95e23408 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Tue, 26 Mar 2024 10:28:41 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4:=20store=20=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=AA=E0=B9=88=E0=B8=A7?= =?UTF-8?q?=E0=B8=99=E0=B8=95=E0=B8=B1=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/PersonalInformation/01_Profile.vue | 45 ++- src/modules/04_registryNew/stores/profile.ts | 297 ++++++++++++++---- 2 files changed, 262 insertions(+), 80 deletions(-) diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue index 29e5c4558..b0a40d157 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue @@ -25,8 +25,16 @@ const { messageError, dialogConfirm, } = mixin; -const { calculateAge, getGender, getRelationship, getReligion, getBloodGroup } = - store; +const { + calculateAge, + fetchPerson, + filterSelector, + // getGender, + // getRelationship, + // getReligion, + // getBloodGroup, + // getPersonOp, +} = store; const profileId = ref( route.params.id ? route.params.id.toString() : "" ); @@ -354,10 +362,19 @@ watch( onMounted(async () => { await getData(); - store.genderOp.length === 0 ? await getGender() : ""; - store.relationshipOp.length === 0 ? await getRelationship() : ""; - store.religionOp.length === 0 ? await getReligion() : ""; - store.bloodGroupOp.length === 0 ? await getBloodGroup() : ""; + if ( + store.Ops.prefixOps.length === 0 || + store.Ops.genderOps.length === 0 || + store.Ops.bloodOps.length === 0 || + store.Ops.statusOps.length === 0 || + store.Ops.religionOps.length === 0 + ) { + await fetchPerson(); + } + // store.genderOp.length === 0 ? await getGender() : ""; + // store.relationshipOp.length === 0 ? await getRelationship() : ""; + // store.religionOp.length === 0 ? await getReligion() : ""; + // store.bloodGroupOp.length === 0 ? await getBloodGroup() : ""; });