Skip to content

fix: 修复透视表复制时 withHeader 不包含角头的问题#3298

Draft
Copilot wants to merge 3 commits intonextfrom
copilot/fix-issue-3165-bug
Draft

fix: 修复透视表复制时 withHeader 不包含角头的问题#3298
Copilot wants to merge 3 commits intonextfrom
copilot/fix-issue-3165-bug

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

透视表开启 withHeader: true 复制时,角头数据缺失,与全量导出行为不一致。

问题

// 复制配置
{ copy: { enable: true, withHeader: true } }

// 复制输出(修复前)- 角头为空
//		家具
//		桌子
//		number
// 浙江省	杭州市	7789

// 复制输出(修复后)- 角头包含字段名
//	type	家具
//	sub_type	桌子
// province	city	number
// 浙江省	杭州市	7789

改动

  • getPivotCopyData()getDataMatrixByDataCell()withHeader: true 时添加 cornerMatrix
  • getPivotAllCopyData() / getAsyncAllPivotCopyData() 行为对齐
// pivot-data-cell-copy.ts
const rowMatrix = this.getRowMatrix();
const colMatrix = this.getColMatrix();
+ const cornerMatrix = this.getCornerMatrix(rowMatrix);

return this.matrixTransformer(
-  assembleMatrix({ rowMatrix, colMatrix, dataMatrix }),
+  assembleMatrix({ rowMatrix, colMatrix, dataMatrix, cornerMatrix }),
  this.config.separator,
);
Original prompt

分析issue #3165 是否是本仓库的代码bug,如果是,请进行修复,并解释修复思路。最终提交的PullRequest的标题和描述都应该是中文的。Pull Request的描述中需要Solve the issue and close #3165


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 22, 2026 08:47
Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com>
Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com>
Copilot AI changed the title [WIP] 修复仓库中第3165个问题的代码错误 fix: 修复透视表复制时 withHeader 不包含角头的问题 Jan 22, 2026
Copilot AI requested a review from Alexzjt January 22, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛点击角头、维度的列头全部都是复制整个表格的数据,但没有高亮整个表格

2 participants

Comments