mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
651 B
28 lines
651 B
2 years ago
|
import ExcelTemplateAdapter from './ExcelTemplateAdapter'
|
||
2 years ago
|
import { useNuxtApp } from '#imports'
|
||
2 years ago
|
|
||
|
export default class ExcelUrlTemplateAdapter extends ExcelTemplateAdapter {
|
||
|
url: string
|
||
|
excelData: any
|
||
2 years ago
|
$api: any
|
||
2 years ago
|
|
||
2 years ago
|
constructor(url: string, parserConfig: Record<string, any>) {
|
||
2 years ago
|
const { $api } = useNuxtApp()
|
||
2 years ago
|
const name = url?.split('/').pop()
|
||
2 years ago
|
super(name, parserConfig)
|
||
|
this.url = url
|
||
|
this.excelData = null
|
||
2 years ago
|
this.$api = $api
|
||
2 years ago
|
}
|
||
|
|
||
|
async init() {
|
||
2 years ago
|
const data: any = await this.$api.utils.axiosRequestMake({
|
||
2 years ago
|
apiMeta: {
|
||
|
url: this.url,
|
||
|
},
|
||
|
})
|
||
|
this.excelData = data.data
|
||
|
await super.init()
|
||
|
}
|
||
|
}
|