From 7b7785e37159199d47d4856954e34431bbef7440 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 27 Mar 2024 10:57:29 +0700 Subject: [PATCH 1/6] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4:=20profile=20metadata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/registry/api.registry.ts | 1 + src/modules/04_registryNew/stores/profile.ts | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index f20250bad..215bffd4e 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -8,6 +8,7 @@ export default { registryNewByProfileId: (profileId: string) => `${registryNew}${profileId}`, // metadata + profileNewMetaMain: `${metadata}main/person`, profileNewGender: `${metadata}gender`, profileNewReligion: `${metadata}religion`, profileNewRelationship: `${metadata}relationship`, diff --git a/src/modules/04_registryNew/stores/profile.ts b/src/modules/04_registryNew/stores/profile.ts index 346861a80..195a099d0 100644 --- a/src/modules/04_registryNew/stores/profile.ts +++ b/src/modules/04_registryNew/stores/profile.ts @@ -114,7 +114,7 @@ export const useProfileDataStore = defineStore("profile", () => { const fetchPerson = async () => { showLoader(); await http - .get(config.API.person) + .get(config.API.profileNewMetaMain) .then((res) => { const data = res.data.result; let optionbloodGroups: DataOption[] = []; @@ -144,22 +144,16 @@ export const useProfileDataStore = defineStore("profile", () => { name: r.name.toString(), }); }); - optionprefixs = optionprefixs.filter((o) => - prefixOp.value.find((p) => o.name === p) - ); Ops.value.prefixOps = optionprefixs; OpsFilter.value.prefixOps = optionprefixs; let optionrank: DataOption[] = []; - data.prefixs.map((r: any) => { + data.rank.map((r: any) => { optionrank.push({ id: r.id.toString(), name: r.name.toString(), }); }); - optionrank = optionrank.filter( - (o) => !prefixOp.value.find((p) => o.name === p) - ); Ops.value.rankOps = optionrank; OpsFilter.value.rankOps = optionrank; From a0bc93b20892dc8b7df4892f29d901e209d3ab8b Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 27 Mar 2024 10:59:32 +0700 Subject: [PATCH 2/6] fix bug scroll style --- src/modules/04_registryNew/views/list.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/04_registryNew/views/list.vue b/src/modules/04_registryNew/views/list.vue index f1272f89d..b155cd921 100644 --- a/src/modules/04_registryNew/views/list.vue +++ b/src/modules/04_registryNew/views/list.vue @@ -608,7 +608,7 @@ onMounted(async () => { - diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue index eb9b28d92..ec28c3f79 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue @@ -400,7 +400,6 @@ async function fetchEducationLevel() { }); }); educationLevelOptionFilter.value = educationLevelOption.value; - console.log(educationLevelOptionFilter.value); }) .catch((err) => { messageError($q, err); From 70f6b07da1895f3071446b9017c33494d212c7d7 Mon Sep 17 00:00:00 2001 From: oat_dev Date: Wed, 27 Mar 2024 11:44:11 +0700 Subject: [PATCH 6/6] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99=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=82=E0=B9=89=E0=B8=AD?= =?UTF-8?q?=E0=B8=A1=E0=B8=B9=E0=B8=A5=E0=B8=84=E0=B8=A3=E0=B8=AD=E0=B8=9A?= =?UTF-8?q?=E0=B8=84=E0=B8=A3=E0=B8=B1=E0=B8=A7=20=E0=B9=80=E0=B8=8A?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=A1=E0=B8=84=E0=B8=B3=E0=B8=99?= =?UTF-8?q?=E0=B8=B3=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=8A=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/PersonalInformation/04_Family.vue | 81 +++++++++++++++++-- 1 file changed, 73 insertions(+), 8 deletions(-) diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue index 5996edee9..797cdfcfe 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue @@ -7,7 +7,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useRoute } from "vue-router"; import DialogHistory from "@/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyHistory.vue"; - +import { useProfileDataStore } from "@/modules/04_registryNew/stores/profile"; const mixin = useCounterMixin(); const $q = useQuasar(); const { @@ -20,6 +20,7 @@ const { date2Thai, } = mixin; +const store = useProfileDataStore(); const route = useRoute(); const id = ref(route.params.id.toString()); const dialog = ref(false); @@ -64,7 +65,7 @@ const spouseData = reactive({ const rows = ref([]); const historyRows = ref([]); - +const prefixFilter = ref([]); const childrenData: any = reactive({ childrens: [], }); @@ -233,8 +234,32 @@ function deleteChildren(items: any) { } onMounted(async () => { + 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(); + } + prefixFilter.value = store.Ops.prefixOps; await fetchData(id.value); }); + +function filterSelector(val: string, update: Function, refData: string) { + switch (refData) { + case "prefixOps": + update(() => { + store.Ops.prefixOps = prefixFilter.value.filter( + (v: any) => v.name.indexOf(val) > -1 + ); + }); + break; + default: + break; + } +}