1
0
mirror of synced 2025-12-09 23:08:02 +08:00
This commit is contained in:
xuliangzhan
2020-10-25 21:51:11 +08:00
parent d4e88e3dfa
commit 91b3dc45c4
2 changed files with 3 additions and 3 deletions

View File

@@ -226,8 +226,8 @@ function importXLSX (params: InterceptorImportParams) {
})
const workbook = XLSX.read(e.target.result, { type: 'binary' })
const rest = XLSX.utils.sheet_to_json(XEUtils.first(workbook.Sheets))
const fields = XEUtils.keys(rest.slice(0, 1)[0])
const list = rest.slice(1)
const fields = rest ? XEUtils.keys(rest[0]) : []
const list = rest
const status = checkImportData(tableFields, fields)
if (status) {
const records: any[] = list.map(item => {