Browse Source

Merge pull request #2712 from break60/dev-1.3.0

conditions The task node adds a background color to distinguish succe…
pull/3/MERGE
xingchun-chen 5 years ago committed by GitHub
parent
commit
2c0b7f05ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 35
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
  2. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js

35
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js

@ -54,7 +54,6 @@ const JSP = function () {
isClick: false isClick: false
} }
} }
/** /**
* dag init * dag init
*/ */
@ -199,7 +198,9 @@ JSP.prototype.jsonHandle = function ({ largeJson, locations }) {
isAttachment: this.config.isAttachment, isAttachment: this.config.isAttachment,
taskType: v.type, taskType: v.type,
runFlag: v.runFlag, runFlag: v.runFlag,
nodenumber: locations[v.id].nodenumber nodenumber: locations[v.id].nodenumber,
successNode: v.conditionResult.successNode[0],
failedNode: v.conditionResult.failedNode[0]
})) }))
// contextmenu event // contextmenu event
@ -745,13 +746,29 @@ JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
sourceId = v.endPointSourceId sourceId = v.endPointSourceId
targetId = v.endPointTargetId targetId = v.endPointTargetId
} }
this.JspInstance.connect({ if($(`#${sourceId}`).attr('data-tasks-type') === 'CONDITIONS' && $(`#${sourceId}`).attr('data-successnode') === $(`#${targetId}`).find('.name-p').text()) {
source: sourceId, this.JspInstance.connect({
target: targetId, source: sourceId,
type: 'basic', target: targetId,
paintStyle: { strokeWidth: 2, stroke: '#2d8cf0' } type: 'basic',
}) paintStyle: { strokeWidth: 2, stroke: '#4caf50' }
})
} else if($(`#${sourceId}`).attr('data-tasks-type') === 'CONDITIONS' && $(`#${sourceId}`).attr('data-failednode') === $(`#${targetId}`).find('.name-p').text()) {
this.JspInstance.connect({
source: sourceId,
target: targetId,
type: 'basic',
paintStyle: { strokeWidth: 2, stroke: '#f14343' }
})
} else {
this.JspInstance.connect({
source: sourceId,
target: targetId,
type: 'basic',
paintStyle: { strokeWidth: 2, stroke: '#2d8cf0' }
})
}
}) })
}) })

4
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js

@ -43,9 +43,9 @@ const rtBantpl = () => {
/** /**
* return node html * return node html
*/ */
const rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType, runFlag, nodenumber }) => { const rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType, runFlag, nodenumber, successNode, failedNode }) => {
let tpl = '' let tpl = ''
tpl += `<div class="w jtk-draggable jtk-droppable jtk-endpoint-anchor jtk-connected ${isAttachment ? 'jtk-ep' : ''}" data-targetarr="${targetarr || ''}" data-nodenumber="${nodenumber || 0}" data-tasks-type="${taskType}" id="${id}" style="left: ${x}px; top: ${y}px;">` tpl += `<div class="w jtk-draggable jtk-droppable jtk-endpoint-anchor jtk-connected ${isAttachment ? 'jtk-ep' : ''}" data-targetarr="${targetarr || ''}" data-successNode="${successNode || ''}" data-failedNode="${failedNode || ''}" data-nodenumber="${nodenumber || 0}" data-tasks-type="${taskType}" id="${id}" style="left: ${x}px; top: ${y}px;">`
tpl += '<div>' tpl += '<div>'
tpl += '<div class="state-p"></div>' tpl += '<div class="state-p"></div>'
tpl += `<div class="icos icos-${taskType}"></div>` tpl += `<div class="icos icos-${taskType}"></div>`

Loading…
Cancel
Save