Browse Source

dag connection add check

pull/3/MERGE
break60 4 years ago
parent
commit
ba43c8c3f7
  1. 7
      dolphinscheduler-ui/build/webpack.config.prod.js
  2. 13
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
  3. 1
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js
  4. 3
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  5. 3
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

7
dolphinscheduler-ui/build/webpack.config.prod.js

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

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

@ -36,7 +36,7 @@ import {
} from './util' } from './util'
import mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start' import mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start'
const JSP = function () { let JSP = function () {
this.dag = {} this.dag = {}
this.selectedElement = {} this.selectedElement = {}
@ -687,8 +687,17 @@ JSP.prototype.saveStore = function () {
JSP.prototype.handleEvent = function () { JSP.prototype.handleEvent = function () {
this.JspInstance.bind('beforeDrop', function (info) { this.JspInstance.bind('beforeDrop', function (info) {
console.log(info)
let sourceId = info['sourceId']// 出 let sourceId = info['sourceId']// 出
let targetId = info['targetId']// 入 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 * 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 }) { JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
// Backfill nodes // Backfill nodes

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

@ -34,6 +34,7 @@ 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)
console.log(targetStr)
} }
const rtBantpl = () => { const rtBantpl = () => {

3
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -600,5 +600,6 @@ export default {
'Directory detail': 'Directory detail', 'Directory detail': 'Directory detail',
'Connection name': 'Connection name', 'Connection name': 'Connection name',
'Current connection settings': 'Current connection settings', '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'
} }

3
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -606,5 +606,6 @@ export default {
'Directory detail': '查看目录详情', 'Directory detail': '查看目录详情',
'Connection name': '连线名', 'Connection name': '连线名',
'Current connection settings': '当前连线设置', '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': '此画布异常无法进行节点连线请保存或退出当前工作流'
} }

Loading…
Cancel
Save