Merge branch 'develop' into setthawut

This commit is contained in:
STW_TTTY\stwtt 2024-08-26 14:47:12 +07:00
commit 974ebfc3a1
2 changed files with 15 additions and 94 deletions

View file

@ -293,7 +293,7 @@ onMounted(() => {
<template>
<div class="row items-center">
<div class="toptitle text-dark row items-center q-py-xs">
ดการผใชงานsadas
ดการผใชงาน
</div>
</div>

View file

@ -199,8 +199,8 @@ function handleScroll() {
searchAfter: searchAfter.value ?? undefined,
sort: sortTime.value,
// date: new Date(startDate.value),
startDate: new Date(startDate.value),
endDate: new Date(endDate.value),
startDate: new Date(startDate.value) ?? undefined,
endDate: new Date(endDate.value) ?? undefined,
},
true
);
@ -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,11 @@ function updateDate() {
onMounted(() => {
systemName.value = route.query.system as string;
// startDate.value = date.value[0].toISOString();
// endDate.value = date.value[1].toISOString();
const date = new Date();
date.setHours(0, 0, 0, 0); // 00:00:00.000
startDate.value = date.toISOString(); // ISO string
endDate.value = new Date().toISOString();
});
</script>
@ -823,9 +741,12 @@ onMounted(() => {
{{ date2Thai(new Date(item), true, true) }}
</div>
<div class="self-center" v-if="key === 'method'">
<q-badge text-color="blue" style="background-color: #f0ecec">{{
item ?? "-"
}}</q-badge>
<q-badge
:text-color="classColorMethod(item)"
style="background-color: #f0ecec"
>
{{ item ?? "-" }}
</q-badge>
</div>
<div class="self-center" v-else-if="key === 'logType'">
<q-badge