|
|
|
@ -691,6 +691,9 @@ JSP.prototype.handleEvent = function () {
|
|
|
|
|
let sourceId = info['sourceId']// 出
|
|
|
|
|
let targetId = info['targetId']// 入
|
|
|
|
|
console.log(sourceId,targetId) |
|
|
|
|
let rtTargetarr = rtTargetarrArr(targetId) |
|
|
|
|
let rtSoucearr = rtTargetarrArr(sourceId) |
|
|
|
|
console.log(rtTargetarr,rtSoucearr) |
|
|
|
|
/** |
|
|
|
|
* When connecting, connection is prohibited when the sourceId and target nodes are empty |
|
|
|
|
*/ |
|
|
|
@ -714,19 +717,21 @@ JSP.prototype.handleEvent = function () {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Connection to connected nodes is not allowed
|
|
|
|
|
if (_.findIndex(rtTargetarrArr(targetId), v => v === sourceId) !== -1) { |
|
|
|
|
if (_.findIndex(rtTargetarr, v => v == sourceId) !== -1) { |
|
|
|
|
console.log(rtTargetarr,'not allowed') |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Recursive form to find if the target Targetarr has a sourceId
|
|
|
|
|
if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) { |
|
|
|
|
if (recursiveTargetarr(rtSoucearr, targetId)) { |
|
|
|
|
console.log('has a sourceId') |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($(`#${sourceId}`).attr('data-tasks-type') === 'CONDITIONS' && $(`#${sourceId}`).attr('data-nodenumber') === 2) { |
|
|
|
|
if ($(`#${sourceId}`).attr('data-tasks-type') === 'CONDITIONS' && parseInt($(`#${sourceId}`).attr('data-nodenumber')) === 2) { |
|
|
|
|
return false |
|
|
|
|
} else { |
|
|
|
|
$(`#${sourceId}`).attr('data-nodenumber', Number($(`#${sourceId}`).attr('data-nodenumber')) + 1) |
|
|
|
|
console.log('data-nodenumber') |
|
|
|
|
$(`#${sourceId}`).attr('data-nodenumber', parseInt($(`#${sourceId}`).attr('data-nodenumber')) + 1) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Storage node dependency information
|
|
|
|
|