dag connection add check

This commit is contained in:
break60 2020-08-10 14:24:08 +08:00
parent 19fb2fdd9c
commit ba43c8c3f7
5 changed files with 17 additions and 10 deletions

View File

@ -51,12 +51,7 @@ const config = merge.smart(baseConfig, {
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
warnings: false,
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']
}
compress: {}
},
cache: true,
parallel: true,

View File

@ -36,7 +36,7 @@ import {
} from './util'
import mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start'
const JSP = function () {
let JSP = function () {
this.dag = {}
this.selectedElement = {}
@ -687,8 +687,17 @@ JSP.prototype.saveStore = function () {
JSP.prototype.handleEvent = function () {
this.JspInstance.bind('beforeDrop', function (info) {
console.log(info)
let sourceId = info['sourceId']//
let targetId = info['targetId']//
console.log(sourceId,targetId)
/**
* When connecting, connection is prohibited when the sourceId and target nodes are empty
*/
if(!sourceId && !targetId) {
Vue.$message.warning(`${i18n.$t('This canvas is abnormal and the node connection cannot be made. Please save or exit the current workflow')}`)
return false
}
/**
* Recursive search for nodes
*/
@ -730,7 +739,7 @@ JSP.prototype.handleEvent = function () {
})
}
/**
* Backfill data processing
* Backfill data processingJSP
*/
JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
// Backfill nodes

View File

@ -34,6 +34,7 @@ const saveTargetarr = (valId, domId) => {
let $target = $(`#${domId}`)
let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`;
$target.attr('data-targetarr', targetStr)
console.log(targetStr)
}
const rtBantpl = () => {

View File

@ -600,5 +600,6 @@ export default {
'Directory detail': 'Directory detail',
'Connection name': 'Connection name',
'Current connection settings': 'Current connection settings',
'Please save the DAG before formatting': 'Please save the DAG before formatting'
'Please save the DAG before formatting': 'Please save the DAG before formatting',
'This canvas is abnormal and the node connection cannot be made. Please save or exit the current workflow': 'This canvas is abnormal and the node connection cannot be made. Please save or exit the current workflow'
}

View File

@ -606,5 +606,6 @@ export default {
'Directory detail': '查看目录详情',
'Connection name': '连线名',
'Current connection settings': '当前连线设置',
'Please save the DAG before formatting': '格式化前请先保存DAG'
'Please save the DAG before formatting': '格式化前请先保存DAG',
'This canvas is abnormal and the node connection cannot be made. Please save or exit the current workflow': '此画布异常无法进行节点连线请保存或退出当前工作流'
}