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 = () => { >
- +
+ +