Skip to content

Commit 5383751

Browse files
committed
fix: gantt change taskbar schedule update record error
1 parent 680e4df commit 5383751

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

packages/vtable-gantt/src/Gantt.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -782,13 +782,13 @@ export class Gantt extends EventTarget {
782782
// index + this.taskListTableInstance.columnHeaderLevelCount
783783
// );
784784
// }
785-
if (this.taskListTableInstance.rowHierarchyType === 'tree' && typeof index === 'number') {
786-
//如果是树形结构 需要获取数据源对应的索引
787-
index = this.taskListTableInstance.getRecordIndexByCell(
788-
0,
789-
index + this.taskListTableInstance.columnHeaderLevelCount
790-
);
791-
}
785+
// if (this.taskListTableInstance.rowHierarchyType === 'tree' && typeof index === 'number') {
786+
// //如果是树形结构 需要获取数据源对应的索引
787+
// index = this.taskListTableInstance.getRecordIndexByCell(
788+
// 0,
789+
// index + this.taskListTableInstance.columnHeaderLevelCount
790+
// );
791+
// }
792792
this.taskListTableInstance.updateRecords([record], [index]);
793793
}
794794
/**
@@ -942,11 +942,20 @@ export class Gantt extends EventTarget {
942942
if (Array.isArray(task_index)) {
943943
const index = (task_index as number[])[0];
944944
const sub_index = (task_index as number[])[1];
945-
this._updateRecordToListTable(record, isValid(sub_index) ? [index, sub_index] : index);
945+
// this._updateRecordToListTable(record, isValid(sub_index) ? [index, sub_index] : index);
946+
this._updateRecordToListTable(record, task_index);
946947
this._refreshTaskBar(index, sub_index);
947948
return;
948949
}
949950
const index = task_index as number;
951+
952+
// if (this.taskListTableInstance.rowHierarchyType === 'tree' && typeof index === 'number') {
953+
// //如果是树形结构 需要获取数据源对应的索引
954+
// index = this.taskListTableInstance.getRecordIndexByCell(
955+
// 0,
956+
// index + this.taskListTableInstance.columnHeaderLevelCount
957+
// );
958+
// }
950959
this._updateRecordToListTable(record, index);
951960
this._refreshTaskBar(index, undefined);
952961
}

0 commit comments

Comments
 (0)