多维表格
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.
 
 
 
 
 
 

32 lines
743 B

import type { Api } from 'nocodb-sdk'
import ExcelTemplateAdapter from './ExcelTemplateAdapter'
export default class ExcelUrlTemplateAdapter extends ExcelTemplateAdapter {
url: string
excelData: any
$api: any
constructor(
url: string,
parserConfig: Record<string, any>,
api: Api<any>,
xlsx: any = null,
progressCallback?: (msg: string) => void,
) {
super({}, parserConfig, xlsx, progressCallback)
this.url = url
this.excelData = null
this.$api = api
}
async init() {
this.progress('Downloading excel file')
const data: any = await this.$api.utils.axiosRequestMake({
apiMeta: {
url: this.url,
},
})
this.excelData = data.data
await super.init()
}
}