MCPcopy Create free account
hub / github.com/apitable/apitable / exportCSV

Function exportCSV

packages/datasheet/src/pc/utils/catalog.ts:332–343  ·  view source on GitHub ↗
(workbook: Workbook, fileName: string, isView?: boolean)

Source from the content-addressed store, hash-verified

330};
331
332const exportCSV = async (workbook: Workbook, fileName: string, isView?: boolean) => {
333 await workbook.csv.writeBuffer({ encoding: 'UTF-8' }).then((buffer) => {
334 const blob = new Blob(['\uFEFF' + buffer], { type: 'text/csv;charset=utf-8;' });
335 const link = document.createElement('a');
336 link.href = window.URL.createObjectURL(blob);
337 link.download = `${fileName}.csv`;
338 link.click();
339 Message.success({
340 content: isView ? t(Strings.import_view_data_succeed) : t(Strings.import_file_data_succeed),
341 });
342 });
343};
344
345const getColumnHeader = (datasheet: IDatasheetState, cols: IViewColumn[]) => {
346 return cols.map((col) => ({

Callers 1

exportDatasheetBaseFunction · 0.85

Calls 2

tFunction · 0.90
successMethod · 0.65

Tested by

no test coverage detected