Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
DolphinScheduler
提交
0141aa51
DolphinScheduler
项目概览
apache
/
DolphinScheduler
上一次同步 1 年多
通知
705
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 搜索 >>
未验证
提交
0141aa51
编写于
8月 01, 2022
作者:
A
Amy0104
提交者:
GitHub
8月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Fix][UI] Fix datax task data instance replay error. (#11222)
上级
8e21c38c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
190 deletion
+32
-190
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasource.ts
...ws/projects/task/components/node/fields/use-datasource.ts
+20
-15
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datax.ts
...c/views/projects/task/components/node/fields/use-datax.ts
+11
-174
dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts
...er-ui/src/views/projects/workflow/definition/use-table.ts
+1
-1
未找到文件。
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasource.ts
浏览文件 @
0141aa51
...
...
@@ -15,7 +15,7 @@
* limitations under the License.
*/
import
{
ref
,
onMounted
,
nextTick
}
from
'
vue
'
import
{
ref
,
onMounted
,
nextTick
,
Ref
}
from
'
vue
'
import
{
useI18n
}
from
'
vue-i18n
'
import
{
queryDataSourceList
}
from
'
@/service/modules/data-source
'
import
{
indexOf
,
find
}
from
'
lodash
'
...
...
@@ -24,8 +24,12 @@ import type { TypeReq } from '@/service/modules/data-source/types'
export
function
useDatasource
(
model
:
{
[
field
:
string
]:
any
},
supportedDatasourceType
?:
string
[],
field
?:
string
params
:
{
supportedDatasourceType
?:
string
[]
typeField
?:
string
sourceField
?:
string
span
?:
Ref
|
number
}
=
{}
):
IJsonItem
[]
{
const
{
t
}
=
useI18n
()
...
...
@@ -91,8 +95,8 @@ export function useDatasource(
if
(
item
.
disabled
)
{
return
false
}
if
(
supportedDatasourceType
)
{
return
indexOf
(
supportedDatasourceType
,
item
.
code
)
!==
-
1
if
(
params
.
supportedDatasourceType
)
{
return
indexOf
(
params
.
supportedDatasourceType
,
item
.
code
)
!==
-
1
}
return
true
})
...
...
@@ -100,17 +104,18 @@ export function useDatasource(
}
const
refreshOptions
=
async
()
=>
{
const
param
s
=
{
type
:
model
.
type
}
as
TypeReq
const
res
=
await
queryDataSourceList
(
params
)
const
param
eters
=
{
type
:
model
[
params
.
typeField
||
'
type
'
]
}
as
TypeReq
const
res
=
await
queryDataSourceList
(
param
eter
s
)
datasourceOptions
.
value
=
res
.
map
((
item
:
any
)
=>
({
label
:
item
.
name
,
value
:
item
.
id
}))
if
(
!
res
.
length
&&
model
.
datasource
)
model
.
datasource
=
null
if
(
res
.
length
&&
model
.
datasource
)
{
const
item
=
find
(
res
,
{
id
:
model
.
datasource
})
const
sourceField
=
params
.
sourceField
||
'
datasource
'
if
(
!
res
.
length
&&
model
[
sourceField
])
model
[
sourceField
]
=
null
if
(
res
.
length
&&
model
[
sourceField
])
{
const
item
=
find
(
res
,
{
id
:
model
[
sourceField
]
})
if
(
!
item
)
{
model
.
datasource
=
null
model
[
sourceField
]
=
null
}
}
}
...
...
@@ -127,8 +132,8 @@ export function useDatasource(
return
[
{
type
:
'
select
'
,
field
:
field
?
field
:
'
type
'
,
span
:
12
,
field
:
params
.
typeField
||
'
type
'
,
span
:
params
.
span
||
12
,
name
:
t
(
'
project.node.datasource_type
'
),
props
:
{
'
on-update:value
'
:
onChange
...
...
@@ -141,8 +146,8 @@ export function useDatasource(
},
{
type
:
'
select
'
,
field
:
f
ield
||
'
datasource
'
,
span
:
12
,
field
:
params
.
sourceF
ield
||
'
datasource
'
,
span
:
params
.
span
||
12
,
name
:
t
(
'
project.node.datasource_instances
'
),
options
:
datasourceOptions
,
validate
:
{
...
...
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datax.ts
浏览文件 @
0141aa51
...
...
@@ -16,65 +16,11 @@
*/
import
{
ref
,
onMounted
,
watch
}
from
'
vue
'
import
{
useI18n
}
from
'
vue-i18n
'
import
{
useCustomParams
,
useDatasource
}
from
'
.
'
import
type
{
IJsonItem
}
from
'
../types
'
import
{
find
}
from
'
lodash
'
import
{
TypeReq
}
from
'
@/service/modules/data-source/types
'
import
{
queryDataSourceList
}
from
'
@/service/modules/data-source
'
import
{
useCustomParams
}
from
"
.
"
export
function
useDataX
(
model
:
{
[
field
:
string
]:
any
}):
IJsonItem
[]
{
const
{
t
}
=
useI18n
()
const
datasourceTypes
=
[
{
id
:
0
,
code
:
'
MYSQL
'
,
disabled
:
false
},
{
id
:
1
,
code
:
'
POSTGRESQL
'
,
disabled
:
false
},
{
id
:
2
,
code
:
'
HIVE
'
,
disabled
:
true
},
{
id
:
3
,
code
:
'
SPARK
'
,
disabled
:
true
},
{
id
:
4
,
code
:
'
CLICKHOUSE
'
,
disabled
:
false
},
{
id
:
5
,
code
:
'
ORACLE
'
,
disabled
:
false
},
{
id
:
6
,
code
:
'
SQLSERVER
'
,
disabled
:
false
},
{
id
:
7
,
code
:
'
DB2
'
,
disabled
:
true
},
{
id
:
8
,
code
:
'
PRESTO
'
,
disabled
:
true
}
]
const
datasourceTypeOptions
=
ref
([]
as
any
)
const
datasourceOptions
=
ref
([]
as
any
)
const
destinationDatasourceOptions
=
ref
([]
as
any
)
const
jobSpeedByteOptions
:
any
[]
=
[
{
label
:
`0(
${
t
(
'
project.node.unlimited
'
)}
)`
,
...
...
@@ -149,53 +95,6 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
value
:
4
}
]
const
loading
=
ref
(
false
)
const
getDatasourceTypes
=
async
()
=>
{
if
(
loading
.
value
)
return
loading
.
value
=
true
datasourceTypeOptions
.
value
=
datasourceTypes
.
filter
((
item
)
=>
!
item
.
disabled
)
.
map
((
item
)
=>
({
label
:
item
.
code
,
value
:
item
.
code
}))
loading
.
value
=
false
}
const
getDatasourceInstances
=
async
()
=>
{
const
params
=
{
type
:
model
.
dsType
}
as
TypeReq
const
res
=
await
queryDataSourceList
(
params
)
datasourceOptions
.
value
=
[]
res
.
map
((
item
:
any
)
=>
{
datasourceOptions
.
value
.
push
({
label
:
item
.
name
,
value
:
String
(
item
.
id
)
})
})
if
(
datasourceOptions
.
value
&&
model
.
dataSource
)
{
const
item
=
find
(
datasourceOptions
.
value
,
{
value
:
String
(
model
.
dataSource
)
})
if
(
!
item
)
{
model
.
dataSource
=
null
}
}
}
const
getDestinationDatasourceInstances
=
async
()
=>
{
const
params
=
{
type
:
model
.
dtType
}
as
TypeReq
const
res
=
await
queryDataSourceList
(
params
)
destinationDatasourceOptions
.
value
=
[]
res
.
map
((
item
:
any
)
=>
{
destinationDatasourceOptions
.
value
.
push
({
label
:
item
.
name
,
value
:
String
(
item
.
id
)
})
})
if
(
destinationDatasourceOptions
.
value
&&
model
.
dataTarget
)
{
const
item
=
find
(
destinationDatasourceOptions
.
value
,
{
value
:
String
(
model
.
dataTarget
)
})
if
(
!
item
)
{
model
.
dataTarget
=
null
}
}
}
const
sqlEditorSpan
=
ref
(
24
)
const
jsonEditorSpan
=
ref
(
0
)
...
...
@@ -226,22 +125,8 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
}
onMounted
(()
=>
{
getDatasourceTypes
()
getDatasourceInstances
()
getDestinationDatasourceInstances
()
initConstants
()
})
const
onSourceTypeChange
=
(
type
:
string
)
=>
{
model
.
dsType
=
type
getDatasourceInstances
()
}
const
onDestinationTypeChange
=
(
type
:
string
)
=>
{
model
.
dtType
=
type
getDestinationDatasourceInstances
()
}
watch
(
()
=>
model
.
customConfig
,
()
=>
{
...
...
@@ -255,35 +140,11 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
field
:
'
customConfig
'
,
name
:
t
(
'
project.node.datax_custom_template
'
)
},
{
type
:
'
select
'
,
field
:
'
dsType
'
,
span
:
datasourceSpan
,
name
:
t
(
'
project.node.datasource_type
'
),
props
:
{
loading
:
loading
,
'
on-update:value
'
:
onSourceTypeChange
},
options
:
datasourceTypeOptions
,
validate
:
{
trigger
:
[
'
input
'
,
'
blur
'
],
required
:
true
}
},
{
type
:
'
select
'
,
field
:
'
dataSource
'
,
span
:
datasourceSpan
,
name
:
t
(
'
project.node.datasource_instances
'
),
props
:
{
loading
:
loading
},
options
:
datasourceOptions
,
validate
:
{
trigger
:
[
'
input
'
,
'
blur
'
],
required
:
true
}
},
...
useDatasource
(
model
,
{
typeField
:
'
dsType
'
,
sourceField
:
'
dataSource
'
,
span
:
datasourceSpan
}),
{
type
:
'
editor
'
,
field
:
'
sql
'
,
...
...
@@ -306,35 +167,11 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
message
:
t
(
'
project.node.sql_empty_tips
'
)
}
},
{
type
:
'
select
'
,
field
:
'
dtType
'
,
name
:
t
(
'
project.node.datax_target_datasource_type
'
),
span
:
destinationDatasourceSpan
,
props
:
{
loading
:
loading
,
'
on-update:value
'
:
onDestinationTypeChange
},
options
:
datasourceTypeOptions
,
validate
:
{
trigger
:
[
'
input
'
,
'
blur
'
],
required
:
true
}
},
{
type
:
'
select
'
,
field
:
'
dataTarget
'
,
name
:
t
(
'
project.node.datax_target_database
'
),
span
:
destinationDatasourceSpan
,
props
:
{
loading
:
loading
},
options
:
destinationDatasourceOptions
,
validate
:
{
trigger
:
[
'
input
'
,
'
blur
'
],
required
:
true
}
},
...
useDatasource
(
model
,
{
typeField
:
'
dtType
'
,
sourceField
:
'
dataTarget
'
,
span
:
destinationDatasourceSpan
}),
{
type
:
'
input
'
,
field
:
'
targetTable
'
,
...
...
dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts
浏览文件 @
0141aa51
...
...
@@ -185,7 +185,7 @@ export function useTable() {
{
title
:
t
(
'
project.workflow.operation
'
),
key
:
'
operation
'
,
...
COLUMN_WIDTH_CONFIG
[
'
operation
'
](
8.5
),
...
COLUMN_WIDTH_CONFIG
[
'
operation
'
](
10
),
render
:
(
row
)
=>
h
(
TableAction
,
{
row
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录