|
|
@ -26,8 +26,6 @@ const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
|
const { tables } = useProject() |
|
|
|
const { tables } = useProject() |
|
|
|
|
|
|
|
|
|
|
|
const toast = useToast() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const activeKey = ref('uploadTab') |
|
|
|
const activeKey = ref('uploadTab') |
|
|
|
|
|
|
|
|
|
|
|
const jsonEditorRef = ref() |
|
|
|
const jsonEditorRef = ref() |
|
|
@ -165,7 +163,9 @@ async function parseAndExtractData(val: any, name: string) { |
|
|
|
importColumns.value = [] |
|
|
|
importColumns.value = [] |
|
|
|
const templateGenerator: any = getAdapter(name, val) |
|
|
|
const templateGenerator: any = getAdapter(name, val) |
|
|
|
if (!templateGenerator) { |
|
|
|
if (!templateGenerator) { |
|
|
|
toast.error('Template Generator cannot be found!') |
|
|
|
notification.error({ |
|
|
|
|
|
|
|
message: 'Template Generator cannot be found!', |
|
|
|
|
|
|
|
}) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
await templateGenerator.init() |
|
|
|
await templateGenerator.init() |
|
|
@ -185,7 +185,9 @@ async function parseAndExtractData(val: any, name: string) { |
|
|
|
|
|
|
|
|
|
|
|
function rejectDrop(fileList: any[]) { |
|
|
|
function rejectDrop(fileList: any[]) { |
|
|
|
fileList.map((file) => { |
|
|
|
fileList.map((file) => { |
|
|
|
return toast.error(`Failed to upload file ${file.name}`) |
|
|
|
return notification.error({ |
|
|
|
|
|
|
|
message: `Failed to upload file ${file.name}`, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -202,9 +204,13 @@ function handleChange(info: UploadChangeParam) { |
|
|
|
reader.readAsArrayBuffer(info.file.originFileObj) |
|
|
|
reader.readAsArrayBuffer(info.file.originFileObj) |
|
|
|
} |
|
|
|
} |
|
|
|
if (status === 'done') { |
|
|
|
if (status === 'done') { |
|
|
|
toast.success(`Uploaded file ${info.file.name} successfully`) |
|
|
|
notification.success({ |
|
|
|
|
|
|
|
message: `Uploaded file ${info.file.name} successfully`, |
|
|
|
|
|
|
|
}) |
|
|
|
} else if (status === 'error') { |
|
|
|
} else if (status === 'error') { |
|
|
|
toast.error(`Failed to upload file ${info.file.name}`) |
|
|
|
notification.error({ |
|
|
|
|
|
|
|
message: `Failed to upload file ${info.file.name}`, |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|