mirror of
https://github.com/Fabio286/antares.git
synced 2025-04-24 23:08:42 +02:00
feat: add the page reference in the export file name, closes #772
This commit is contained in:
parent
62e3115860
commit
2064294119
@ -292,6 +292,10 @@ const props = defineProps({
|
|||||||
results: Array as Prop<QueryResult[]>,
|
results: Array as Prop<QueryResult[]>,
|
||||||
connUid: String,
|
connUid: String,
|
||||||
mode: String as Prop<'table' | 'query'>,
|
mode: String as Prop<'table' | 'query'>,
|
||||||
|
page: {
|
||||||
|
type: Number,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
isSelected: Boolean,
|
isSelected: Boolean,
|
||||||
elementType: { type: String, default: 'table' }
|
elementType: { type: String, default: 'table' }
|
||||||
});
|
});
|
||||||
@ -868,6 +872,7 @@ const downloadTable = (format: 'csv' | 'json' | 'sql' | 'php', table: string, po
|
|||||||
},
|
},
|
||||||
client: workspaceClient.value,
|
client: workspaceClient.value,
|
||||||
table,
|
table,
|
||||||
|
page: props.page,
|
||||||
sqlOptions: popup ? { ...sqlExportOptions.value } : null,
|
sqlOptions: popup ? { ...sqlExportOptions.value } : null,
|
||||||
csvOptions: popup ? { ...csvExportOptions.value } : null
|
csvOptions: popup ? { ...csvExportOptions.value } : null
|
||||||
});
|
});
|
||||||
|
@ -202,6 +202,7 @@
|
|||||||
v-if="results"
|
v-if="results"
|
||||||
ref="queryTable"
|
ref="queryTable"
|
||||||
:results="results"
|
:results="results"
|
||||||
|
:page="page"
|
||||||
:tab-uid="tabUid"
|
:tab-uid="tabUid"
|
||||||
:conn-uid="connection.uid"
|
:conn-uid="connection.uid"
|
||||||
:is-selected="isSelected"
|
:is-selected="isSelected"
|
||||||
|
@ -7,6 +7,7 @@ export const exportRows = (args: {
|
|||||||
type: 'csv' | 'json'| 'sql' | 'php';
|
type: 'csv' | 'json'| 'sql' | 'php';
|
||||||
content: object[];
|
content: object[];
|
||||||
table: string;
|
table: string;
|
||||||
|
page?: number;
|
||||||
client?: ClientCode;
|
client?: ClientCode;
|
||||||
fields?: {
|
fields?: {
|
||||||
[key: string]: {type: string; datePrecision: number};
|
[key: string]: {type: string; datePrecision: number};
|
||||||
@ -83,7 +84,7 @@ export const exportRows = (args: {
|
|||||||
|
|
||||||
const file = new Blob([content], { type: mime });
|
const file = new Blob([content], { type: mime });
|
||||||
const downloadLink = document.createElement('a');
|
const downloadLink = document.createElement('a');
|
||||||
downloadLink.download = `${args.sqlOptions?.targetTable || args.table}.${args.type}`;
|
downloadLink.download = `${args.sqlOptions?.targetTable || args.table}${args.page ? `-${args.page}` : ''}.${args.type}`;
|
||||||
downloadLink.href = window.URL.createObjectURL(file);
|
downloadLink.href = window.URL.createObjectURL(file);
|
||||||
downloadLink.style.display = 'none';
|
downloadLink.style.display = 'none';
|
||||||
document.body.appendChild(downloadLink);
|
document.body.appendChild(downloadLink);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user