Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugFix-#3357][ui] Select the dag connection to pop up the label edit box #3358

Merged
merged 2 commits into from
Jul 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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})
}
})

Expand Down Expand Up @@ -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)
}

/**
Expand Down Expand Up @@ -623,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())
Expand Down Expand Up @@ -819,4 +828,4 @@ JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
this.draggable()
}

export default new JSP()
export default new JSP()