问题:
1. 子系统使用wijmo导出excel时,页面报错,具体报错如下:
2. 当在子系统中单独引入jszip: 3版本后,子系统本地开发环境正常,测试环境报错,具体报错如下:
子系统导出Excel定义代码如下,2个问题导出方法均未改变
import * as gridXlsx from '@grapecity/wijmo.grid.xlsx'
downloadExcel(filename: string) {
const book = gridXlsx.FlexGridXlsxConverter.saveAsync(this.pivotGrid, {
includeColumnHeaders: true,
includeRowHeaders: true
})
book.saveAsync(`${filename}.xlsx`)
}
背景:
1. 子系统使用wijmo开发,并嵌入到microApp基座中,子系统并没有单独引入jszip,基座加载jszip代码如下
- 基座拷贝一份jszip代码放在基座中
- 通过<script src="/jszip.min.js"></script>加载到HTML模板中- 基座在package.json中安装"jszip": "^3.10.1"
- 基座通过vite拆包 optimizeDeps: { exclude: ['@grapecity/wijmo.xlsx', 'jszip'] }- 基座设置jszip
import * as wXlsx from '@grapecity/wijmo.xlsx'
wXlsx.useJSZip(window.JSZip)
window.wXlsx = wXlsx
- 基座设置jszip2. 子系统中各wijmo版本如下
"@grapecity/wijmo": "~6.20880.670",
"@grapecity/wijmo.all": "^6.20880.673",
"@grapecity/wijmo.grid": "~6.20880.673",
"@grapecity/wijmo.grid.xlsx": "~6.20880.673",
"@grapecity/wijmo.olap": "~6.20880.673",
"@grapecity/wijmo.react.input": "~6.20880.670",
"@grapecity/wijmo.react.olap": "~6.20880.673",
"@grapecity/wijmo.styles": "~6.20880.670",
"@grapecity/wijmo.xlsx": "~6.20880.670",
请帮忙分析问题原因,并给出解决方案,非常感谢
|