|
|
|
@ -1,19 +1,22 @@
|
|
|
|
|
import ExcelTemplateAdapter from './ExcelTemplateAdapter' |
|
|
|
|
const { $api } = useNuxtApp() |
|
|
|
|
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 $api.utils.axiosRequestMake({ |
|
|
|
|
const data: any = await this.$api.utils.axiosRequestMake({ |
|
|
|
|
apiMeta: { |
|
|
|
|
url: this.url, |
|
|
|
|
}, |
|
|
|
|