@mcurros2/microm 1.1.121-0 → 1.1.122-0
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.d.ts.map +1 -1
- package/dist/index.js +46 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2977,11 +2977,53 @@ function $5be4b35862a9dc4d$export$a04f965200623e61(data, notExportableColumns, s
|
|
|
2977
2977
|
const workbook = new (0, ($parcel$interopDefault($b4te3$exceljs))).Workbook();
|
|
2978
2978
|
data.forEach((result, index)=>{
|
|
2979
2979
|
const worksheet = workbook.addWorksheet(sheetNames ? sheetNames[index] : `Data ${index + 1}`);
|
|
2980
|
-
const
|
|
2980
|
+
const exportableColumnsConfig = [];
|
|
2981
|
+
result.Header.forEach((header, colIndex)=>{
|
|
2982
|
+
if (notExportableColumns === null || notExportableColumns === void 0 ? void 0 : notExportableColumns.includes(colIndex)) exportableColumnsConfig.push({
|
|
2981
2983
|
header: header,
|
|
2982
|
-
key: header
|
|
2983
|
-
|
|
2984
|
-
|
|
2984
|
+
key: header,
|
|
2985
|
+
originalIndex: colIndex
|
|
2986
|
+
});
|
|
2987
|
+
});
|
|
2988
|
+
worksheet.columns = exportableColumnsConfig.map((col)=>({
|
|
2989
|
+
header: col.header,
|
|
2990
|
+
key: col.key
|
|
2991
|
+
}));
|
|
2992
|
+
exportableColumnsConfig.forEach((colInfo)=>{
|
|
2993
|
+
const originalColIndex = colInfo.originalIndex;
|
|
2994
|
+
const columnType = result.typeInfo[originalColIndex];
|
|
2995
|
+
const column = worksheet.getColumn(colInfo.key);
|
|
2996
|
+
if (column) switch(columnType){
|
|
2997
|
+
case "tinyint":
|
|
2998
|
+
case "smallint":
|
|
2999
|
+
case "int":
|
|
3000
|
+
case "bigint":
|
|
3001
|
+
column.numFmt = "0";
|
|
3002
|
+
break;
|
|
3003
|
+
case "float":
|
|
3004
|
+
case "decimal":
|
|
3005
|
+
case "real":
|
|
3006
|
+
column.numFmt = "#,##0.00";
|
|
3007
|
+
break;
|
|
3008
|
+
case "money":
|
|
3009
|
+
column.numFmt = "$#,##0.00";
|
|
3010
|
+
break;
|
|
3011
|
+
case "bit":
|
|
3012
|
+
column.numFmt = "0";
|
|
3013
|
+
break;
|
|
3014
|
+
case "date":
|
|
3015
|
+
column.numFmt = "yyyy-mm-dd";
|
|
3016
|
+
break;
|
|
3017
|
+
case "datetime":
|
|
3018
|
+
case "datetime2":
|
|
3019
|
+
case "smalldatetime":
|
|
3020
|
+
column.numFmt = "yyyy-mm-dd hh:mm:ss";
|
|
3021
|
+
break;
|
|
3022
|
+
case "time":
|
|
3023
|
+
column.numFmt = "hh:mm:ss";
|
|
3024
|
+
break;
|
|
3025
|
+
}
|
|
3026
|
+
});
|
|
2985
3027
|
result.records.forEach((row)=>{
|
|
2986
3028
|
const filteredRow = row.filter((_, index)=>!(notExportableColumns === null || notExportableColumns === void 0 ? void 0 : notExportableColumns.includes(index)));
|
|
2987
3029
|
worksheet.addRow(filteredRow);
|