[Bug] 透视表自定义表头配置不规则树结构,不同维度key下value值相同的行,前面行单元格值会被后面行单元格值覆盖
@fangsmile is already working on this.
Since Aug 18, 2025.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
Version
1.19.1-alpha.1
Link to Minimal Reproduction
https://visactor.io/vtable/demo/table-type/pivot-table
Steps to Reproduce
可以把下述配置代码复制到官网示例里(https://visactor.io/vtable/demo/table-type/pivot-table)
let tableInstance;
const option = {
"records": [
{
"METRIC": "BR UV",
"dim_2261f2a9": "否",
"DATE_DIM_0_0": "317",
},
{
"METRIC": "BR UV",
"dim_2261f2a9": "是",
"DATE_DIM_0_0": "44",
},
{
"METRIC": "BR UV",
"dim_186fb4a4": "否",
"DATE_DIM_0_0": "160",
},
{
"METRIC": "BR UV",
"dim_186fb4a4": "是",
"DATE_DIM_0_0": "288",
}
],
"rows": [
{
"dimensionKey": "dim_2261f2a9",
"title": "维度",
"width": "auto",
},
{
"dimensionKey": "dim_186fb4a4",
"title": "维度",
"width": "auto",
}
],
"rowTree": [
{
"dimensionKey": "dim_2261f2a9",
"value": "否"
},
{
"dimensionKey": "dim_2261f2a9",
"value": "是"
},
{
"dimensionKey": "dim_186fb4a4",
"value": "否"
},
{
"dimensionKey": "dim_186fb4a4",
"value": "是"
}
],
"columns": [
{
"dimensionKey": "METRIC",
"title": "指标",
"width": "auto",
}
],
"columnTree": [
{
"dimensionKey": "METRIC",
"originKey": "metric_7179ce0f",
"value": "BR UV",
"children": []
}
],
"dataConfig": {
"sortRules": [],
"aggregationRules": [
{
"indicatorKey": "DATE_DIM_0_0",
"field": "DATE_DIM_0_0",
"aggregationType": "NONE"
}
]
},
"parseCustomTreeToMatchRecords": true,
"indicators": [
{
"indicatorKey": "DATE_DIM_0_0",
"title": "2025-08-12",
"width": "auto",
}
],
}
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option);
window['tableInstance'] = tableInstance;
Current Behavior
透视表,自定义表头,不规则树的情况下,配置应该和官方配置一致,但是不同key,相同value的单元格行,前面的数值被后面覆盖了
Expected Behavior
单元格数值正常显示,不同维度key下,即便value(表头名称)相同,其所属行单元格数值也不应该被覆盖掉
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.