From d2daffa7b2caf371f98d973031637824e5c499a8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 29 Aug 2023 09:50:26 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20selector?= =?UTF-8?q?Round=20=E0=B8=A2=E0=B8=B7=E0=B8=A1=E0=B8=84=E0=B8=B7=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../07_insignia/components/5_Borrow/Main.vue | 66 +++++++++++-------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/src/modules/07_insignia/components/5_Borrow/Main.vue b/src/modules/07_insignia/components/5_Borrow/Main.vue index 752fd205d..c0d72cc3f 100644 --- a/src/modules/07_insignia/components/5_Borrow/Main.vue +++ b/src/modules/07_insignia/components/5_Borrow/Main.vue @@ -46,34 +46,30 @@ const fecthRound = async () => { .get(config.API.noteround()) .then((res) => { let data = res.data.result; + console.log(data); + selectRoundAllOption.value = [ { name: "ทั้งหมด", - id: "00000000-0000-0000-0000-000000000000", + id: "0", year: 0, }, ]; - data.map((e: any) => { - selectRoundOption.value = [ - ...selectRoundOption.value, - { - name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), - id: e.id, - year: e.year, - }, - ]; - - selectRoundAllOption.value = [ - ...selectRoundAllOption.value, - { - name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), - id: e.id, - year: e.year, - }, - ]; + selectRoundOption.value.push({ + name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), + id: e.id, + year: e.year, + }); + selectRoundAllOption.value.push({ + name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), + id: e.id, + year: e.year, + }); }); + selectRound.value = data[0].id; + yearRound.value = data[0].year; roundYear.value = data[0].year; }) .catch((err) => { @@ -302,9 +298,11 @@ const selectorInsignia = async () => { : dataCopy; }; -// const selectorRound = (round: string) => { -// selectRound.value = round; -// }; +const yearRound = ref(); +const selectorRound = async (round: number) => { + roundYear.value = round; + await fecthlistInsignia(); +}; const rows = ref([]); const fecthlistInsignia = async () => { @@ -383,12 +381,24 @@ const resetFilter = () => { >
- +
+ +