VTable icon indicating copy to clipboard operation
VTable copied to clipboard

[Bug] 甘特图树形数据创建排期会错误赋值

Open haha4445 opened this issue 9 months ago • 3 comments

Version

1.17.3

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/vtable-gantt-create-pqdtnh

Steps to Reproduce

https://visactor.io/vtable/demo/gantt/gantt-interaction-creation-button?version=1.17.3 1.代码来源官网示例未做更改,仅在create_task_schedule事件中打印了当前ganttInstance.records 2.点击第二行甘特图区域创建排期按钮

Current Behavior

第6行数据(也即创建排期数据的一级父级的下一个兄弟一级数据),被错误赋值为创建排期的那条数据,children参数也会被错误赋值,create_task_schedule事件中打印了当前ganttInstance.records显示错误来源可能是数据赋值错误

Expected Behavior

其他行的正常数据不应被影响

Environment

- OS: Windows11 x64 24H2  26100.3476
- Browser: Chrome 134.0.6998.178(正式版本) (64 位)
- Framework: Js

Any additional comments?

No response

haha4445 avatar Mar 26 '25 06:03 haha4445

临时解决方法:保存一个deepClone的records, 在onCreateTaskSchedule事件中替换掉被错误赋值的行,重新执行一遍gantInstance.setRecords方法来覆盖掉被错误赋值的数据

haha4445 avatar Mar 26 '25 10:03 haha4445

你好,1.17.5版本,按照上面步骤这个问题可以复现 @fangsmile

Image

haha4445 avatar Apr 07 '25 07:04 haha4445

同时还有个bug 注意上述复现的demo 如果调整任务条的开始结束时间也会出错,日期被改到其他数据上

fangsmile avatar Apr 07 '25 11:04 fangsmile