Browse Source

Merge pull request #3374 from break60/1.3.2-release

Restore constants to variables
pull/3/MERGE
xingchun-chen 4 years ago committed by GitHub
parent
commit
c1e6218e61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
  2. 16
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js
  3. 4
      dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js

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

@ -478,9 +478,9 @@ JSP.prototype.handleEventRemove = function () {
JSP.prototype.removeNodes = function ($id) {
// Delete node processing(data-targetarr)
_.map(tasksAll(), v => {
const targetarr = v.targetarr.split(',')
let targetarr = v.targetarr.split(',')
if (targetarr.length) {
const newArr = _.filter(targetarr, v1 => v1 !== $id)
let newArr = _.filter(targetarr, v1 => v1 !== $id)
$(`#${v.id}`).attr('data-targetarr', newArr.toString())
}
})
@ -496,8 +496,7 @@ JSP.prototype.removeNodes = function ($id) {
_.map(this.JspInstance.getConnections(), v => {
connects.push({
endPointSourceId: v.sourceId,
endPointTargetId: v.targetId,
label: v._jsPlumb.overlays.label.canvas.innerText
endPointTargetId: v.targetId
})
})
// Storage line dependence
@ -512,8 +511,8 @@ JSP.prototype.removeConnect = function ($connect) {
return
}
// Remove connections and remove node and node dependencies
const targetId = $connect.targetId
const sourceId = $connect.sourceId
let targetId = $connect.targetId
let sourceId = $connect.sourceId
let targetarr = rtTargetarrArr(targetId)
if (targetarr.length) {
targetarr = _.filter(targetarr, v => v !== sourceId)

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

@ -23,7 +23,7 @@ import store from '@/conf/home/store'
* Node, to array
*/
const rtTargetarrArr = (id) => {
const ids = $(`#${id}`).attr('data-targetarr')
let ids = $(`#${id}`).attr('data-targetarr')
return ids ? ids.split(',') : []
}
@ -31,8 +31,8 @@ const rtTargetarrArr = (id) => {
* Store node id to targetarr
*/
const saveTargetarr = (valId, domId) => {
const $target = $(`#${domId}`)
const targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`
let $target = $(`#${domId}`)
let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`
$target.attr('data-targetarr', targetStr)
}
@ -66,9 +66,9 @@ const rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType, runFlag
* Get all tasks nodes
*/
const tasksAll = () => {
const a = []
let a = []
$('#canvas .w').each(function (idx, elem) {
const e = $(elem)
let e = $(elem)
a.push({
id: e.attr('id'),
name: e.find('.name-p').text(),
@ -117,10 +117,10 @@ const setSvgColor = (e, color) => {
* Get all node ids
*/
const allNodesId = () => {
const idArr = []
let idArr = []
$('.w').each((i, o) => {
const $obj = $(o)
const $span = $obj.find('.name-p').text()
let $obj = $(o)
let $span = $obj.find('.name-p').text()
if ($span) {
idArr.push({
id: $obj.attr('id'),

4
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js

@ -120,7 +120,7 @@ export default {
* object {}
*/
addTasks (state, payload) {
const i = _.findIndex(state.tasks, v => v.id === payload.id)
let i = _.findIndex(state.tasks, v => v.id === payload.id)
if (i !== -1) {
state.tasks[i] = Object.assign(state.tasks[i], {}, payload)
} else {
@ -131,7 +131,7 @@ export default {
} else {
state.cacheTasks[payload.id] = payload
}
const dom = $(`#${payload.id}`)
let dom = $(`#${payload.id}`)
state.locations[payload.id] = _.assign(state.locations[payload.id], {
name: dom.find('.name-p').text(),
targetarr: dom.attr('data-targetarr'),

Loading…
Cancel
Save