Merge branch 'develop' into setthawut
This commit is contained in:
commit
974ebfc3a1
2 changed files with 15 additions and 94 deletions
|
|
@ -293,7 +293,7 @@ onMounted(() => {
|
||||||
<template>
|
<template>
|
||||||
<div class="row items-center">
|
<div class="row items-center">
|
||||||
<div class="toptitle text-dark row items-center q-py-xs">
|
<div class="toptitle text-dark row items-center q-py-xs">
|
||||||
จัดการผู้ใช้งานsadas
|
จัดการผู้ใช้งาน
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -199,8 +199,8 @@ function handleScroll() {
|
||||||
searchAfter: searchAfter.value ?? undefined,
|
searchAfter: searchAfter.value ?? undefined,
|
||||||
sort: sortTime.value,
|
sort: sortTime.value,
|
||||||
// date: new Date(startDate.value),
|
// date: new Date(startDate.value),
|
||||||
startDate: new Date(startDate.value),
|
startDate: new Date(startDate.value) ?? undefined,
|
||||||
endDate: new Date(endDate.value),
|
endDate: new Date(endDate.value) ?? undefined,
|
||||||
},
|
},
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
@ -260,7 +260,7 @@ function selectedDate() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function classColorMethod(val: string) {
|
function classColorMethod(val: any) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "GET":
|
case "GET":
|
||||||
return "blue";
|
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) {
|
function onItemClick(labal: string, type: string) {
|
||||||
labelDropdown.value = labal;
|
labelDropdown.value = labal;
|
||||||
valDropdown.value = type;
|
valDropdown.value = type;
|
||||||
|
|
@ -344,63 +316,6 @@ function onItemClick(labal: string, type: string) {
|
||||||
|
|
||||||
type !== "customized" && selectedDate();
|
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;
|
startTime.value = null;
|
||||||
endTime.value = null;
|
endTime.value = null;
|
||||||
}
|
}
|
||||||
|
|
@ -416,8 +331,11 @@ function updateDate() {
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
systemName.value = route.query.system as string;
|
systemName.value = route.query.system as string;
|
||||||
// startDate.value = date.value[0].toISOString();
|
const date = new Date();
|
||||||
// endDate.value = date.value[1].toISOString();
|
date.setHours(0, 0, 0, 0); // ตั้งเวลาเป็น 00:00:00.000
|
||||||
|
|
||||||
|
startDate.value = date.toISOString(); // แปลงเป็น ISO string
|
||||||
|
endDate.value = new Date().toISOString();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -823,9 +741,12 @@ onMounted(() => {
|
||||||
{{ date2Thai(new Date(item), true, true) }}
|
{{ date2Thai(new Date(item), true, true) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="self-center" v-if="key === 'method'">
|
<div class="self-center" v-if="key === 'method'">
|
||||||
<q-badge text-color="blue" style="background-color: #f0ecec">{{
|
<q-badge
|
||||||
item ?? "-"
|
:text-color="classColorMethod(item)"
|
||||||
}}</q-badge>
|
style="background-color: #f0ecec"
|
||||||
|
>
|
||||||
|
{{ item ?? "-" }}
|
||||||
|
</q-badge>
|
||||||
</div>
|
</div>
|
||||||
<div class="self-center" v-else-if="key === 'logType'">
|
<div class="self-center" v-else-if="key === 'logType'">
|
||||||
<q-badge
|
<q-badge
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue