From f18312fd23db556b0775fdc0c93fc934ae027875 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 23 Aug 2024 16:32:25 +0700 Subject: [PATCH] fix bug --- src/modules/03_logs/components/LogTable.vue | 98 ++------------------- 1 file changed, 7 insertions(+), 91 deletions(-) diff --git a/src/modules/03_logs/components/LogTable.vue b/src/modules/03_logs/components/LogTable.vue index a285da34..f0945375 100644 --- a/src/modules/03_logs/components/LogTable.vue +++ b/src/modules/03_logs/components/LogTable.vue @@ -260,7 +260,7 @@ function selectedDate() { ); } -function classColorMethod(val: string) { +function classColorMethod(val: any) { switch (val) { case "GET": return "blue"; @@ -278,34 +278,6 @@ function classColorMethod(val: string) { } } -function replaceTimeInISOString(isoString: string, time: string, type: string) { - const [datePart] = isoString.split("T"); - - const [hours, minutes] = time.split(":").map(Number); - - const newDate = new Date(isoString); - - newDate.setUTCHours(hours - 7); - newDate.setUTCMinutes(minutes); - newDate.setUTCSeconds(0); - newDate.setUTCMilliseconds(0); - - if (type === "start") { - startDate.value = newDate.toISOString(); - } else { - endDate.value = newDate.toISOString(); - } -} - -function dateThaiRange(val: [Date, Date]) { - if (val === null) { - } else if (date2Thai(val[0]) === date2Thai(val[1])) { - return `${date2Thai(val[0])}`; - } else { - return `${date2Thai(val[0])} - ${date2Thai(val[1])} `; - } -} - function onItemClick(labal: string, type: string) { labelDropdown.value = labal; valDropdown.value = type; @@ -344,63 +316,6 @@ function onItemClick(labal: string, type: string) { type !== "customized" && selectedDate(); - // if (type === "today") { - // // ตั้งค่า startDateToday เป็นเวลา 23:59:59 ของวันนี้ - // const startDateToday = new Date(); - // startDateToday.setHours(0, 0, 0, 0); - - // // ตั้งค่า endDate เป็นเวลา 23:59:59 ของวันนี้ - // const endDateToday = new Date(); - // endDateToday.setHours(23, 59, 59, 999); - - // startDate.value = startDateToday.toISOString(); - // endDate.value = endDateToday.toISOString(); - - // selectedDate(); - // } else if (type === "yesterday") { - // const endDateNow = new Date(); // เวลาปัจจุบัน - - // // ตั้งค่า endDate เป็นเวลา 23:59:59 ของวันก่อนหน้า - // endDateNow.setDate(endDateNow.getDate() - 1); - // endDateNow.setHours(23, 59, 59, 999); - - // // ตั้งค่า startDate เป็นเวลา 00:00:00 ของวันก่อนหน้า - // const startDateYesterday = new Date(endDateNow); - // startDateYesterday.setHours(0, 0, 0, 0); - - // startDate.value = startDateYesterday.toISOString(); - // endDate.value = endDateNow.toISOString(); - - // selectedDate(); - // } else if (type === "past24hours") { - // // ตั้งค่า startDatePast เป็นเวลาย้อนหลัง 24 hours - // const startDatePast = new Date(); - // startDatePast.setHours(startDatePast.getHours() - 24); - - // startDate.value = startDatePast.toISOString(); - // endDate.value = new Date().toISOString(); - - // selectedDate(); - // } else if (type === "past7days") { - // // ตั้งค่า startDatePast เป็นเวลาย้อนหลัง 7 วัน - // const startDatePast = new Date(); - // startDatePast.setDate(startDatePast.getDate() - 7); - - // startDate.value = startDatePast.toISOString(); - // endDate.value = new Date().toISOString(); - - // selectedDate(); - // } else if (type === "past30days") { - // // ตั้งค่า startDatePast เป็นเวลาย้อนหลัง 30 วัน - // const startDatePast = new Date(); - // startDatePast.setDate(startDatePast.getDate() - 30); - - // startDate.value = startDatePast.toISOString(); - // endDate.value = new Date().toISOString(); - - // selectedDate(); - // } - startTime.value = null; endTime.value = null; } @@ -416,8 +331,6 @@ function updateDate() { onMounted(() => { systemName.value = route.query.system as string; - // startDate.value = date.value[0].toISOString(); - // endDate.value = date.value[1].toISOString(); }); @@ -823,9 +736,12 @@ onMounted(() => { {{ date2Thai(new Date(item), true, true) }}
- {{ - item ?? "-" - }} + + {{ item ?? "-" }} +