mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-05 22:47:01 +00:00
chore: move nc-gui-v2 to nc-gui
This commit is contained in:
27
packages/nc-gui/utils/parsers/ExcelUrlTemplateAdapter.ts
Normal file
27
packages/nc-gui/utils/parsers/ExcelUrlTemplateAdapter.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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()
|
||||
const name = url?.split('/').pop()
|
||||
super(name, 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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user