fix: import excel bug

This commit is contained in:
雷军 2023-12-29 10:20:28 +08:00
parent 1bb57398d2
commit 578a3388c6
2 changed files with 7 additions and 1 deletions

View file

@ -1,7 +1,7 @@
{
"id": "excel",
"name": "Excel",
"version": "1.3.19",
"version": "1.3.20",
"minAppVersion": "0.15.0",
"description": "Create spreadsheets and easily embed them in Markdown",
"author": "ljcoder",

View file

@ -102,6 +102,12 @@ export class ExcelView extends TextFileView {
process_wb(wb: XLSX.WorkBook) {
const sheetData = stox(wb);
if (sheetData) {
sheetData.forEach((sheet) => {
if (sheet.rows) {
const last = Object.keys(sheet.rows).last() || "100"
sheet.rows.len = Math.max(100, parseInt(last) + 20)
}
})
this.sheet.loadData(sheetData)
this.saveData(JSON.stringify(sheetData))
} else {