|
@@ -118,15 +118,15 @@
|
|
|
})
|
|
|
}
|
|
|
let datas = [];
|
|
|
+ /* Also can use XLSX.utils.sheet_to_json(sheet, {header:1, blankRows: false}); but my dependencies blankRows not work*/
|
|
|
for(let rowIndex = range.s.r; rowIndex <= range.e.r; ++rowIndex) {
|
|
|
let data = {};
|
|
|
for (let colIndex = range.s.c; colIndex <= range.e.c; ++colIndex) { /* walk every column in the range */
|
|
|
var cell = sheet[XLSX.utils.encode_cell({ c: colIndex, r: rowIndex })]; /* find the cell in the first row */
|
|
|
data['column_' + colIndex] = XLSX.utils.format_cell(cell);
|
|
|
}
|
|
|
- datas.push(data);
|
|
|
+ (Object.values(data).join('').length > 0) && datas.push(data);
|
|
|
}
|
|
|
-
|
|
|
return {
|
|
|
columns: headers,
|
|
|
data: datas
|