mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 14:36:37 +00:00
27 lines
610 B
TypeScript
27 lines
610 B
TypeScript
import ExcelTemplateAdapter from './ExcelTemplateAdapter'
|
|
import { useNuxtApp } from '#imports'
|
|
|
|
export default class ExcelUrlTemplateAdapter extends ExcelTemplateAdapter {
|
|
url: string
|
|
excelData: any
|
|
$api: any
|
|
|
|
constructor(url: string, parserConfig: Record<string, any>) {
|
|
const { $api } = useNuxtApp()
|
|
super({}, parserConfig)
|
|
this.url = url
|
|
this.excelData = null
|
|
this.$api = $api
|
|
}
|
|
|
|
async init() {
|
|
const data: any = await this.$api.utils.axiosRequestMake({
|
|
apiMeta: {
|
|
url: this.url,
|
|
},
|
|
})
|
|
this.excelData = data.data
|
|
await super.init()
|
|
}
|
|
}
|