fix
This commit is contained in:
4
index.ts
4
index.ts
@@ -390,12 +390,12 @@ function importXLSX (params: VxeGlobalInterceptorHandles.InterceptorImportParams
|
||||
workbook.xlsx.load(readerTarget.result as ArrayBuffer).then(wb => {
|
||||
const firstSheet = wb.worksheets[0]
|
||||
if (firstSheet) {
|
||||
const sheetValues = firstSheet.getSheetValues() as string[][]
|
||||
const sheetValues = Array.from(firstSheet.getSheetValues()) as string[][]
|
||||
const fieldIndex = XEUtils.findIndexOf(sheetValues, (list) => list && list.length > 0)
|
||||
const fields = sheetValues[fieldIndex] as string[]
|
||||
const status = checkImportData(tableFields, fields)
|
||||
if (status) {
|
||||
const records = sheetValues.slice(fieldIndex).map(list => {
|
||||
const records = sheetValues.slice(fieldIndex + 1).map(list => {
|
||||
const item : any = {}
|
||||
list.forEach((cellValue, cIndex) => {
|
||||
item[fields[cIndex]] = cellValue
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vxe-table-plugin-export-xlsx",
|
||||
"version": "4.0.6",
|
||||
"version": "4.0.7",
|
||||
"description": "基于 vxe-table 表格的扩展插件,支持导出 xlsx 格式",
|
||||
"scripts": {
|
||||
"lib": "gulp build"
|
||||
|
||||
Reference in New Issue
Block a user