exportexcel增加context
This commit is contained in:
parent
f01522507c
commit
321543482e
|
|
@ -89,7 +89,7 @@ async function exportEntity(params, context) {
|
|||
(0, assert_1.default)(headers2 && headers2.length > 0, '导出未传入表头');
|
||||
const fittedDatalist = [];
|
||||
for (const data of dataList) {
|
||||
fittedDatalist.push(fn(data));
|
||||
fittedDatalist.push(await fn(data, context));
|
||||
}
|
||||
const exportSheet = xlsx_1.utils.json_to_sheet(fittedDatalist, { header: headers2 });
|
||||
const exportBook = xlsx_1.utils.book_new();
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ export async function exportEntity<
|
|||
assert(headers2 && headers2.length > 0, '导出未传入表头')
|
||||
const fittedDatalist = []
|
||||
for (const data of dataList) {
|
||||
fittedDatalist.push(fn(data as ED[keyof ED]['Schema']));
|
||||
fittedDatalist.push(await fn(data as ED[keyof ED]['Schema'], context));
|
||||
}
|
||||
const exportSheet = utils.json_to_sheet(fittedDatalist, { header: headers2 });
|
||||
const exportBook = utils.book_new();
|
||||
|
|
|
|||
Loading…
Reference in New Issue