vxe-table-plugin-export-xlsx-xhx 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.common.js +10 -7
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
@@ -15,7 +15,8 @@ function getCellLabel(column, cellValue) {
|
|
15
15
|
if (cellValue) {
|
16
16
|
switch (column.cellType) {
|
17
17
|
case 'string':
|
18
|
-
return _xeUtils["default"].toValueString(cellValue);
|
18
|
+
// return _xeUtils["default"].toValueString(cellValue);
|
19
|
+
return _xeUtils.toValueString(cellValue);
|
19
20
|
case 'number':
|
20
21
|
if (!isNaN(cellValue)) {
|
21
22
|
return Number(cellValue);
|
@@ -31,7 +32,9 @@ function getCellLabel(column, cellValue) {
|
|
31
32
|
return cellValue;
|
32
33
|
}
|
33
34
|
function getFooterCellValue($table, opts, rows, column) {
|
34
|
-
var cellValue = _xeUtils["default"].toString(rows[$table.$getColumnIndex(column)]);
|
35
|
+
// var cellValue = _xeUtils["default"].toString(rows[$table.$getColumnIndex(column)]);
|
36
|
+
var cellValue = _xeUtils.toString(rows[$table.$getColumnIndex(column)]);
|
37
|
+
|
35
38
|
return cellValue;
|
36
39
|
}
|
37
40
|
function toBuffer(wbout) {
|
@@ -60,7 +63,7 @@ function exportXLSX(params) {
|
|
60
63
|
if (isHeader) {
|
61
64
|
columns.forEach(function (column) {
|
62
65
|
// colHead[column.id] = XEUtils.toString(original ? column.property : column.getTitle())
|
63
|
-
colHead[column.id] = _xeUtils
|
66
|
+
colHead[column.id] = _xeUtils.toString(original ? column.property : column.getTitle());
|
64
67
|
});
|
65
68
|
}
|
66
69
|
// 新增部分
|
@@ -83,13 +86,13 @@ function exportXLSX(params) {
|
|
83
86
|
footList.push(item);
|
84
87
|
});
|
85
88
|
}
|
86
|
-
var book = _xlsx
|
87
|
-
var sheet = _xlsx
|
89
|
+
var book = _xlsx.utils.book_new();
|
90
|
+
var sheet = _xlsx.utils.json_to_sheet((isHeader ? [colHead] : []).concat(rowList).concat(footList), {
|
88
91
|
skipHeader: true
|
89
92
|
});
|
90
93
|
// 转换数据
|
91
|
-
_xlsx
|
92
|
-
var wbout = _xlsx
|
94
|
+
_xlsx.utils.book_append_sheet(book, sheet, sheetName);
|
95
|
+
var wbout = _xlsx.write(book, {
|
93
96
|
bookType: type,
|
94
97
|
bookSST: false,
|
95
98
|
type: 'binary'
|