mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
2 years ago
1 changed files with 26 additions and 0 deletions
@ -0,0 +1,26 @@
|
||||
import ExcelTemplateAdapter from './ExcelTemplateAdapter' |
||||
const { $api } = useNuxtApp() |
||||
|
||||
export default class ExcelUrlTemplateAdapter extends ExcelTemplateAdapter { |
||||
url: string |
||||
quickImportType: string |
||||
excelData: any |
||||
|
||||
constructor(url: string, parserConfig: Record<string, any>, quickImportType: string) { |
||||
const name = url.split('/').pop() |
||||
super(name, parserConfig) |
||||
this.url = url |
||||
this.quickImportType = quickImportType |
||||
this.excelData = null |
||||
} |
||||
|
||||
async init() { |
||||
const data: any = await $api.utils.axiosRequestMake({ |
||||
apiMeta: { |
||||
url: this.url, |
||||
}, |
||||
}) |
||||
this.excelData = data.data |
||||
await super.init() |
||||
} |
||||
} |
Loading…
Reference in new issue