log csv
This commit is contained in:
parent
7881c9e2ef
commit
7a55c19511
3 changed files with 27 additions and 2 deletions
|
|
@ -102,4 +102,6 @@ export default {
|
||||||
|
|
||||||
/** View Work Flow*/
|
/** View Work Flow*/
|
||||||
viewWorkflow: `${organization}/view-workflow`,
|
viewWorkflow: `${organization}/view-workflow`,
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,5 @@ const log = `${env.API_LOG}/log`;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
log,
|
log,
|
||||||
|
reportLog: `${log}/report/logsList`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useDataStore } from "@/modules/03_logs/stores/main";
|
import { useDataStore } from "@/modules/03_logs/stores/main";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
Pagination,
|
Pagination,
|
||||||
|
|
@ -26,7 +27,7 @@ import type { ResLog } from "@/modules/03_logs/interface/response/Main";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const storeData = useDataStore();
|
const storeData = useDataStore();
|
||||||
const { logData, size, searchAfter, systemName, date } = storeToRefs(storeData);
|
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 startTime = ref<Date | null>(null); // เวลาเริ่มต้น
|
||||||
const endTime = ref<Date | null>(null); //เวลาสินสุด
|
const endTime = ref<Date | null>(null); //เวลาสินสุด
|
||||||
|
|
@ -436,7 +437,28 @@ function updateDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSendCSV() {
|
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() {
|
function onSend() {
|
||||||
console.log(1);
|
console.log(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue