sa2kit 1.6.23 → 1.6.24
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/{chunk-7XLFSPDG.mjs → chunk-LFB5EIIM.mjs} +2 -2
- package/dist/chunk-LFB5EIIM.mjs.map +1 -0
- package/dist/{chunk-GCVOKQZP.js → chunk-UIYKZ73N.js} +2 -2
- package/dist/chunk-UIYKZ73N.js.map +1 -0
- package/dist/{types-XTo80Oi_.d.mts → types-DszP7SAQ.d.mts} +1 -1
- package/dist/{types-XTo80Oi_.d.ts → types-DszP7SAQ.d.ts} +1 -1
- package/dist/universalExport/index.d.mts +5 -3
- package/dist/universalExport/index.d.ts +5 -3
- package/dist/universalExport/index.js +97 -53
- package/dist/universalExport/index.js.map +1 -1
- package/dist/universalExport/index.mjs +93 -49
- package/dist/universalExport/index.mjs.map +1 -1
- package/dist/universalExport/server/index.d.mts +1 -1
- package/dist/universalExport/server/index.d.ts +1 -1
- package/dist/universalExport/server/index.js +23 -18
- package/dist/universalExport/server/index.js.map +1 -1
- package/dist/universalExport/server/index.mjs +9 -4
- package/dist/universalExport/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-7XLFSPDG.mjs.map +0 -1
- package/dist/chunk-GCVOKQZP.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportConfigError, ExportDataError, ExportFileError } from '../../chunk-
|
|
1
|
+
import { ExportConfigError, ExportDataError, ExportFileError } from '../../chunk-LFB5EIIM.mjs';
|
|
2
2
|
import { createLogger } from '../../chunk-KQGP6BTS.mjs';
|
|
3
3
|
import '../../chunk-BJTO5JO5.mjs';
|
|
4
4
|
import * as XLSX from 'xlsx';
|
|
@@ -387,6 +387,12 @@ var UniversalExportService = class {
|
|
|
387
387
|
async getData(request) {
|
|
388
388
|
logger.info("\u{1F50D} [UniversalExportService] getData \u5F00\u59CB\u6267\u884C...");
|
|
389
389
|
try {
|
|
390
|
+
if (Array.isArray(request.dataSource)) {
|
|
391
|
+
logger.info("\u{1F4E6} [UniversalExportService] \u4F7F\u7528\u76F4\u63A5\u4F20\u9012\u7684\u6570\u636E\u6570\u7EC4:", {
|
|
392
|
+
length: request.dataSource.length
|
|
393
|
+
});
|
|
394
|
+
return request.dataSource;
|
|
395
|
+
}
|
|
390
396
|
if (typeof request.dataSource === "function") {
|
|
391
397
|
logger.info("\u{1F4DE} [UniversalExportService] \u8C03\u7528\u6570\u636E\u6E90\u51FD\u6570...");
|
|
392
398
|
const data = await request.dataSource();
|
|
@@ -396,10 +402,9 @@ var UniversalExportService = class {
|
|
|
396
402
|
length: Array.isArray(data) ? data.length : "N/A"
|
|
397
403
|
});
|
|
398
404
|
return data;
|
|
399
|
-
} else {
|
|
400
|
-
console.error("\u274C [UniversalExportService] \u6570\u636E\u6E90\u4E0D\u662F\u51FD\u6570:", typeof request.dataSource);
|
|
401
|
-
throw new ExportDataError("\u6682\u4E0D\u652F\u6301\u5B57\u7B26\u4E32\u6570\u636E\u6E90");
|
|
402
405
|
}
|
|
406
|
+
console.error("\u274C [UniversalExportService] \u6570\u636E\u6E90\u7C7B\u578B\u4E0D\u652F\u6301:", typeof request.dataSource);
|
|
407
|
+
throw new ExportDataError("\u4E0D\u652F\u6301\u7684\u6570\u636E\u6E90\u7C7B\u578B");
|
|
403
408
|
} catch (error) {
|
|
404
409
|
console.error("\u274C [UniversalExportService] \u83B7\u53D6\u6570\u636E\u5931\u8D25:", error);
|
|
405
410
|
throw new ExportDataError(
|