Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老大叔也想要天天的爱情
DolphinScheduler
提交
a5c85cb0
DolphinScheduler
项目概览
老大叔也想要天天的爱情
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a5c85cb0
编写于
7月 16, 2020
作者:
B
break60
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Click DAG connection to add label function
上级
a7aa58e6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
223 addition
and
18 deletion
+223
-18
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
...inscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
+50
-7
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formLineModel.vue
...s/conf/home/pages/dag/_source/formModel/formLineModel.vue
+120
-0
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
...rc/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
+39
-8
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
+8
-0
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+3
-1
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+3
-2
未找到文件。
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
浏览文件 @
a5c85cb0
...
@@ -142,6 +142,7 @@
...
@@ -142,6 +142,7 @@
import
{
allNodesId
}
from
'
./plugIn/util
'
import
{
allNodesId
}
from
'
./plugIn/util
'
import
{
toolOper
,
tasksType
}
from
'
./config
'
import
{
toolOper
,
tasksType
}
from
'
./config
'
import
mFormModel
from
'
./formModel/formModel
'
import
mFormModel
from
'
./formModel/formModel
'
import
mFormLineModel
from
'
./formModel/formLineModel
'
import
{
formatDate
}
from
'
@/module/filter/filter
'
import
{
formatDate
}
from
'
@/module/filter/filter
'
import
{
findComponentDownward
}
from
'
@/module/util/
'
import
{
findComponentDownward
}
from
'
@/module/util/
'
import
disabledState
from
'
@/module/mixin/disabledState
'
import
disabledState
from
'
@/module/mixin/disabledState
'
...
@@ -176,7 +177,7 @@
...
@@ -176,7 +177,7 @@
},
},
methods
:
{
methods
:
{
...
mapActions
(
'
dag
'
,
[
'
saveDAGchart
'
,
'
updateInstance
'
,
'
updateDefinition
'
,
'
getTaskState
'
]),
...
mapActions
(
'
dag
'
,
[
'
saveDAGchart
'
,
'
updateInstance
'
,
'
updateDefinition
'
,
'
getTaskState
'
]),
...
mapMutations
(
'
dag
'
,
[
'
addTasks
'
,
'
cacheTasks
'
,
'
resetParams
'
,
'
setIsEditDag
'
,
'
setName
'
]),
...
mapMutations
(
'
dag
'
,
[
'
addTasks
'
,
'
cacheTasks
'
,
'
resetParams
'
,
'
setIsEditDag
'
,
'
setName
'
,
'
addConnects
'
]),
// DAG automatic layout
// DAG automatic layout
dagAutomaticLayout
()
{
dagAutomaticLayout
()
{
...
@@ -201,9 +202,14 @@
...
@@ -201,9 +202,14 @@
length
:
12
,
length
:
12
,
foldback
:
0.8
foldback
:
0.8
}
}
]
],
[
'
Label
'
,
{
location
:
0.5
,
id
:
'
label
'
}]
],
],
Container
:
'
canvas
'
Container
:
'
canvas
'
,
ConnectionsDetachable
:
true
})
})
})
})
if
(
this
.
tasks
.
length
)
{
if
(
this
.
tasks
.
length
)
{
...
@@ -517,8 +523,42 @@
...
@@ -517,8 +523,42 @@
* Create a node popup layer
* Create a node popup layer
* @param Object id
* @param Object id
*/
*/
_createLineLabel
({
id
,
sourceId
,
targetId
})
{
// $('#jsPlumb_2_50').text('111')
let
self
=
this
self
.
$modal
.
destroy
()
const
removeNodesEvent
=
(
fromThis
)
=>
{
// Manually destroy events inside the component
fromThis
.
$destroy
()
// Close the popup
eventModel
.
remove
()
}
eventModel
=
this
.
$drawer
({
render
(
h
)
{
return
h
(
mFormLineModel
,{
on
:
{
addLineInfo
({
item
,
fromThis
})
{
self
.
addConnects
(
item
)
setTimeout
(()
=>
{
removeNodesEvent
(
fromThis
)
},
100
)
},
cancel
({
fromThis
})
{
removeNodesEvent
(
fromThis
)
}
},
props
:
{
id
:
id
,
sourceId
:
sourceId
,
targetId
:
targetId
}
})
}
})
},
_createNodes
({
id
,
type
})
{
_createNodes
({
id
,
type
})
{
let
self
=
this
let
self
=
this
self
.
$modal
.
destroy
()
let
preNode
=
[]
let
preNode
=
[]
let
rearNode
=
[]
let
rearNode
=
[]
let
rearList
=
[]
let
rearList
=
[]
...
@@ -649,9 +689,14 @@
...
@@ -649,9 +689,14 @@
length
:
12
,
length
:
12
,
foldback
:
0.8
foldback
:
0.8
}
}
]
],
[
'
Label
'
,
{
location
:
0.5
,
id
:
'
label
'
}]
],
],
Container
:
'
canvas
'
Container
:
'
canvas
'
,
ConnectionsDetachable
:
true
})
})
})
})
},
},
...
@@ -679,5 +724,3 @@
...
@@ -679,5 +724,3 @@
<
style
lang=
"scss"
rel=
"stylesheet/scss"
>
<
style
lang=
"scss"
rel=
"stylesheet/scss"
>
@import
"./dag"
;
@import
"./dag"
;
</
style
>
</
style
>
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formLineModel.vue
0 → 100644
浏览文件 @
a5c85cb0
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
<
template
>
<div
class=
"form-model-model"
v-clickoutside=
"_handleClose"
>
<div
class=
"title-box"
>
<span
class=
"name"
>
{{
$t
(
'
Current connection settings
'
)
}}
</span>
</div>
<div
class=
"content-box"
>
<div
class=
"from-model"
>
<!-- Node name -->
<div
class=
"clearfix list"
>
<div
class=
"text-box"
><span>
{{
$t
(
'
Connection name
'
)
}}
</span></div>
<div
class=
"cont-box"
>
<label
class=
"label-box"
>
<x-input
type=
"text"
v-model=
"labelName"
:disabled=
"isDetails"
:placeholder=
"$t('Please enter name')"
maxlength=
"100"
autocomplete=
"off"
>
</x-input>
</label>
</div>
</div>
</div>
</div>
<div
class=
"bottom-box"
>
<div
class=
"submit"
style=
"background: #fff;"
>
<x-button
type=
"text"
@
click=
"cancel()"
>
{{
$t
(
'
Cancel
'
)
}}
</x-button>
<x-button
type=
"primary"
shape=
"circle"
:loading=
"spinnerLoading"
@
click=
"ok()"
:disabled=
"isDetails"
>
{{
spinnerLoading
?
'
Loading...
'
:
$t
(
'
Confirm add
'
)
}}
</x-button>
</div>
</div>
</div>
</
template
>
<
script
>
import
_
from
'
lodash
'
import
{
mapActions
}
from
'
vuex
'
import
i18n
from
'
@/module/i18n
'
import
JSP
from
'
./../plugIn/jsPlumbHandle
'
import
disabledState
from
'
@/module/mixin/disabledState
'
export
default
{
name
:
'
form-line-model
'
,
data
()
{
return
{
// loading
spinnerLoading
:
false
,
// node name
labelName
:
''
,
}
},
mixins
:
[
disabledState
],
props
:
{
id
:
String
,
sourceId
:
String
,
targetId
:
String
},
methods
:
{
cancel
()
{
this
.
$emit
(
'
cancel
'
,
{
fromThis
:
this
})
},
ok
()
{
$
(
`#
${
this
.
id
}
`
).
text
(
this
.
labelName
)
this
.
$emit
(
'
addLineInfo
'
,
{
item
:
{
labelName
:
this
.
labelName
,
sourceId
:
this
.
sourceId
,
targetId
:
this
.
targetId
},
fromThis
:
this
})
}
},
watch
:
{
},
created
()
{
let
connects
=
this
.
store
.
state
.
dag
.
connects
connects
.
filter
(
item
=>
{
if
(
item
.
endPointSourceId
===
this
.
sourceId
&&
item
.
endPointTargetId
===
this
.
targetId
)
{
this
.
labelName
=
item
.
label
}
});
},
mounted
()
{
},
updated
()
{
},
beforeDestroy
()
{
},
destroyed
()
{
},
computed
:
{
},
components
:
{}
}
</
script
>
<
style
lang=
"scss"
rel=
"stylesheet/scss"
>
</
style
>
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
浏览文件 @
a5c85cb0
...
@@ -84,6 +84,10 @@ JSP.prototype.init = function ({ dag, instance, options }) {
...
@@ -84,6 +84,10 @@ JSP.prototype.init = function ({ dag, instance, options }) {
// Monitor line click
// Monitor line click
this
.
JspInstance
.
bind
(
'
click
'
,
e
=>
{
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
)
{
if
(
this
.
config
.
isClick
)
{
this
.
connectClick
(
e
)
this
.
connectClick
(
e
)
}
}
...
@@ -645,14 +649,39 @@ JSP.prototype.saveStore = function () {
...
@@ -645,14 +649,39 @@ JSP.prototype.saveStore = function () {
tasks
.
push
(
tasksParam
)
tasks
.
push
(
tasksParam
)
}
}
})
})
if
(
store
.
state
.
dag
.
connects
.
length
===
this
.
JspInstance
.
getConnections
().
length
)
{
_
.
map
(
this
.
JspInstance
.
getConnections
(),
v
=>
{
_
.
map
(
store
.
state
.
dag
.
connects
,
u
=>
{
connects
.
push
({
connects
.
push
({
endPointSourceId
:
v
.
sourceId
,
endPointSourceId
:
u
.
endPointSourceId
,
endPointTargetId
:
v
.
targetId
endPointTargetId
:
u
.
endPointTargetId
,
label
:
u
.
label
})
})
})
})
}
else
if
(
store
.
state
.
dag
.
connects
.
length
>
0
&&
store
.
state
.
dag
.
connects
.
length
<
this
.
JspInstance
.
getConnections
().
length
)
{
_
.
map
(
this
.
JspInstance
.
getConnections
(),
v
=>
{
connects
.
push
({
endPointSourceId
:
v
.
sourceId
,
endPointTargetId
:
v
.
targetId
,
label
:
v
.
_jsPlumb
.
overlays
.
label
.
canvas
.
innerText
})
})
_
.
map
(
store
.
state
.
dag
.
connects
,
u
=>
{
_
.
map
(
connects
,
v
=>
{
if
(
u
.
label
&&
u
.
endPointSourceId
===
v
.
endPointSourceId
&&
u
.
endPointTargetId
===
v
.
endPointTargetId
)
{
v
.
label
=
u
.
label
}
})
})
}
else
if
(
store
.
state
.
dag
.
connects
.
length
===
0
)
{
_
.
map
(
this
.
JspInstance
.
getConnections
(),
v
=>
{
connects
.
push
({
endPointSourceId
:
v
.
sourceId
,
endPointTargetId
:
v
.
targetId
,
label
:
v
.
_jsPlumb
.
overlays
.
label
.
canvas
.
innerText
})
})
}
_
.
map
(
tasksAll
(),
v
=>
{
_
.
map
(
tasksAll
(),
v
=>
{
locations
[
v
.
id
]
=
{
locations
[
v
.
id
]
=
{
name
:
v
.
name
,
name
:
v
.
name
,
...
@@ -745,6 +774,7 @@ JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
...
@@ -745,6 +774,7 @@ JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
_
.
map
(
connects
,
v
=>
{
_
.
map
(
connects
,
v
=>
{
let
sourceId
=
v
.
endPointSourceId
.
split
(
'
-
'
)
let
sourceId
=
v
.
endPointSourceId
.
split
(
'
-
'
)
let
targetId
=
v
.
endPointTargetId
.
split
(
'
-
'
)
let
targetId
=
v
.
endPointTargetId
.
split
(
'
-
'
)
let
labels
=
v
.
label
if
(
sourceId
.
length
===
4
&&
targetId
.
length
===
4
)
{
if
(
sourceId
.
length
===
4
&&
targetId
.
length
===
4
)
{
sourceId
=
`
${
sourceId
[
0
]}
-
${
sourceId
[
1
]}
-
${
sourceId
[
2
]}
`
sourceId
=
`
${
sourceId
[
0
]}
-
${
sourceId
[
1
]}
-
${
sourceId
[
2
]}
`
targetId
=
`
${
targetId
[
0
]}
-
${
targetId
[
1
]}
-
${
targetId
[
2
]}
`
targetId
=
`
${
targetId
[
0
]}
-
${
targetId
[
1
]}
-
${
targetId
[
2
]}
`
...
@@ -777,7 +807,8 @@ JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
...
@@ -777,7 +807,8 @@ JSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {
target
:
targetId
,
target
:
targetId
,
type
:
'
basic
'
,
type
:
'
basic
'
,
paintStyle
:
{
strokeWidth
:
2
,
stroke
:
'
#2d8cf0
'
},
paintStyle
:
{
strokeWidth
:
2
,
stroke
:
'
#2d8cf0
'
},
HoverPaintStyle
:
{
stroke
:
'
#ccc
'
,
strokeWidth
:
3
}
HoverPaintStyle
:
{
stroke
:
'
#ccc
'
,
strokeWidth
:
3
},
overlays
:[[
"
Label
"
,
{
label
:
labels
}
]]
})
})
}
}
})
})
...
...
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
浏览文件 @
a5c85cb0
...
@@ -140,6 +140,14 @@ export default {
...
@@ -140,6 +140,14 @@ export default {
y
:
parseInt
(
dom
.
css
(
'
top
'
),
10
)
y
:
parseInt
(
dom
.
css
(
'
top
'
),
10
)
})
})
},
},
addConnects
(
state
,
payload
)
{
state
.
connects
=
_
.
map
(
state
.
connects
,
v
=>
{
if
(
v
.
endPointSourceId
===
payload
.
sourceId
&&
v
.
endPointTargetId
===
payload
.
targetId
)
{
v
.
label
=
payload
.
labelName
}
return
v
})
},
/**
/**
* Cache the input
* Cache the input
* @param state
* @param state
...
...
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
浏览文件 @
a5c85cb0
...
@@ -618,5 +618,7 @@ export default {
...
@@ -618,5 +618,7 @@ export default {
'
Please confirm whether the workflow has been saved before downloading
'
:
'
Please confirm whether the workflow has been saved before downloading
'
,
'
Please confirm whether the workflow has been saved before downloading
'
:
'
Please confirm whether the workflow has been saved before downloading
'
,
'
User name length is between 3 and 39
'
:
'
User name length is between 3 and 39
'
,
'
User name length is between 3 and 39
'
:
'
User name length is between 3 and 39
'
,
zkDirectory
:
'
zkDirectory
'
,
zkDirectory
:
'
zkDirectory
'
,
'
Directory detail
'
:
'
Directory detail
'
'
Directory detail
'
:
'
Directory detail
'
,
'
Connection name
'
:
'
Connection name
'
,
'
Current connection settings
'
:
'
Current connection settings
'
}
}
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
浏览文件 @
a5c85cb0
...
@@ -47,7 +47,6 @@ export default {
...
@@ -47,7 +47,6 @@ export default {
'
Confirm add
'
:
'
确认添加
'
,
'
Confirm add
'
:
'
确认添加
'
,
'
The newly created sub-Process has not yet been executed and cannot enter the sub-Process
'
:
'
新创建子工作流还未执行,不能进入子工作流
'
,
'
The newly created sub-Process has not yet been executed and cannot enter the sub-Process
'
:
'
新创建子工作流还未执行,不能进入子工作流
'
,
'
The task has not been executed and cannot enter the sub-Process
'
:
'
该任务还未执行,不能进入子工作流
'
,
'
The task has not been executed and cannot enter the sub-Process
'
:
'
该任务还未执行,不能进入子工作流
'
,
'
Please enter name (required)
'
:
'
请输入名称(必填)
'
,
'
Name already exists
'
:
'
名称已存在请重新输入
'
,
'
Name already exists
'
:
'
名称已存在请重新输入
'
,
'
Download Log
'
:
'
下载日志
'
,
'
Download Log
'
:
'
下载日志
'
,
'
Refresh Log
'
:
'
刷新日志
'
,
'
Refresh Log
'
:
'
刷新日志
'
,
...
@@ -618,5 +617,7 @@ export default {
...
@@ -618,5 +617,7 @@ export default {
'
Socket Timeout be a positive integer
'
:
'
Socket超时必须为数字
'
,
'
Socket Timeout be a positive integer
'
:
'
Socket超时必须为数字
'
,
'
ms
'
:
'
毫秒
'
,
'
ms
'
:
'
毫秒
'
,
zkDirectory
:
'
zk注册目录
'
,
zkDirectory
:
'
zk注册目录
'
,
'
Directory detail
'
:
'
查看目录详情
'
'
Directory detail
'
:
'
查看目录详情
'
,
'
Connection name
'
:
'
连线名
'
,
'
Current connection settings
'
:
'
当前连线设置
'
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录