From e5d2f807c91415b871201fd3fe5c503216c2b1f1 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Thu, 30 Jul 2020 11:55:17 +0800 Subject: [PATCH 1/2] [bugFix][ui] Cannot select connection --- .../pages/dag/_source/plugIn/jsPlumbHandle.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js index b1121c881dc9..2d5f938e7a00 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js @@ -84,11 +84,10 @@ JSP.prototype.init = function ({ dag, instance, options }) { // Monitor line click this.JspInstance.bind('click', e => { // Untie event - if (this.config.isDblclick) { - findComponentDownward(this.dag.$root, 'dag-chart')._createLineLabel({id: e._jsPlumb.overlays.label.canvas.id, sourceId: e.sourceId, targetId: e.targetId}) - } if (this.config.isClick) { this.connectClick(e) + } else { + findComponentDownward(this.dag.$root, 'dag-chart')._createLineLabel({id: e._jsPlumb.overlays.label.canvas.id, sourceId: e.sourceId, targetId: e.targetId}) } }) @@ -496,6 +495,16 @@ JSP.prototype.removeNodes = function ($id) { // callback onRemoveNodes event this.options && this.options.onRemoveNodes && this.options.onRemoveNodes($id) + let connects = [] + _.map(this.JspInstance.getConnections(), v => { + connects.push({ + endPointSourceId: v.sourceId, + endPointTargetId: v.targetId, + label: v._jsPlumb.overlays.label.canvas.innerText + }) + }) + // Storage line dependence + store.commit('dag/setConnects', connects) } /** @@ -819,4 +828,4 @@ JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) { this.draggable() } -export default new JSP() +export default new JSP() \ No newline at end of file From 80c5c66ce9f32037858ec2dc7bca87b5f763feb1 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Thu, 30 Jul 2020 14:03:23 +0800 Subject: [PATCH 2/2] fix --- .../conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js index 2d5f938e7a00..5212484aab56 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js @@ -632,10 +632,10 @@ JSP.prototype.saveStore = function () { // task _.map(_.cloneDeep(store.state.dag.tasks), v => { if (is(v.id)) { - const preTasks = [] - const id = $(`#${v.id}`) - const tar = id.attr('data-targetarr') - const idDep = tar ? id.attr('data-targetarr').split(',') : [] + let preTasks = [] + let id = $(`#${v.id}`) + let tar = id.attr('data-targetarr') + let idDep = tar ? id.attr('data-targetarr').split(',') : [] if (idDep.length) { _.map(idDep, v1 => { preTasks.push($(`#${v1}`).find('.name-p').text())