From e8abe74e4596307c89c33fd56038828e25aad202 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 15 Sep 2023 16:49:26 +0700 Subject: [PATCH] =?UTF-8?q?tab=20=E0=B8=88=E0=B8=B1=E0=B8=94=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=84=E0=B8=B3=E0=B8=82=E0=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/2_Manage/listManage.vue | 6 +++++- src/modules/07_insignia/store.ts | 16 +++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/modules/07_insignia/components/2_Manage/listManage.vue b/src/modules/07_insignia/components/2_Manage/listManage.vue index d86a05ecb..ddc28e172 100644 --- a/src/modules/07_insignia/components/2_Manage/listManage.vue +++ b/src/modules/07_insignia/components/2_Manage/listManage.vue @@ -57,7 +57,11 @@ const fecthlistRound = async () => { if (optionRound.value.length !== 0) { DataStore.optionRound = optionRound.value; const lastValue = optionRound.value[0]; - round.value = lastValue.id.toString(); + if (DataStore.roundId) { + round.value = DataStore.roundId; + } else { + round.value = lastValue.id.toString(); + } DataStore.roundId = round.value; roundName.value = lastValue.name; await fecthStat(round.value); diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts index ebd234f03..29d88e41c 100644 --- a/src/modules/07_insignia/store.ts +++ b/src/modules/07_insignia/store.ts @@ -85,14 +85,16 @@ export const useInsigniaDataStore = defineStore("insignia", () => { } } else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }]; }; - const searchDataTable = async (type: string, employeeClass: string) => { - if (type !== 'all' && employeeClass !== 'all') { - rows.value = listinsignia.value.filter((e: any) => e.insigniaSend === type && e.employeeType === profileType(employeeClass)) - } else if (type !== 'all' && employeeClass === 'all') { + const searchDataTable = async (type: string, employeeClasstype: string) => { + typeinsignia.value = type + employeeClass.value = employeeClasstype + if (type !== 'all' && employeeClasstype !== 'all') { + rows.value = listinsignia.value.filter((e: any) => e.insigniaSend === type && e.employeeType === profileType(employeeClasstype)) + } else if (type !== 'all' && employeeClasstype === 'all') { rows.value = listinsignia.value.filter((e: any) => e.insigniaSend === type) - } else if (type === 'all' && employeeClass !== 'all') { - rows.value = listinsignia.value.filter((e: any) => e.employeeType === profileType(employeeClass)) - } else if (type === 'all' && employeeClass === 'all') { + } else if (type === 'all' && employeeClasstype !== 'all') { + rows.value = listinsignia.value.filter((e: any) => e.employeeType === profileType(employeeClasstype)) + } else if (type === 'all' && employeeClasstype === 'all') { rows.value = listinsignia.value }