log csv
This commit is contained in:
parent
7881c9e2ef
commit
7a55c19511
3 changed files with 27 additions and 2 deletions
|
|
@ -8,6 +8,7 @@ import config from "@/app.config";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/modules/03_logs/stores/main";
|
||||
import { storeToRefs } from "pinia";
|
||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||
|
||||
import type {
|
||||
Pagination,
|
||||
|
|
@ -26,7 +27,7 @@ import type { ResLog } from "@/modules/03_logs/interface/response/Main";
|
|||
const $q = useQuasar();
|
||||
const storeData = useDataStore();
|
||||
const { logData, size, searchAfter, systemName, date } = storeToRefs(storeData);
|
||||
const { date2Thai, messageError, hideLoader } = useCounterMixin();
|
||||
const { date2Thai, messageError, hideLoader,dateToISO } = useCounterMixin();
|
||||
|
||||
const startTime = ref<Date | null>(null); // เวลาเริ่มต้น
|
||||
const endTime = ref<Date | null>(null); //เวลาสินสุด
|
||||
|
|
@ -436,7 +437,28 @@ function updateDate() {
|
|||
}
|
||||
|
||||
function onSendCSV() {
|
||||
console.log(1);
|
||||
const queryString = {
|
||||
rootId: qureyBody.rootId ?? undefined,
|
||||
size: size.value ?? undefined,
|
||||
search: inputSearch.value ?? undefined,
|
||||
systemName: systemName.value ?? undefined,
|
||||
searchAfter: searchAfter.value ?? undefined,
|
||||
sort: sortTime.value,
|
||||
startDate: new Date(startDate.value) ?? undefined,
|
||||
endDate: new Date(endDate.value) ?? undefined,
|
||||
};
|
||||
http
|
||||
.get(config.API.reportLog, {
|
||||
params: queryString,
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data
|
||||
genReportXLSX(data,`LOG_${date2Thai(new Date(startDate.value))}`)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
function onSend() {
|
||||
console.log(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue