Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bkunyun
Commits
e7c84a3e
Commit
e7c84a3e
authored
Aug 10, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增算子联调60%
parent
f28c1e6c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
106 additions
and
86 deletions
+106
-86
index.tsx
src/views/CustomOperator/components/OperatorList/index.tsx
+53
-48
index.tsx
src/views/CustomOperator/components/SaveOperator/index.tsx
+0
-0
index.tsx
src/views/CustomOperator/index.tsx
+20
-7
index.tsx
src/views/Project/ProjectSubmitWork/ConfigForm/index.tsx
+9
-8
index.tsx
src/views/Project/ProjectSubmitWork/index.tsx
+7
-7
index.tsx
...ct/components/Flow/components/BatchOperatorFlow/index.tsx
+4
-4
index.tsx
src/views/Project/components/Flow/index.tsx
+3
-2
index.tsx
src/views/WorkFlowEdit/components/OperatorList/index.tsx
+2
-2
index.tsx
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
+8
-8
No files found.
src/views/CustomOperator/components/OperatorList/index.tsx
View file @
e7c84a3e
...
@@ -47,56 +47,61 @@ const OperatorList = (props: IProps) => {
...
@@ -47,56 +47,61 @@ const OperatorList = (props: IProps) => {
// 获取算子列表
// 获取算子列表
const
{
run
:
getOperatorListRun
,
loading
}
=
useMyRequest
(
getOperatorList
,
{
const
{
run
:
getOperatorListRun
,
loading
}
=
useMyRequest
(
getOperatorList
,
{
onSuccess
:
(
res
)
=>
{
onSuccess
:
(
res
)
=>
{
let
arr
=
res
?.
data
?.
content
;
let
arr
=
res
?.
data
?.
content
.
map
((
item
:
any
)
=>
{
return
{
...
item
,
edges
:
[],
};
});
setIsLastPage
(
res
?.
data
?.
last
);
setIsLastPage
(
res
?.
data
?.
last
);
// todo 去掉parameters添加
// todo 去掉parameters添加
arr
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
//
arr.forEach((item: any, index: number) => {
item
.
edges
=
[];
//
item.edges = [];
item
.
parameters
.
push
({
//
item.parameters.push({
choices
:
[],
//
choices: [],
classType
:
"STRING"
,
//
classType: "STRING",
classTypeName
:
"String"
,
//
classTypeName: "String",
defaultValue
:
null
,
//
defaultValue: null,
description
:
""
,
//
description: "",
domType
:
"dataset"
,
//
domType: "dataset",
hidden
:
false
,
//
hidden: false,
isnull
:
false
,
//
isnull: false,
level
:
null
,
//
level: null,
linked
:
false
,
//
linked: false,
many
:
false
,
//
many: false,
name
:
`in
${
index
+
1
}
`
,
//
name: `in${index + 1}`,
order
:
0
,
//
order: 0,
parameterGroup
:
"in"
,
//
parameterGroup: "in",
promoted
:
false
,
//
promoted: false,
promotedName
:
null
,
//
promotedName: null,
required
:
false
,
//
required: false,
title
:
null
,
//
title: null,
validators
:
[],
//
validators: [],
});
//
});
});
//
});
arr
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
//
arr.forEach((item: any, index: number) => {
item
.
parameters
.
push
({
//
item.parameters.push({
choices
:
[],
//
choices: [],
classType
:
"STRING"
,
//
classType: "STRING",
classTypeName
:
"String"
,
//
classTypeName: "String",
defaultValue
:
null
,
//
defaultValue: null,
description
:
""
,
//
description: "",
domType
:
"dataset"
,
//
domType: "dataset",
hidden
:
false
,
//
hidden: false,
isnull
:
false
,
//
isnull: false,
level
:
null
,
//
level: null,
linked
:
false
,
//
linked: false,
many
:
false
,
//
many: false,
name
:
`out
${
index
+
1
}
`
,
//
name: `out${index + 1}`,
order
:
0
,
//
order: 0,
parameterGroup
:
"out"
,
//
parameterGroup: "out",
promoted
:
false
,
//
promoted: false,
promotedName
:
null
,
//
promotedName: null,
required
:
false
,
//
required: false,
title
:
null
,
//
title: null,
validators
:
[],
//
validators: [],
});
//
});
});
//
});
setList
([...
list
,
...
arr
]);
setList
([...
list
,
...
arr
]);
},
},
});
});
...
...
src/views/CustomOperator/components/SaveOperator/index.tsx
View file @
e7c84a3e
This diff is collapsed.
Click to expand it.
src/views/CustomOperator/index.tsx
View file @
e7c84a3e
...
@@ -31,10 +31,13 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -31,10 +31,13 @@ const CustomOperator = observer((props: IProps) => {
// 判断 每个流算子必须至少有一条连接线。
// 判断 每个流算子必须至少有一条连接线。
const
checkHasOneLine
=
(
sourceArr
:
string
[],
targetArr
:
string
[])
=>
{
const
checkHasOneLine
=
(
sourceArr
:
string
[],
targetArr
:
string
[])
=>
{
console
.
log
(
"checkHasOneLine"
);
const
all
=
_
.
uniq
([...
sourceArr
,
...
targetArr
]);
const
all
=
_
.
uniq
([...
sourceArr
,
...
targetArr
]);
if
(
all
.
length
===
operatorList
.
length
)
{
if
(
all
.
length
===
operatorList
.
length
)
{
console
.
log
(
"checkHasOneLine1"
);
return
true
;
return
true
;
}
else
{
}
else
{
console
.
log
(
"checkHasOneLine2"
);
return
false
;
return
false
;
}
}
// _.uniq([2, 1, 2]);
// _.uniq([2, 1, 2]);
...
@@ -42,6 +45,7 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -42,6 +45,7 @@ const CustomOperator = observer((props: IProps) => {
// 判断 每个起始算子(可以有多个起始点)的输入必须为文件的路径输入或数据集的路径输入。
// 判断 每个起始算子(可以有多个起始点)的输入必须为文件的路径输入或数据集的路径输入。
const
checkIn
=
(
targetArr
:
string
[])
=>
{
const
checkIn
=
(
targetArr
:
string
[])
=>
{
console
.
log
(
"checkIn"
);
const
uniqTargetArr
=
_
.
uniq
(
targetArr
);
const
uniqTargetArr
=
_
.
uniq
(
targetArr
);
if
(
uniqTargetArr
.
length
===
operatorList
.
length
)
{
if
(
uniqTargetArr
.
length
===
operatorList
.
length
)
{
// 流节点连成一个圈了
// 流节点连成一个圈了
...
@@ -57,7 +61,11 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -57,7 +61,11 @@ const CustomOperator = observer((props: IProps) => {
if
(
inArr
.
length
>
0
)
{
if
(
inArr
.
length
>
0
)
{
if
(
if
(
!
inArr
.
some
((
inItem
)
=>
{
!
inArr
.
some
((
inItem
)
=>
{
return
inItem
.
domType
===
"dataset"
||
inItem
.
domType
===
"path"
;
return
(
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"dataset"
||
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"path"
||
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"file"
);
})
})
)
{
)
{
check
=
false
;
check
=
false
;
...
@@ -73,6 +81,7 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -73,6 +81,7 @@ const CustomOperator = observer((props: IProps) => {
// 判断 起码有一个结尾算子(可以有多个结尾点)的输出必须为文件保存或数据集保存。
// 判断 起码有一个结尾算子(可以有多个结尾点)的输出必须为文件保存或数据集保存。
const
checkOut
=
(
sourceArr
:
string
[])
=>
{
const
checkOut
=
(
sourceArr
:
string
[])
=>
{
console
.
log
(
"checkOut"
);
const
uniqSourceArr
=
_
.
uniq
(
sourceArr
);
const
uniqSourceArr
=
_
.
uniq
(
sourceArr
);
if
(
uniqSourceArr
.
length
===
operatorList
.
length
)
{
if
(
uniqSourceArr
.
length
===
operatorList
.
length
)
{
// 流节点连成一个圈了
// 流节点连成一个圈了
...
@@ -82,13 +91,17 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -82,13 +91,17 @@ const CustomOperator = observer((props: IProps) => {
operatorList
.
forEach
((
flowNode
)
=>
{
operatorList
.
forEach
((
flowNode
)
=>
{
if
(
uniqSourceArr
.
indexOf
(
flowNode
.
id
)
===
-
1
)
{
if
(
uniqSourceArr
.
indexOf
(
flowNode
.
id
)
===
-
1
)
{
// 该节点的输入没有连线 也就是说这个节点是起点
// 该节点的输入没有连线 也就是说这个节点是起点
const
in
Arr
=
flowNode
.
parameters
.
filter
(
const
out
Arr
=
flowNode
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"
in
"
(
parameter
)
=>
parameter
.
parameterGroup
===
"
out
"
);
);
if
(
in
Arr
.
length
>
0
)
{
if
(
out
Arr
.
length
>
0
)
{
if
(
if
(
!
inArr
.
some
((
inItem
)
=>
{
!
outArr
.
some
((
outItem
)
=>
{
return
inItem
.
domType
===
"dataset"
||
inItem
.
domType
===
"file"
;
return
(
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"dataset"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"file"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"path"
);
})
})
)
{
)
{
check
=
false
;
check
=
false
;
...
@@ -168,7 +181,7 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -168,7 +181,7 @@ const CustomOperator = observer((props: IProps) => {
type=
"edit"
type=
"edit"
onFlowNodeClick=
{
handleNodeClick
}
onFlowNodeClick=
{
handleNodeClick
}
flowNodeDraggable=
{
true
}
flowNodeDraggable=
{
true
}
//
ListenState={!saveFormDialog}
ListenState=
{
!
saveFormDialog
}
showVersion=
{
true
}
showVersion=
{
true
}
showControls=
{
false
}
showControls=
{
false
}
/>
/>
...
...
src/views/Project/ProjectSubmitWork/ConfigForm/index.tsx
View file @
e7c84a3e
...
@@ -215,7 +215,7 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -215,7 +215,7 @@ const ConfigForm = (props: ConfigFormProps) => {
</
div
>
</
div
>
<
MyTooltip
title=
{
parameter
.
description
}
placement=
"right"
>
<
MyTooltip
title=
{
parameter
.
description
}
placement=
"right"
>
<
div
className=
{
styles
.
parameterContent
}
>
<
div
className=
{
styles
.
parameterContent
}
>
{
parameter
.
domType
.
toLowerCase
()
===
"file"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"file"
&&
(
<
MyInput
<
MyInput
onFocus=
{
()
=>
setSelectedBatchNodeId
(
batchId
||
""
)
}
onFocus=
{
()
=>
setSelectedBatchNodeId
(
batchId
||
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
...
@@ -239,7 +239,7 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -239,7 +239,7 @@ const ConfigForm = (props: ConfigFormProps) => {
size=
"medium"
size=
"medium"
></
MyInput
>
></
MyInput
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"path"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"path"
&&
(
<
MyInput
<
MyInput
onFocus=
{
()
=>
setSelectedBatchNodeId
(
batchId
||
""
)
}
onFocus=
{
()
=>
setSelectedBatchNodeId
(
batchId
||
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
...
@@ -263,7 +263,7 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -263,7 +263,7 @@ const ConfigForm = (props: ConfigFormProps) => {
size=
"medium"
size=
"medium"
></
MyInput
>
></
MyInput
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"dataset"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"dataset"
&&
(
<
MyInput
<
MyInput
onFocus=
{
()
=>
setSelectedBatchNodeId
(
taskId
)
}
onFocus=
{
()
=>
setSelectedBatchNodeId
(
taskId
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
...
@@ -287,7 +287,7 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -287,7 +287,7 @@ const ConfigForm = (props: ConfigFormProps) => {
size=
"medium"
size=
"medium"
></
MyInput
>
></
MyInput
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"input"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"input"
&&
(
<
MyInput
<
MyInput
onFocus=
{
()
=>
{
onFocus=
{
()
=>
{
setSelectedBatchNodeId
(
batchId
||
""
);
setSelectedBatchNodeId
(
batchId
||
""
);
...
@@ -304,7 +304,7 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -304,7 +304,7 @@ const ConfigForm = (props: ConfigFormProps) => {
size=
"medium"
size=
"medium"
></
MyInput
>
></
MyInput
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"select"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"select"
&&
(
<
MySelect
<
MySelect
onFocus=
{
()
=>
setSelectedBatchNodeId
(
batchId
||
""
)
}
onFocus=
{
()
=>
setSelectedBatchNodeId
(
batchId
||
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
...
@@ -326,7 +326,8 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -326,7 +326,8 @@ const ConfigForm = (props: ConfigFormProps) => {
fullWidth
fullWidth
></
MySelect
>
></
MySelect
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"multipleselect"
&&
(
{
(
parameter
.
domType
||
""
).
toLowerCase
()
===
"multipleselect"
&&
(
<
MySelect
<
MySelect
onFocus=
{
()
=>
setSelectedBatchNodeId
(
batchId
||
""
)
}
onFocus=
{
()
=>
setSelectedBatchNodeId
(
batchId
||
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
onBlur=
{
()
=>
setSelectedBatchNodeId
(
""
)
}
...
@@ -349,7 +350,7 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -349,7 +350,7 @@ const ConfigForm = (props: ConfigFormProps) => {
fullWidth
fullWidth
></
MySelect
>
></
MySelect
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"radio"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"radio"
&&
(
<
MyRadio
<
MyRadio
value=
{
parameter
.
value
}
value=
{
parameter
.
value
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
...
@@ -362,7 +363,7 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -362,7 +363,7 @@ const ConfigForm = (props: ConfigFormProps) => {
helperText=
{
parameter
.
helperText
}
helperText=
{
parameter
.
helperText
}
></
MyRadio
>
></
MyRadio
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"checkbox"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"checkbox"
&&
(
<
MyCheckBox
<
MyCheckBox
value=
{
parameter
.
value
}
value=
{
parameter
.
value
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
...
...
src/views/Project/ProjectSubmitWork/index.tsx
View file @
e7c84a3e
...
@@ -70,16 +70,16 @@ const ProjectSubmitWork = observer(() => {
...
@@ -70,16 +70,16 @@ const ProjectSubmitWork = observer(() => {
let
value
:
any
=
undefined
;
let
value
:
any
=
undefined
;
if
(
parameter
.
defaultValue
)
{
if
(
parameter
.
defaultValue
)
{
if
(
if
(
parameter
.
domType
.
toLowerCase
()
===
"multipleselect"
||
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"multipleselect"
||
parameter
.
domType
.
toLowerCase
()
===
"checkbox"
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"checkbox"
)
{
)
{
value
=
parameter
.
defaultValue
.
split
(
","
);
value
=
parameter
.
defaultValue
.
split
(
","
);
}
else
{
}
else
{
value
=
parameter
.
defaultValue
;
value
=
parameter
.
defaultValue
;
}
}
}
else
if
(
}
else
if
(
parameter
.
domType
.
toLowerCase
()
===
"multipleselect"
||
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"multipleselect"
||
parameter
.
domType
.
toLowerCase
()
===
"checkbox"
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"checkbox"
)
{
)
{
value
=
[];
value
=
[];
}
else
{
}
else
{
...
@@ -179,9 +179,9 @@ const ProjectSubmitWork = observer(() => {
...
@@ -179,9 +179,9 @@ const ProjectSubmitWork = observer(() => {
value
=
parameter
.
value
;
value
=
parameter
.
value
;
}
}
if
(
if
(
parameter
.
domType
.
toLowerCase
()
===
"path"
||
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"path"
||
parameter
.
domType
.
toLowerCase
()
===
"dataset"
||
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"dataset"
||
parameter
.
domType
.
toLowerCase
()
===
"file"
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"file"
)
{
)
{
value
=
`/
${
value
}
`
;
value
=
`/
${
value
}
`
;
}
}
...
...
src/views/Project/components/Flow/components/BatchOperatorFlow/index.tsx
View file @
e7c84a3e
...
@@ -50,6 +50,7 @@ const BatchOperatorFlow = (props: IProps) => {
...
@@ -50,6 +50,7 @@ const BatchOperatorFlow = (props: IProps) => {
showVersion
=
false
,
showVersion
=
false
,
...
other
...
other
}
=
props
;
}
=
props
;
console
.
log
(
tasks
);
/** 自定义的节点类型 */
/** 自定义的节点类型 */
const
nodeTypes
=
useMemo
(()
=>
{
const
nodeTypes
=
useMemo
(()
=>
{
return
{
batchNode
:
BatchNode
,
flowNode
:
FlowNode
};
return
{
batchNode
:
BatchNode
,
flowNode
:
FlowNode
};
...
@@ -62,7 +63,7 @@ const BatchOperatorFlow = (props: IProps) => {
...
@@ -62,7 +63,7 @@ const BatchOperatorFlow = (props: IProps) => {
/** 原始数据删除线 */
/** 原始数据删除线 */
const
tasksDeleteLine
=
useCallback
(
const
tasksDeleteLine
=
useCallback
(
(
connection
:
Connection
|
Edge
)
=>
{
(
connection
:
Connection
|
Edge
|
any
)
=>
{
const
result
=
const
result
=
(
tasks
?.
length
&&
(
tasks
?.
length
&&
tasks
.
map
((
item
)
=>
{
tasks
.
map
((
item
)
=>
{
...
@@ -70,9 +71,7 @@ const BatchOperatorFlow = (props: IProps) => {
...
@@ -70,9 +71,7 @@ const BatchOperatorFlow = (props: IProps) => {
if
(
item
.
id
===
connection
.
source
)
{
if
(
item
.
id
===
connection
.
source
)
{
const
newEdges
=
const
newEdges
=
(
item
.
edges
?.
length
&&
(
item
.
edges
?.
length
&&
item
.
edges
?.
filter
(
item
.
edges
?.
filter
((
every
)
=>
every
.
id
!==
connection
.
id
))
||
(
every
)
=>
every
.
sourceHandle
!==
connection
.
sourceHandle
))
||
[];
[];
return
{
return
{
...
item
,
...
item
,
...
@@ -91,6 +90,7 @@ const BatchOperatorFlow = (props: IProps) => {
...
@@ -91,6 +90,7 @@ const BatchOperatorFlow = (props: IProps) => {
/** 删除流节点或者线 */
/** 删除流节点或者线 */
const
deleteSelectFlowNode
=
useCallback
(
const
deleteSelectFlowNode
=
useCallback
(
(
e
:
any
)
=>
{
(
e
:
any
)
=>
{
console
.
log
(
tasks
);
if
(
e
.
keyCode
===
8
&&
ListenState
)
{
if
(
e
.
keyCode
===
8
&&
ListenState
)
{
/** 删除流节点逻辑 */
/** 删除流节点逻辑 */
if
(
inSideFlowNodeId
)
{
if
(
inSideFlowNodeId
)
{
...
...
src/views/Project/components/Flow/index.tsx
View file @
e7c84a3e
...
@@ -18,7 +18,7 @@ import FlowNode from "./components/FlowNode";
...
@@ -18,7 +18,7 @@ import FlowNode from "./components/FlowNode";
import
{
getCustomTemplateParameterCheckResult
}
from
"@/views/WorkFlowEdit/util"
;
import
{
getCustomTemplateParameterCheckResult
}
from
"@/views/WorkFlowEdit/util"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
styles
from
'./index.module.css'
import
styles
from
"./index.module.css"
;
/*
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
...
@@ -61,6 +61,7 @@ const Flow = (props: IProps) => {
...
@@ -61,6 +61,7 @@ const Flow = (props: IProps) => {
showControls
=
true
,
showControls
=
true
,
...
other
...
other
}
=
props
;
}
=
props
;
console
.
log
(
tasks
);
/** 自定义的节点类型 */
/** 自定义的节点类型 */
const
nodeTypes
=
useMemo
(()
=>
{
const
nodeTypes
=
useMemo
(()
=>
{
return
{
batchNode
:
BatchNode
,
flowNode
:
FlowNode
};
return
{
batchNode
:
BatchNode
,
flowNode
:
FlowNode
};
...
@@ -375,7 +376,7 @@ const Flow = (props: IProps) => {
...
@@ -375,7 +376,7 @@ const Flow = (props: IProps) => {
setInSideFlowNodeId
(
""
);
setInSideFlowNodeId
(
""
);
onBatchClick
&&
onBatchClick
(
""
);
onBatchClick
&&
onBatchClick
(
""
);
setSelectedEdge
(
undefined
);
setSelectedEdge
(
undefined
);
onFlowNodeClick
&&
onFlowNodeClick
(
''
)
onFlowNodeClick
&&
onFlowNodeClick
(
""
);
};
};
/** node节点 */
/** node节点 */
...
...
src/views/WorkFlowEdit/components/OperatorList/index.tsx
View file @
e7c84a3e
...
@@ -29,7 +29,7 @@ let count = 1;
...
@@ -29,7 +29,7 @@ let count = 1;
const
OperatorItem
=
(
props
:
IOperatorItemProps
)
=>
{
const
OperatorItem
=
(
props
:
IOperatorItemProps
)
=>
{
const
{
const
{
info
:
{
title
,
description
,
tags
,
version
},
info
:
{
title
,
description
,
tags
,
version
},
setTemplateConfigInfo
,
setTemplateConfigInfo
,
templateConfigInfo
,
templateConfigInfo
,
operatorListData
,
operatorListData
,
...
@@ -75,7 +75,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
...
@@ -75,7 +75,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
x
:
item
.
type
===
"BATCH"
?
x
:
item
.
position
?.
x
,
x
:
item
.
type
===
"BATCH"
?
x
:
item
.
position
?.
x
,
y
:
item
.
type
===
"BATCH"
?
y
:
item
.
position
?.
y
,
y
:
item
.
type
===
"BATCH"
?
y
:
item
.
position
?.
y
,
},
},
edges
:
newEdges
.
length
?
newEdges
:
item
?.
edges
,
edges
:
newEdges
?
.
length
?
newEdges
:
item
?.
edges
,
};
};
});
});
return
newVal
;
return
newVal
;
...
...
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
View file @
e7c84a3e
...
@@ -395,7 +395,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -395,7 +395,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
return
(
return
(
<
MyTooltip
title=
{
parameter
.
description
}
placement=
"right"
>
<
MyTooltip
title=
{
parameter
.
description
}
placement=
"right"
>
<
div
>
<
div
>
{
parameter
.
domType
.
toLowerCase
()
===
"file"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"file"
&&
(
<
MyInput
<
MyInput
value=
{
parameter
.
defaultValue
||
""
}
value=
{
parameter
.
defaultValue
||
""
}
InputProps=
{
{
InputProps=
{
{
...
@@ -420,7 +420,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -420,7 +420,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
disabled=
{
parameter
.
parameterGroup
===
"out"
}
disabled=
{
parameter
.
parameterGroup
===
"out"
}
></
MyInput
>
></
MyInput
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"path"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"path"
&&
(
<
MyInput
<
MyInput
value=
{
parameter
.
defaultValue
||
""
}
value=
{
parameter
.
defaultValue
||
""
}
InputProps=
{
{
InputProps=
{
{
...
@@ -445,7 +445,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -445,7 +445,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
disabled=
{
parameter
.
parameterGroup
===
"out"
}
disabled=
{
parameter
.
parameterGroup
===
"out"
}
></
MyInput
>
></
MyInput
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"dataset"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"dataset"
&&
(
<
MyInput
<
MyInput
value=
{
parameter
.
defaultValue
||
""
}
value=
{
parameter
.
defaultValue
||
""
}
InputProps=
{
{
InputProps=
{
{
...
@@ -470,7 +470,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -470,7 +470,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
disabled=
{
parameter
.
parameterGroup
===
"out"
}
disabled=
{
parameter
.
parameterGroup
===
"out"
}
></
MyInput
>
></
MyInput
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"input"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"input"
&&
(
<
MyInput
<
MyInput
value=
{
parameter
.
defaultValue
||
""
}
value=
{
parameter
.
defaultValue
||
""
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
...
@@ -482,7 +482,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -482,7 +482,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
disabled=
{
parameter
.
parameterGroup
===
"out"
}
disabled=
{
parameter
.
parameterGroup
===
"out"
}
></
MyInput
>
></
MyInput
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"select"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"select"
&&
(
<
MySelect
<
MySelect
value=
{
parameter
.
defaultValue
}
value=
{
parameter
.
defaultValue
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
...
@@ -501,7 +501,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -501,7 +501,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
disabled=
{
parameter
.
parameterGroup
===
"out"
}
disabled=
{
parameter
.
parameterGroup
===
"out"
}
></
MySelect
>
></
MySelect
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"multipleselect"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"multipleselect"
&&
(
<
MySelect
<
MySelect
value=
{
parameter
.
defaultValue
}
value=
{
parameter
.
defaultValue
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
...
@@ -521,7 +521,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -521,7 +521,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
disabled=
{
parameter
.
parameterGroup
===
"out"
}
disabled=
{
parameter
.
parameterGroup
===
"out"
}
></
MySelect
>
></
MySelect
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"radio"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"radio"
&&
(
<
MyRadio
<
MyRadio
value=
{
parameter
.
defaultValue
}
value=
{
parameter
.
defaultValue
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
...
@@ -532,7 +532,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -532,7 +532,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
helperText=
{
parameter
.
helperText
}
helperText=
{
parameter
.
helperText
}
></
MyRadio
>
></
MyRadio
>
)
}
)
}
{
parameter
.
domType
.
toLowerCase
()
===
"checkbox"
&&
(
{
(
parameter
.
domType
||
""
)
.
toLowerCase
()
===
"checkbox"
&&
(
<
MyCheckBox
<
MyCheckBox
value=
{
parameter
.
defaultValue
}
value=
{
parameter
.
defaultValue
}
onChange=
{
(
e
:
any
)
=>
onChange=
{
(
e
:
any
)
=>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment