Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
DolphinScheduler
提交
c37f1488
DolphinScheduler
项目概览
apache
/
DolphinScheduler
上一次同步 1 年多
通知
704
Star
9572
Fork
3514
代码
文件
提交
分支
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 搜索 >>
未验证
提交
c37f1488
编写于
8月 23, 2021
作者:
M
myangle1120
提交者:
GitHub
8月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Task node of SWITCH (#5939)
上级
bf90106d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
252 addition
and
3 deletion
+252
-3
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
...scheduler-ui/src/js/conf/home/pages/dag/_source/config.js
+4
-0
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss
...nscheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss
+3
-0
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
...rc/js/conf/home/pages/dag/_source/formModel/formModel.vue
+16
-1
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/switch.vue
...js/conf/home/pages/dag/_source/formModel/tasks/switch.vue
+223
-0
dolphinscheduler-ui/src/js/conf/home/pages/dag/img/toolbar_SWITCH.png
...uler-ui/src/js/conf/home/pages/dag/img/toolbar_SWITCH.png
+0
-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
-1
未找到文件。
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
浏览文件 @
c37f1488
...
...
@@ -308,6 +308,10 @@ const tasksType = {
CONDITIONS
:
{
desc
:
'
CONDITIONS
'
,
color
:
'
#E46F13
'
},
SWITCH
:
{
desc
:
'
SWITCH
'
,
color
:
'
#E46F13
'
}
}
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss
浏览文件 @
c37f1488
...
...
@@ -113,6 +113,9 @@
.icos-CONDITIONS
{
background
:
url("../img/toolbar_CONDITIONS.png")
no-repeat
50%
50%
;
}
.icos-SWITCH
{
background
:
url("../img/toolbar_SWITCH.png")
no-repeat
50%
50%
;
}
.toolbar
{
width
:
60px
;
height
:
100%
;
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
浏览文件 @
c37f1488
...
...
@@ -95,7 +95,7 @@
</m-list-box>
<!-- Delay execution time -->
<m-list-box
v-if=
"nodeData.taskType !== 'SUB_PROCESS' && nodeData.taskType !== 'CONDITIONS' && nodeData.taskType !== 'DEPENDENT'"
>
<m-list-box
v-if=
"nodeData.taskType !== 'SUB_PROCESS' && nodeData.taskType !== 'CONDITIONS' && nodeData.taskType !== 'DEPENDENT'
&& nodeData.taskType !== 'SWITCH'
"
>
<div
slot=
"text"
>
{{$t('Delay execution time')}}
</div>
<div
slot=
"content"
>
<m-select-input
v-model=
"delayTime"
:list=
"[0,1,5,10]"
></m-select-input>
...
...
@@ -258,6 +258,13 @@
:backfill-item=
"backfillItem"
:pre-node=
"nodeData.preNode"
>
</m-conditions>
<m-switch
v-if=
"nodeData.taskType === 'SWITCH'"
ref=
"SWITCH"
@
on-switch-result=
"_onSwitchResult"
:backfill-item=
"backfillItem"
:nodeData=
"nodeData"
></m-switch>
<!-- Pre-tasks in workflow -->
<m-pre-tasks
v-if=
"['SHELL', 'SUB_PROCESS'].indexOf(nodeData.taskType) > -1"
...
...
@@ -293,6 +300,7 @@
import
mHttp
from
'
./tasks/http
'
import
mDatax
from
'
./tasks/datax
'
import
mConditions
from
'
./tasks/conditions
'
import
mSwitch
from
'
./tasks/switch.vue
'
import
mSqoop
from
'
./tasks/sqoop
'
import
mSubProcess
from
'
./tasks/sub_process
'
import
mSelectInput
from
'
./_source/selectInput
'
...
...
@@ -328,6 +336,7 @@
successNode
:
[],
failedNode
:
[]
},
switchResult
:
{},
// dependence
dependence
:
{},
// cache dependence
...
...
@@ -386,6 +395,9 @@
_onDependent
(
o
)
{
this
.
dependence
=
Object
.
assign
(
this
.
dependence
,
{},
o
)
},
_onSwitchResult
(
o
)
{
this
.
switchResult
=
o
},
/**
* Pre-tasks in workflow
*/
...
...
@@ -480,6 +492,7 @@
desc
:
this
.
desc
,
runFlag
:
this
.
runFlag
,
conditionResult
:
this
.
conditionResult
,
switchResult
:
this
.
switchResult
,
dependence
:
this
.
cacheDependence
,
maxRetryTimes
:
this
.
maxRetryTimes
,
retryInterval
:
this
.
retryInterval
,
...
...
@@ -604,6 +617,7 @@
desc
:
this
.
desc
,
runFlag
:
this
.
runFlag
,
conditionResult
:
this
.
conditionResult
,
switchResult
:
this
.
switchResult
,
dependence
:
this
.
dependence
,
maxRetryTimes
:
this
.
maxRetryTimes
,
retryInterval
:
this
.
retryInterval
,
...
...
@@ -801,6 +815,7 @@
mDatax
,
mSqoop
,
mConditions
,
mSwitch
,
mSelectInput
,
mTimeoutAlarm
,
mDependentTimeout
,
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/switch.vue
0 → 100644
浏览文件 @
c37f1488
/*
* 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=
"conditions-model"
>
<m-list-box>
<div
slot=
"text"
>
{{
$t
(
'
condition
'
)
}}
</div>
<div
slot=
"content"
>
<div
class=
"dep-opt"
>
<a
href=
"javascript:"
@
click=
"!isDetails && _addDep()"
class=
"add-dep"
>
<em
v-if=
"!isLoading"
class=
"el-icon-circle-plus-outline"
:class=
"_isDetails"
data-toggle=
"tooltip"
:title=
"$t('Add')"
></em>
<em
v-if=
"isLoading"
class=
"el-icon-loading as as-spin"
data-toggle=
"tooltip"
:title=
"$t('Add')"
></em>
</a>
</div>
<div
class=
"dep-list-model"
>
<div
v-for=
"(el,index) in dependItemList"
:key=
'index'
class=
"switch-list"
>
<label
style=
"display:block"
>
<textarea
:id=
"`code-switch-mirror$
{index}`" :name="`code-switch-mirror${index}`" style="opacity: 0;">
</textarea>
</label>
<span
class=
"text-b"
style=
"padding-left: 0"
>
{{
$t
(
'
Branch flow
'
)
}}
</span>
<el-select
style=
"width: 157px;"
size=
"small"
v-model=
"el.nextNode"
clearable
>
<el-option
v-for=
"item in nodeData.rearList"
:key=
"item.value"
:value=
"item.value"
:label=
"item.label"
></el-option>
</el-select>
<span
class=
"operation"
>
<a
href=
"javascript:"
class=
"delete"
@
click=
"!isDetails && _removeDep(index)"
v-if=
"index === (dependItemList.length - 1)"
>
<em
class=
"iconfont el-icon-delete"
:class=
"_isDetails"
data-toggle=
"tooltip"
data-container=
"body"
:title=
"$t('Delete')"
></em>
</a>
<a
href=
"javascript:"
class=
"add"
@
click=
"!isDetails && _addDep()"
v-if=
"index === (dependItemList.length - 1)"
>
<em
class=
"iconfont el-icon-circle-plus-outline"
:class=
"_isDetails"
data-toggle=
"tooltip"
data-container=
"body"
:title=
"$t('Add')"
></em>
</a>
</span>
</div>
</div>
</div>
</m-list-box>
<m-list-box>
<div
slot=
"text"
>
{{
$t
(
'
Branch flow
'
)
}}
</div>
<div
slot=
"content"
>
<el-select
style=
"width: 157px;"
size=
"small"
v-model=
"nextNode"
clearable
:disabled=
"isDetails"
>
<el-option
v-for=
"item in nodeData.rearList"
:key=
"item.value"
:value=
"item.value"
:label=
"item.label"
></el-option>
</el-select>
</div>
</m-list-box>
</div>
</
template
>
<
script
>
import
_
from
'
lodash
'
import
mListBox
from
'
./_source/listBox
'
import
disabledState
from
'
@/module/mixin/disabledState
'
import
codemirror
from
'
@/conf/home/pages/resource/pages/file/pages/_source/codemirror
'
let
editArray
=
[]
export
default
{
name
:
'
dependence
'
,
data
()
{
return
{
nextNode
:
''
,
relation
:
'
AND
'
,
dependItemList
:
[],
editArray
:
[],
isLoading
:
false
,
oldList
:
[]
}
},
mixins
:
[
disabledState
],
props
:
{
nodeData
:
Object
,
backfillItem
:
Object
,
rearList
:
Array
},
methods
:
{
editList
(
index
)
{
// editor
const
self
=
this
const
editor
=
codemirror
(
`code-switch-mirror
${
index
}
`
,
{
mode
:
'
shell
'
,
readOnly
:
this
.
isInstance
},
this
)
editor
.
on
(
'
change
'
,
function
()
{
const
outputList
=
_
.
cloneDeep
(
self
.
dependItemList
)
outputList
[
index
].
condition
=
editor
.
getValue
()
self
.
dependItemList
=
outputList
})
this
.
keypress
=
()
=>
{
if
(
!
editor
.
getOption
(
'
readOnly
'
))
{
editor
.
showHint
({
completeSingle
:
false
})
}
}
editor
.
on
(
'
keypress
'
,
this
.
keypress
)
editor
.
setValue
(
this
.
dependItemList
[
index
].
condition
||
''
)
editor
.
setSize
(
'
580px
'
,
'
60px
'
)
editArray
.
push
(
editor
)
this
.
oldList
=
_
.
cloneDeep
(
this
.
dependItemList
)
return
editArray
},
_addDep
()
{
if
(
!
this
.
isLoading
)
{
this
.
isLoading
=
true
this
.
dependItemList
.
push
({
condition
:
''
,
nextNode
:
''
})
let
dependItemListLen
=
this
.
dependItemList
.
length
if
(
dependItemListLen
>
0
)
{
setTimeout
(()
=>
{
this
.
editList
(
dependItemListLen
-
1
)
this
.
isLoading
=
false
},
200
)
}
this
.
_removeTip
()
}
},
_removeDep
(
i
)
{
this
.
dependItemList
.
splice
(
i
,
1
)
this
.
_removeTip
()
},
_removeTip
()
{
$
(
'
body
'
).
find
(
'
.tooltip.fade.top.in
'
).
remove
()
},
_verification
()
{
let
flag
=
this
.
dependItemList
.
some
((
item
)
=>
{
return
!
item
.
condition
})
if
(
flag
)
{
this
.
$message
.
warning
(
`
${
this
.
$t
(
'
The condition content cannot be empty
'
)}
`
)
return
false
}
let
params
=
{
dependTaskList
:
this
.
dependItemList
||
[],
nextNode
:
this
.
nextNode
||
''
}
this
.
$emit
(
'
on-switch-result
'
,
params
)
return
true
}
},
watch
:
{},
beforeCreate
()
{
},
created
()
{
const
o
=
this
.
backfillItem
if
(
!
_
.
isEmpty
(
o
))
{
let
switchResult
=
o
.
switchResult
||
{}
this
.
dependItemList
=
_
.
cloneDeep
(
switchResult
.
dependTaskList
)
||
[]
this
.
nextNode
=
_
.
cloneDeep
(
switchResult
.
nextNode
)
||
''
}
},
mounted
()
{
if
(
this
.
dependItemList
&&
this
.
dependItemList
.
length
>
0
)
{
setTimeout
(()
=>
{
this
.
dependItemList
.
forEach
((
item
,
index
)
=>
{
this
.
editList
(
index
)
})
})
}
},
destroyed
()
{
},
computed
:
{
},
components
:
{
mListBox
}
}
</
script
>
<
style
lang=
"scss"
rel=
"stylesheet/scss"
>
.conditions-model
{
margin-top
:
-10px
;
.dep-opt
{
margin-bottom
:
10px
;
padding-top
:
3px
;
line-height
:
24px
;
.add-dep
{
color
:
#0097e0
;
margin-right
:
10px
;
i
{
font-size
:
18px
;
vertical-align
:
middle
;
}
}
}
.dep-list-model
{
position
:
relative
;
min-height
:
0px
;
.switch-list
{
margin-bottom
:
6px
;
.operation
{
padding-left
:
4px
;
a
{
i
{
font-size
:
18px
;
vertical-align
:
middle
;
}
}
.delete
{
color
:
#ff0000
;
}
.add
{
color
:
#0097e0
;
}
}
}
}
}
</
style
>
dolphinscheduler-ui/src/js/conf/home/pages/dag/img/toolbar_SWITCH.png
0 → 100644
浏览文件 @
c37f1488
2.9 KB
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
浏览文件 @
c37f1488
...
...
@@ -695,5 +695,7 @@ export default {
'
The workflow canvas is abnormal and cannot be saved, please recreate
'
:
'
The workflow canvas is abnormal and cannot be saved, please recreate
'
,
Info
:
'
Info
'
,
'
Datasource userName
'
:
'
owner
'
,
'
Resource userName
'
:
'
owner
'
'
Resource userName
'
:
'
owner
'
,
condition
:
'
condition
'
,
'
The condition content cannot be empty
'
:
'
The condition content cannot be empty
'
}
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
浏览文件 @
c37f1488
...
...
@@ -694,5 +694,7 @@ export default {
'
The workflow canvas is abnormal and cannot be saved, please recreate
'
:
'
该工作流画布异常,无法保存,请重新创建
'
,
Info
:
'
提示
'
,
'
Datasource userName
'
:
'
所属用户
'
,
'
Resource userName
'
:
'
所属用户
'
'
Resource userName
'
:
'
所属用户
'
,
condition
:
'
条件
'
,
'
The condition content cannot be empty
'
:
'
条件内容不能为空
'
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录