Skip to content

Commit

Permalink
fix: [export] solve the type error (#49)
Browse files Browse the repository at this point in the history
* fix: 🐛 solve the issue of copy failure of detail table without  column.

this close #32, close #31

* fix: 💩 [export]replace the success message with the error message

* fix: 💩 [export] solve the type error
  • Loading branch information
xingwanying authored Apr 22, 2021
1 parent 66becbb commit b1044b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/s2-core/src/utils/export/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseSpreadSheet } from '../../sheet-type';
import { head, last, isEmpty, get, clone } from 'lodash';
import { head, last, isEmpty, get, clone, trim } from 'lodash';
import { ViewMeta } from '../..';
import { ID_SEPARATOR } from '../../common/constant';
import { getCsvString } from './export-worker';
Expand Down Expand Up @@ -212,7 +212,7 @@ export const copyData = (
const caredRowLeafNodes = rowLeafNodes.filter((row) => row.height !== 0);
for (const rowNode of caredRowLeafNodes) {
// Removing the space at the beginning of the line of the label.
rowNode.label = rowNode.label ? rowNode.label.replace(/^\s*/g, '') : '';
rowNode.label = trim(rowNode?.label);
const id = rowNode.id.replace(/^root\[&\]*/, '');
const tempLine = id.split(ID_SEPARATOR);
const lastLabel = sheetInstance.dataSet.getFieldName(last(tempLine));
Expand Down

0 comments on commit b1044b6

Please sign in to comment.