Browse Source

Optimize dag

pull/3/MERGE
break60 4 years ago
parent
commit
21eaf51e1b
  1. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.js
  2. 6
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
  3. 6
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
  4. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js

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

@ -118,8 +118,8 @@ Dag.prototype.toolbarEvent = function ({ item, code, is }) {
Dag.prototype.backfill = function (arg) { Dag.prototype.backfill = function (arg) {
if (arg) { if (arg) {
let locationsValue = store.state.dag.locations let locationsValue = store.state.dag.locations
const locationsValue1 = store.state.dag.locations const locationsValue1 = _.cloneDeep(store.state.dag.locations)
const locationsValue2 = store.state.dag.locations const locationsValue2 = _.cloneDeep(store.state.dag.locations)
const arr = [] const arr = []
for (const i in locationsValue1) { for (const i in locationsValue1) {
const objs = {} const objs = {}

6
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue

@ -522,9 +522,9 @@
} else { } else {
rearList = [] rearList = []
} }
let targetarr = $(`#${id}`).attr('data-targetarr') let target = $(`#${id}`).attr('data-targetarr')
if (targetarr) { if (target) {
let nodearr = targetarr.split(',') let nodearr = target.split(',')
nodearr.forEach(v => { nodearr.forEach(v => {
let nodeobj = {} let nodeobj = {}
nodeobj.value = $(`#${v}`).find('.name-p').text() nodeobj.value = $(`#${v}`).find('.name-p').text()

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

@ -687,14 +687,14 @@ JSP.prototype.saveStore = function () {
JSP.prototype.handleEvent = function () { JSP.prototype.handleEvent = function () {
this.JspInstance.bind('beforeDrop', function (info) { this.JspInstance.bind('beforeDrop', function (info) {
const sourceId = info.sourceId// 出 let sourceId = info['sourceId']// 出
const targetId = info.targetId// 入 let targetId = info['targetId']// 入
/** /**
* Recursive search for nodes * Recursive search for nodes
*/ */
let recursiveVal let recursiveVal
const recursiveTargetarr = (arr, targetId) => { const recursiveTargetarr = (arr, targetId) => {
for (const i in arr) { for (let i in arr) {
if (arr[i] === targetId) { if (arr[i] === targetId) {
recursiveVal = targetId recursiveVal = targetId
} else { } else {

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

@ -32,7 +32,7 @@ const rtTargetarrArr = (id) => {
*/ */
const saveTargetarr = (valId, domId) => { const saveTargetarr = (valId, domId) => {
let $target = $(`#${domId}`) let $target = $(`#${domId}`)
let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}` let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`;
$target.attr('data-targetarr', targetStr) $target.attr('data-targetarr', targetStr)
} }

Loading…
Cancel
Save