diff --git a/apps/desktop/src/components/import/TableImportDialog.vue b/apps/desktop/src/components/import/TableImportDialog.vue index 1415bd6d87..af479475f9 100644 --- a/apps/desktop/src/components/import/TableImportDialog.vue +++ b/apps/desktop/src/components/import/TableImportDialog.vue @@ -72,7 +72,9 @@ const errorMessage = ref(""); const wizardStep = ref("source"); const fileInput = ref(null); const delimiter = ref(","); -const hasHeader = ref(true); +const titleRow = ref(1); +const dataStartRow = ref(2); +const lastDataRow = ref(0); const trimValues = ref(false); const emptyStringAsNull = ref(true); const selectedSheet = ref(""); @@ -167,7 +169,9 @@ const createColumnSummaries = computed(() => ); const parseOptions = computed(() => ({ delimiter: sourceFormat.value === "tsv" ? "\\t" : sourceFormat.value === "csv" ? "," : delimiter.value, - hasHeader: hasHeader.value, + titleRow: titleRow.value, + dataStartRow: dataStartRow.value, + lastDataRow: lastDataRow.value, trimValues: trimValues.value, emptyStringAsNull: emptyStringAsNull.value, sheetName: sourceFormat.value === "excel" ? selectedSheet.value || null : null, @@ -184,7 +188,9 @@ function resetState() { activeTaskIndex.value = 0; sourceFormat.value = "csv"; delimiter.value = ","; - hasHeader.value = true; + titleRow.value = 1; + dataStartRow.value = 2; + lastDataRow.value = 0; trimValues.value = false; emptyStringAsNull.value = true; selectedSheet.value = ""; @@ -234,7 +240,9 @@ function uniqueTableName(baseName: string, usedNames: Set): string { function taskParseOptions(format: api.TableImportSourceFormat, sheetName = ""): api.TableImportParseOptions { return { delimiter: format === "tsv" ? "\\t" : format === "csv" ? "," : delimiter.value, - hasHeader: hasHeader.value, + titleRow: titleRow.value, + dataStartRow: dataStartRow.value, + lastDataRow: lastDataRow.value, trimValues: trimValues.value, emptyStringAsNull: emptyStringAsNull.value, sheetName: format === "excel" ? sheetName || null : null, @@ -716,7 +724,7 @@ watch( { immediate: true }, ); -watch([sourceFormat, delimiter, hasHeader, trimValues, emptyStringAsNull, selectedSheet, jsonShape, previewLimit], schedulePreviewReload); +watch([sourceFormat, delimiter, titleRow, dataStartRow, lastDataRow, trimValues, emptyStringAsNull, selectedSheet, jsonShape, previewLimit], schedulePreviewReload); watch([newTableName, columnMapping, columnDataTypes], saveActiveBatchTask, { deep: true }); watch(targetMode, (mode) => { if (mode === "existing") { @@ -883,10 +891,18 @@ watch(targetMode, (mode) => { - +
+ + +
+
+ + +
+
+ + +