Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

树形结构表格选中子节点后收缩父节点,header checkbox 状态显示异常(应为半选,实际为空)。

根因useRowSelect.tsxgetSelectedHeader() 仅基于可见行 (canSelectedRows) 计算状态。收缩时子节点从可见数据移除,但 tSelectedRowKeys 仍包含这些 key,导致 intersectionKeys 为空。

修复

  • isIndeterminate:增加条件 intersectionKeys.length < tSelectedRowKeys.length(存在不可见的已选行)
  • isChecked:增加条件 intersectionKeys.length === tSelectedRowKeys.length(所有已选行均可见)

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-vue-next

  • fix(EnhancedTable): 修复行选中收缩后,表格头全选状态异常的问题

@tdesign-vue-next/chat

@tdesign-vue-next/auto-import-resolver

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供
Original prompt

This section details on the original issue you should resolve

<issue_title>[table] 开启树形结构行选中后,勾选收缩之后header的全选出现异常</issue_title>
<issue_description>### tdesign-vue-next 版本

1.17.1

重现链接

https://tdesign.tencent.com/vue-next/components/table#%E6%A0%91%E5%BD%A2%E7%BB%93%E6%9E%84%E8%A1%8C%E9%80%89%E4%B8%AD

重现步骤

官方文档即可复现: 树形结构行选中

操作GIF:
Image

期望结果

折叠后列头的checkbox也显示为半选状态

实际结果

折叠后列头的checkbox显示为没有

Image

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix checkbox display issue in tree structure table fix(table): 树形结构行选中收缩后 header 全选 checkbox 状态异常 Nov 28, 2025
Copilot AI requested a review from liweijie0812 November 28, 2025 16:56
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 28, 2025

tdesign-vue-next-demo

npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/auto-import-resolver@6208
npm i https://pkg.pr.new/Tencent/tdesign-vue-next@6208
npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/chat@6208

commit: 7760691

@tdesign-bot
Copy link
Collaborator

tdesign-bot commented Nov 29, 2025

TDesign Component Site Preview Open

Component Preview
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成

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.

[table] 开启树形结构行选中后,勾选收缩之后header的全选出现异常

4 participants