fix download file log
This commit is contained in:
parent
1288a7b08f
commit
658fd6705e
3 changed files with 13 additions and 9 deletions
|
|
@ -31,7 +31,7 @@ defineProps<{
|
|||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="ดาวน์โหลด (.TXT)"
|
||||
label="ดาวน์โหลด (.docx)"
|
||||
color="blue"
|
||||
type="submit"
|
||||
icon="download"
|
||||
|
|
|
|||
|
|
@ -462,17 +462,17 @@ function onSendCSV() {
|
|||
.finally(() => {});
|
||||
}
|
||||
|
||||
function downloadTxt() {
|
||||
async function downloadTxt() {
|
||||
const queryString = {
|
||||
id: currentlogData.value?.id,
|
||||
};
|
||||
http
|
||||
await http
|
||||
.get(`${config.API.log}/report/logsDetail`, {
|
||||
params: queryString,
|
||||
})
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
const data = res.data;
|
||||
generateTxt(data, `LOG_${date2Thai(new Date(startDate.value))}`);
|
||||
await generateTxt(data, `LOG_${date2Thai(new Date(startDate.value))}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue