-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 修复导出 CSV 时分隔符错误导致的展示格式错误 close #2701 #2703
Conversation
BREAKING CHANGE: Export 组件 和 asyncGetAllPlainData, copyToClipboard 的是否异步导出参数统一为 async
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const pivotDataCellCopy = new PivotDataCellCopy({ | ||
spreadsheet: sheetInstance, | ||
isExport: true, | ||
config: { | ||
separator: split, | ||
formatOptions, | ||
customTransformer, | ||
isAsyncExport: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
透视表没有接受 async 这个参数, 所以同步复制时不生效的
const tableDataCellCopy = new TableDataCellCopy({ | ||
spreadsheet: sheetInstance, | ||
config: { | ||
selectedCells: [], | ||
separator: split, | ||
formatOptions, | ||
customTransformer, | ||
isAsyncExport: true ?? isAsyncExport, | ||
async: async ?? true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个感觉是之前写反了
*/ | ||
export const copyToClipboard = ( | ||
data: Copyable | string, | ||
sync = false, | ||
async = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在有三种 sync
syncCopy
, isAsyncExport
, 有点混乱, 所有参数统一为 async
@@ -82,8 +84,10 @@ export const Export: React.FC<ExportProps> = React.memo((props) => { | |||
const downloadData = async (isFormat: boolean) => { | |||
const data = await asyncGetAllPlainData({ | |||
sheetInstance: sheet, | |||
split: NewTab, | |||
// 导出的是 csv 格式, 复制时需要以逗号分割 https://github.com/antvis/S2/issues/2701 | |||
split: CSV_SEPARATOR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主要是这个导致的, csv 分隔符应该是 ","
Size Change: +46 B (0%) Total Size: 320 kB
ℹ️ View Unchanged
|
你好, @lijinke666 CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。 Hello, @lijinke666 CI run failed, please click the [Details] button for detailed log information and fix it. |
🎉 This PR is included in version @antv/s2-v2.0.0-next.20 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-react-v2.0.0-next.19 🎉 The release is available on: Your semantic-release bot 📦🚀 |
👀 PR includes
🐛 Bugfix
📝 Description
🖼️ Screenshot
🔗 Related issue link
close #2701
🔍 Self-Check before the merge