|
|
@ -719,22 +719,22 @@ function sendStorage(){ |
|
|
|
function updateLinksLag(data) { |
|
|
|
function updateLinksLag(data) { |
|
|
|
data.data.forEach(task => { |
|
|
|
data.data.forEach(task => { |
|
|
|
data.links.forEach(link => { |
|
|
|
data.links.forEach(link => { |
|
|
|
if (link.target == task.id) { |
|
|
|
if (link.target == task.id && task.actual_start != null) { |
|
|
|
let predecessor = data.data.find(item => item.id == link.source); |
|
|
|
let predecessor = data.data.find(item => item.id == link.source); |
|
|
|
if (predecessor) { |
|
|
|
if (predecessor) { |
|
|
|
let lag; |
|
|
|
let lag; |
|
|
|
if (isBaselineSet) { |
|
|
|
if (isBaselineSet) { |
|
|
|
switch (link.type) { |
|
|
|
switch (link.type) { |
|
|
|
case "0": |
|
|
|
case "0": // FS
|
|
|
|
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date)); |
|
|
|
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "1": |
|
|
|
case "1": // SS
|
|
|
|
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.start_date)); |
|
|
|
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.start_date)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "2": |
|
|
|
case "2": // FF
|
|
|
|
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.end_date)); |
|
|
|
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.end_date)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "3": |
|
|
|
case "3": // SF
|
|
|
|
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.end_date)); |
|
|
|
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.end_date)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|