gantt-task-react-powern 0.6.25 → 0.6.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +56 -54
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +56 -54
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4646,8 +4646,6 @@ function computeCriticalPath(taskID, taskMap) {
|
|
|
4646
4646
|
taskMap[taskID].paths = [];
|
|
4647
4647
|
|
|
4648
4648
|
for (var j = 0; j < dependents.length; j++) {
|
|
4649
|
-
var _taskMap$dependents$j, _taskMap$dependents$j2, _taskMap$dependents$j3, _taskMap$dependents$j4;
|
|
4650
|
-
|
|
4651
4649
|
var depStart = taskMap[dependents[j]].task.start.getTime();
|
|
4652
4650
|
var depEnd = taskMap[dependents[j]].task.end.getTime();
|
|
4653
4651
|
var depDuration = depEnd - depStart;
|
|
@@ -4655,25 +4653,27 @@ function computeCriticalPath(taskID, taskMap) {
|
|
|
4655
4653
|
var endWeek = Math.floor((depEnd / 86400000 + 4) / 7);
|
|
4656
4654
|
var offTime = 0;
|
|
4657
4655
|
|
|
4658
|
-
if (
|
|
4659
|
-
|
|
4660
|
-
for (var
|
|
4661
|
-
var
|
|
4662
|
-
|
|
4656
|
+
if (taskMap[dependents[j]].task.calendar) {
|
|
4657
|
+
if (taskMap[dependents[j]].task.calendar.off_days && taskMap[dependents[j]].task.calendar.off_days.length) {
|
|
4658
|
+
for (var d = 0; d < taskMap[dependents[j]].task.calendar.off_days.length || 0; d++) {
|
|
4659
|
+
for (var w = startWeek; w <= endWeek; w++) {
|
|
4660
|
+
var dayOfTheWeek = taskMap[dependents[j]].task.calendar.off_days[d];
|
|
4661
|
+
var offDay = 86400000 * (7 * w - 4 + dayOfTheWeek);
|
|
4663
4662
|
|
|
4664
|
-
|
|
4665
|
-
|
|
4663
|
+
if (offDay >= depStart && offDay <= depEnd && (offDay > taskMap[taskID].end || taskMap[taskID].task.calendar.off_days.includes(dayOfTheWeek))) {
|
|
4664
|
+
offTime += 86400000;
|
|
4665
|
+
}
|
|
4666
4666
|
}
|
|
4667
4667
|
}
|
|
4668
4668
|
}
|
|
4669
|
-
}
|
|
4670
4669
|
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4670
|
+
if (taskMap[dependents[j]].task.calendar.holidays && taskMap[dependents[j]].task.calendar.holidays.length) {
|
|
4671
|
+
for (var h = 0; h < taskMap[dependents[j]].task.calendar.holidays.length || 0; h++) {
|
|
4672
|
+
var holiday = taskMap[dependents[j]].task.calendar.holidays[h];
|
|
4674
4673
|
|
|
4675
|
-
|
|
4676
|
-
|
|
4674
|
+
if (holiday >= depStart && holiday <= depEnd) {
|
|
4675
|
+
offTime += 86400000;
|
|
4676
|
+
}
|
|
4677
4677
|
}
|
|
4678
4678
|
}
|
|
4679
4679
|
}
|
|
@@ -4681,49 +4681,51 @@ function computeCriticalPath(taskID, taskMap) {
|
|
|
4681
4681
|
var overlap = Math.max(taskMap[taskID].end - depStart, 0);
|
|
4682
4682
|
var paths = taskMap[dependents[j]].paths;
|
|
4683
4683
|
|
|
4684
|
-
|
|
4685
|
-
var
|
|
4684
|
+
if (paths && paths.length) {
|
|
4685
|
+
for (var k = 0; k < paths.length; k++) {
|
|
4686
|
+
var totalDuration = taskMap[taskID].end - taskMap[taskID].start - overlap - offTime + paths[k].duration;
|
|
4686
4687
|
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4688
|
+
if (taskMap[taskID].paths.length < 2) {
|
|
4689
|
+
taskMap[taskID].paths.push({
|
|
4690
|
+
duration: totalDuration,
|
|
4691
|
+
task: dependents[j],
|
|
4692
|
+
parent: taskID,
|
|
4693
|
+
visited: false
|
|
4694
|
+
});
|
|
4695
|
+
} else if (totalDuration > taskMap[taskID].paths[0].duration) {
|
|
4696
|
+
taskMap[taskID].paths[0].duration = totalDuration;
|
|
4697
|
+
taskMap[taskID].paths[0].task = dependents[j];
|
|
4698
|
+
taskMap[taskID].paths[0].parent = taskID;
|
|
4699
|
+
taskMap[taskID].paths[0].visited = false;
|
|
4700
|
+
} else if (totalDuration > taskMap[taskID].paths[1].duration) {
|
|
4701
|
+
taskMap[taskID].paths[1].duration = totalDuration;
|
|
4702
|
+
taskMap[taskID].paths[1].task = dependents[j];
|
|
4703
|
+
taskMap[taskID].paths[1].parent = taskID;
|
|
4704
|
+
taskMap[taskID].paths[1].visited = false;
|
|
4705
|
+
}
|
|
4704
4706
|
}
|
|
4705
|
-
}
|
|
4706
4707
|
|
|
4707
|
-
|
|
4708
|
-
|
|
4708
|
+
if (paths.length === 0) {
|
|
4709
|
+
var immediateChildDuration = taskMap[taskID].end - taskMap[taskID].start + depDuration - overlap - offTime;
|
|
4709
4710
|
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4711
|
+
if (taskMap[taskID].paths.length < 2) {
|
|
4712
|
+
taskMap[taskID].paths.push({
|
|
4713
|
+
duration: immediateChildDuration,
|
|
4714
|
+
task: dependents[j],
|
|
4715
|
+
parent: taskID,
|
|
4716
|
+
visited: false
|
|
4717
|
+
});
|
|
4718
|
+
} else if (immediateChildDuration > taskMap[taskID].paths[0].duration) {
|
|
4719
|
+
taskMap[taskID].paths[0].duration = immediateChildDuration;
|
|
4720
|
+
taskMap[taskID].paths[0].task = dependents[j];
|
|
4721
|
+
taskMap[taskID].paths[0].parent = taskID;
|
|
4722
|
+
taskMap[taskID].paths[0].visited = false;
|
|
4723
|
+
} else if (immediateChildDuration > taskMap[taskID].paths[1].duration) {
|
|
4724
|
+
taskMap[taskID].paths[1].duration = immediateChildDuration;
|
|
4725
|
+
taskMap[taskID].paths[1].task = dependents[j];
|
|
4726
|
+
taskMap[taskID].paths[1].parent = taskID;
|
|
4727
|
+
taskMap[taskID].paths[1].visited = false;
|
|
4728
|
+
}
|
|
4727
4729
|
}
|
|
4728
4730
|
}
|
|
4729
4731
|
}
|