diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js index 8225673ecd..240f3246aa 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js @@ -49,10 +49,16 @@ Dag.prototype.setConfig = function (o) { * create dag */ Dag.prototype.create = function () { + let self = this jsPlumb.ready(() => { JSP.init({ dag: this.dag, - instance: this.instance + instance: this.instance, + options: { + onRemoveNodes ($id) { + self.dag.removeEventModelById($id) + } + } }) // init event @@ -108,7 +114,7 @@ Dag.prototype.backfill = function (arg) { tmp.push(locationsValue2[i]) } } - + function copy (array) { let newArray = [] for(let item of array) { @@ -117,7 +123,7 @@ Dag.prototype.backfill = function (arg) { return newArray; } - + let newArr = copy(arr) function getNewArr() { for(let i= 0; i1) { dataObject[Object.keys(locationsValue1)[0]].y = (countTree/2)*120+50 } - + locationsValue = dataObject + let self = this jsPlumb.ready(() => { JSP.init({ dag: this.dag, - instance: this.instance + instance: this.instance, + options: { + onRemoveNodes ($id) { + self.dag.removeEventModelById($id) + } + } }) // Backfill JSP.jspBackfill({ @@ -298,10 +310,16 @@ Dag.prototype.backfill = function (arg) { }) }) } else { + let self = this jsPlumb.ready(() => { JSP.init({ dag: this.dag, - instance: this.instance + instance: this.instance, + options: { + onRemoveNodes ($id) { + self.dag.removeEventModelById($id) + } + } }) // Backfill JSP.jspBackfill({ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue index 40b6d85198..247f473bad 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue @@ -61,7 +61,7 @@
-
+ -