Browse Source

修复dag无环bug,增加监控中心路由 文件目录等

pull/2/head
gongzijian 5 years ago
parent
commit
dcd5727dee
  1. 12
      escheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
  2. 4
      escheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js
  3. 38
      escheduler-ui/src/js/conf/home/pages/dag/_source/variable/variablesView.vue

12
escheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js

@ -668,26 +668,21 @@ JSP.prototype.saveStore = function () {
/**
* Event processing
*/
JSP.prototype.handleEvent = function () {
this.JspInstance.bind('beforeDrop', function (info) {
let sourceId = info['sourceId']// 出
let targetId = info['targetId']// 入
/**
* Recursive search for nodes
*/
let recursiveVal
const recursiveTargetarr = (arr, targetId) => {
for (var i in arr) {
for (let i in arr) {
if (arr[i] === targetId) {
recursiveVal = targetId
} else {
let recTargetarrArr = rtTargetarrArr(arr[i])
if (recTargetarrArr.length) {
recursiveTargetarr(recTargetarrArr, targetId)
} else {
return recursiveTargetarr(targetId)
}
recursiveTargetarr(rtTargetarrArr(arr[i]), targetId)
}
}
return recursiveVal
@ -700,7 +695,6 @@ JSP.prototype.handleEvent = function () {
// Recursive form to find if the target Targetarr has a sourceId
if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) {
// setRecursiveVal(null)
return false
}

4
escheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js

@ -24,8 +24,8 @@ import store from '@/conf/home/store'
* Node, to array
*/
const rtTargetarrArr = (id) => {
let a = $(`#${id}`).attr('data-targetarr')
return a ? a.split(',') : []
let ids = $(`#${id}`).attr('data-targetarr')
return ids ? ids.split(',') : []
}
/**

38
escheduler-ui/src/js/conf/home/pages/dag/_source/variable/variablesView.vue

@ -4,7 +4,16 @@
<div class="list">
<div class="name"><i class="fa fa-code"></i><b style="padding-top: 3px;display: inline-block">{{$t('Global parameters')}}</b></div>
<div class="var-cont">
<x-button size="xsmall" type="ghost" v-for="(item,$index) in list.globalParams" @click="_copy('gbudp-' + $index)" :data-clipboard-text="item.prop + ' = ' +item.value" :class="'gbudp-' + $index"><b style="color: #2A455B;">{{item.prop}}</b> = {{item.value}}</x-button>
<template v-for="(item,$index) in list.globalParams">
<x-button
size="xsmall"
type="ghost"
@click="_copy('gbudp-' + $index)"
:data-clipboard-text="item.prop + ' = ' +item.value"
:class="'gbudp-' + $index">
<b style="color: #2A455B;">{{item.prop}}</b> = {{item.value}}
</x-button>
</template>
</div>
</div>
<div class="list" style="height: 30px;">
@ -15,10 +24,19 @@
</div>
<div class="list list-t" v-for="(item,key,$index) in list.localParams">
<div class="task-name">Task({{$index}}){{key}}</div>
<div class="var-cont" v-if="item.length">
<template v-for="(el,index) in item">
<x-button size="xsmall" type="ghost" @click="_copy('copy-part-' + index)" :data-clipboard-text="_rtClipboard(el)" :class="'copy-part-' + index">
<span v-for="(e,k,i) in el"><b style="color: #2A455B;">{{k}}</b> = {{e}} </span>
<div class="var-cont" v-if="item.localParamsList.length">
<template v-for="(el,index) in item.localParamsList">
<x-button size="xsmall" type="ghost" @click="_copy('copy-part-' + index)" :data-clipboard-text="_rtClipboard(el,item.taskType)" :class="'copy-part-' + index">
<span v-for="(e,k,i) in el">
<template v-if="item.taskType === 'SQL' || item.taskType === 'PROCEDURE'">
<template v-if="(k !== 'direct' && k !== 'type')">
<b style="color: #2A455B;">{{k}}</b> = {{e}}
</template>
</template>
<template v-else>
<b style="color: #2A455B;">{{k}}</b> = {{e}}
</template>
</span>
</x-button>
</template>
</div>
@ -73,10 +91,16 @@
/**
* Copyed text processing
*/
_rtClipboard (el) {
_rtClipboard (el, taskType) {
let arr = []
Object.keys(el).forEach((key) => {
arr.push(`${key}=${el[key]}`)
if (taskType === 'SQL' || taskType === 'PROCEDURE') {
if (key !== 'direct' && key !== 'type') {
arr.push(`${key}=${el[key]}`)
}
} else {
arr.push(`${key}=${el[key]}`)
}
})
return arr.join(' ')
}

Loading…
Cancel
Save