diff --git a/packages/nc-gui/extensions/data-exporter/index.vue b/packages/nc-gui/extensions/data-exporter/index.vue index 8c0d803fd7..855658a031 100644 --- a/packages/nc-gui/extensions/data-exporter/index.vue +++ b/packages/nc-gui/extensions/data-exporter/index.vue @@ -7,6 +7,25 @@ const jobStatusTooltip = { [JobStatus.FAILED]: 'Export failed', } as Record +const delimiters = [ + { + label: 'Comma (,)', + value: ',', + }, + { + label: 'Semicolon (;)', + value: ';', + }, + { + label: 'Tab (\\t)', + value: '\\t', + }, + { + label: 'Pipe (|)', + value: '|', + }, +] + const { $api, $poller } = useNuxtApp() const { appInfo } = useGlobal() @@ -60,7 +79,10 @@ const exportedFiles = computed(() => { const exportPayload = ref<{ tableId?: string viewId?: string -}>({}) + delimiter?: string +}>({ + delimiter: ',', +}) const tableList = computed(() => { return tables.value.map((table) => { @@ -123,7 +145,10 @@ async function exportDataAsync() { isExporting.value = true - const jobData = await $api.export.data(exportPayload.value.viewId, 'csv', { extension_id: extension.value.id }) + const jobData = await $api.export.data(exportPayload.value.viewId, 'csv', { + extension_id: extension.value.id, + delimiter: exportPayload.value.delimiter, + }) jobList.value.unshift(jobData) $poller.subscribe( @@ -255,51 +280,133 @@ onMounted(async () => { 'bg-nc-bg-gray-extralight': fullscreen, }" > -
+
- + + + +
+
+ +
+ + + {{ table.label }} + + +
+
+
+
+ + + + +
+
+ +
+ + + {{ view.label }} + + +
+
+
+
+ + + {{ isExporting ? 'Generating' : 'Export' }} + +
+
+ +
+ - +
-
- -
- - {{ table.label }} + + {{ delimiter.label }} @@ -307,56 +414,6 @@ onMounted(async () => { - - - - -
-
- -
- - - {{ view.label }} - - -
-
-
-
- - - {{ isExporting ? 'Generating' : 'Export' }} -