feat(query): add batch result actions

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-10-01 15:50:54 +08:00
1 parent e6c7baa2d9
commit 38a00c7cb7
18 files changed
+668 -18

No files matched your search

@@ -1259,13 +1259,13 @@ export function useDataGridExport(options: UseDataGridExportOptions) {
await exportCurrentPageXlsxResult(true);
}
async function exportAllResultsXlsxResult(includeSqlSheet: boolean) {
async function exportResultSheetsXlsxResult(sheetsToExport: Array<{ sheetName: string; result: QueryResult; sql?: string }> | undefined, includeSqlSheet: boolean) {
const exportOptions = await showXlsxHeaderDialog();
if (exportOptions === null) return;
await runExclusiveExport(async () => {
try {
const sheets = (allExportResults?.value ?? []).filter((sheet) => sheet.result.columns.length > 0);
const sheets = (sheetsToExport ?? allExportResults?.value ?? []).filter((sheet) => sheet.result.columns.length > 0);
if (sheets.length === 0) return;
let outputPath = exportFileName("query-results", "xlsx", { allResults: true });
@@ -1300,11 +1300,11 @@ export function useDataGridExport(options: UseDataGridExportOptions) {
}
async function exportAllResultsXlsx() {
await exportAllResultsXlsxResult(false);
await exportResultSheetsXlsxResult(undefined, false);
}
async function exportAllResultsXlsxWithSql() {
await exportAllResultsXlsxResult(true);
await exportResultSheetsXlsxResult(undefined, true);
}
/**
@@ -1806,6 +1806,7 @@ export function useDataGridExport(options: UseDataGridExportOptions) {
exportCurrentPageXlsxWithSql,
exportAllResultsXlsx,
exportAllResultsXlsxWithSql,
exportResultSheetsXlsx: (sheets: Array<{ sheetName: string; result: QueryResult; sql?: string }>) => exportResultSheetsXlsxResult(sheets, false),
exportSql,
exportCurrentPageSql,
copySql,