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

[Bug] 树形结构列表超过50行的数据之后,展开节点再收起底部会相应缺失展开的条数变为空白 #3180

Open
Aeiousl opened this issue Dec 23, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Aeiousl
Copy link

Aeiousl commented Dec 23, 2024

Version

1.14.0

Link to Minimal Reproduction

Steps to Reproduce

image
这个数据大概有50多条,然后我展开上面的任意节点(这里展开第一个)再关闭,再划到底部就是下图这样缺失上一个展开条数数量的底部条数
image

Current Behavior

let tableInstance;
const data = [
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
},
{
类别: '测试',
销售额: '229.696',
数量: '20',
利润: '90.704',
children: true
}
];
const option = {
container: document.getElementById(CONTAINER_ID),
columns: [
{
field: '类别',
tree: true,
title: '类别',
width: 'auto',
sort: true
},
{
field: '销售额',
title: '销售额',
width: 'auto',
sort: true
// tree: true,
},
{
field: '利润',
title: '利润',
width: 'auto',
sort: true
}
],
showPin: true, //显示VTable内置冻结列图标
widthMode: 'standard',
allowFrozenColCount: 2,
records: data,
rowSeriesNumber: {
title: '序号',
width: 'auto',
headerStyle: {
bgColor:'#5389ff',
borderColor:'#5389ff',
fontWeight:'normal',
color:'white'
},
style: {
color: 'black'
}
},
hierarchyIndent: 20,
hierarchyExpandLevel: 2,
hierarchyTextStartAlignment: true,
sortState: {
field: '销售额',
order: 'asc'
},
theme: VTable.themes.BRIGHT,
defaultRowHeight: 32
};

const instance = new VTable.ListTable(option);

const { TREE_HIERARCHY_STATE_CHANGE } = VTable.ListTable.EVENT_TYPE;
instance.on(TREE_HIERARCHY_STATE_CHANGE, args => {
// TODO 调用接口插入设置子节点的数据
if (args.hierarchyState === VTable.TYPES.HierarchyState.expand && !Array.isArray(args.originData.children)) {
const record = args.originData;
instance.setLoadingHierarchyState(args.col, args.row);
setTimeout(() => {
const children = [
{
类别: record['类别'] + ' - 分类1', // 对应原子类别
销售额: 2,
数量: 5,
利润: 4
},
{
类别: record['类别'] + ' - 分类2', // 对应原子类别
销售额: 3,
数量: 8,
利润: 5
},
{
类别: record['类别'] + ' - 分类3(懒加载)',
销售额: 4,
数量: 20,
利润: 90.704,
children: true
},
{
类别: record['类别'] + ' - 分类4', // 对应原子类别
销售额: 5,
数量: 6,
利润: 7
}
];
instance.setRecordChildren(children, args.col, args.row);
}, 2000);
}
});
window['tableInstance'] = tableInstance;

Expected Behavior

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@Aeiousl Aeiousl added the bug Something isn't working label Dec 23, 2024
@ifyoung
Copy link

ifyoung commented Dec 24, 2024

在官方列表里构建较长的树形列表也会出现这种问题https://visactor.io/vtable/demo/table-type/list-table-tree;
2024-12-2417 51 47-ezgif com-video-to-gif-converter

@Rui-Sun
Copy link
Contributor

Rui-Sun commented Jan 2, 2025

试一下1.14.3版本吧,有修复相关问题

@Aeiousl
Copy link
Author

Aeiousl commented Jan 3, 2025

@Rui-Sun 测试了一下可以了d==( ̄▽ ̄)b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants