Skip to content
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

🐛复制/下载数据超过1w条时出现重复数据 #2718

Closed
1 of 5 tasks
wyh888 opened this issue May 13, 2024 · 1 comment
Closed
1 of 5 tasks

🐛复制/下载数据超过1w条时出现重复数据 #2718

wyh888 opened this issue May 13, 2024 · 1 comment
Labels
next 2.0-next 版本的问题 released on @next

Comments

@wyh888
Copy link
Contributor

wyh888 commented May 13, 2024

🏷 Version

Package Version
@antv/s2 2.0.0-next.20
@antv/s2-react 2.0.0-next.19

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

当下载数据>=1w条时,出现重复数据:

image image

⌨️ Code Snapshots

function generateRawData(
  row: Record<string, number>,
  col: Record<string, number>,
) {
  const res: Record<string, any>[] = [];

  const rowKeys = Object.keys(row);
  const colKeys = Object.keys(col);

  for (let i = 0; i < row[rowKeys[0]]; i++) {
    for (let j = 0; j < row[rowKeys[1]]; j++) {
      for (let m = 0; m < col[colKeys[0]]; m++) {
        for (let n = 0; n < col[colKeys[1]]; n++) {
          res.push({
            province: `p${i}`,
            city: `c${j}`,
            type: `type${m}`,
            subType: `subType${n}`,
            number: i * n,
          });
        }
      }
    }
  }

  return res;
}

const dataCfg = {
  fields: {
    columns: ['province', 'city', 'type', 'subType', 'number'],
  },
  data: generateRawData({ province: 10, city: 10 }, { type: 10, sub_type: 10 }),
};

const options = {
  width: 600,
  height: 480,
  seriesNumber: {
    enable: true
  }  
};

<SheetComponent dataCfg={dataCfg} options={options} header={{ export: { open: true }}} />
                          

🔗 Reproduce Link

🤔 Steps to Reproduce

如上代码进行配置

😊 Expected Behavior

😅 Current Behavior

💻 System information

Environment Info
System Mac: 12.6.3
Browser Chrome: 124.0.6367.92
@github-actions github-actions bot added the next 2.0-next 版本的问题 label May 13, 2024
wyh888 pushed a commit to wyh888/S2 that referenced this issue May 13, 2024
wyh888 pushed a commit to wyh888/S2 that referenced this issue May 14, 2024
lijinke666 pushed a commit that referenced this issue May 14, 2024
* fix: 修复下载数据重复 close #2718

* fix: 修复透视表导出报错问题

* test: 提交单测

* refactor: 修改变量名

* refactor: 抽取公用变量、方法到 BaseDataCellCopy 基类

---------

Co-authored-by: Harvey Wang <[email protected]>
@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v2.0.0-next.21 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 released on @next
Projects
None yet
Development

No branches or pull requests

2 participants