1
0
mirror of synced 2025-11-06 04:10:39 +08:00
This commit is contained in:
xuliangzhan
2024-10-17 11:31:11 +08:00
parent 2e9ca4f389
commit 0a80c1acf0
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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"