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
cafe7a48
Commit
cafe7a48
authored
Jul 14, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 连接线和删除线重置校验信息
parent
2d1e0f78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
4 deletions
+37
-4
index.tsx
...ws/Project/components/Flow/components/BatchNode/index.tsx
+4
-2
index.tsx
src/views/Project/components/Flow/index.tsx
+33
-2
No files found.
src/views/Project/components/Flow/components/BatchNode/index.tsx
View file @
cafe7a48
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-12 11:20:29
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-14 1
0:14:15
* @LastEditTime: 2022-07-14 1
1:35:44
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/BatchNode.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -87,7 +87,9 @@ const BatchNode = (props: IBatchNode) => {
})
}
>
{
title
||
""
}
{
isCheck
&&
<
span
className=
{
styles
.
successDot
}
></
span
>
}
{
isCheck
&&
flowType
!==
"edit"
?
(
<
span
className=
{
styles
.
successDot
}
></
span
>
)
:
null
}
</
div
>
{
outParamsArr
?.
length
&&
flowType
===
"edit"
?
outParamsArr
.
map
((
item
,
index
)
=>
{
...
...
src/views/Project/components/Flow/index.tsx
View file @
cafe7a48
...
...
@@ -72,6 +72,7 @@ const Flow = (props: IProps) => {
const
result
=
(
tasks
?.
length
&&
tasks
.
map
((
item
)
=>
{
/** 删除batch起始的edges中的一项 === 等于删除了一根连线 */
if
(
item
.
id
===
connection
.
source
&&
item
.
type
===
"BATCH"
)
{
const
newEdges
=
(
item
.
edges
?.
length
&&
...
...
@@ -79,10 +80,36 @@ const Flow = (props: IProps) => {
(
every
)
=>
every
.
sourceHandle
!==
connection
.
sourceHandle
))
||
[];
return
{
...
item
,
edges
:
newEdges
,
};
/** 选中batch结束位置&&更新校验值 */
}
else
if
(
item
.
id
===
connection
.
target
&&
item
.
type
===
"BATCH"
)
{
const
newParameters
=
(
item
.
parameters
?.
length
&&
item
.
parameters
.
map
((
every
)
=>
{
if
(
every
.
name
===
connection
.
targetHandle
)
{
const
{
error
,
helperText
}
=
getCustomTemplateParameterCheckResult
({
...
every
,
isLine
:
false
,
});
return
{
...
every
,
error
,
helperText
,
};
}
else
{
return
every
;
}
}))
||
[];
return
{
...
item
,
parameters
:
newParameters
,
};
}
else
{
return
item
;
}
...
...
@@ -250,6 +277,7 @@ const Flow = (props: IProps) => {
return
val
;
},
[
tasks
,
flowType
,
isFlowNode
,
selectedBatchNodeId
,
inSideBatchNodeId
,
...
...
@@ -377,9 +405,12 @@ const Flow = (props: IProps) => {
const
connectModifyParameters
=
useCallback
(
(
parameters
:
IParameter
[],
edgeItem
:
Connection
)
=>
{
return
parameters
.
map
((
item
)
=>
{
const
{
error
,
helperText
}
=
getCustomTemplateParameterCheckResult
(
item
);
if
(
item
.
name
===
edgeItem
.
targetHandle
)
{
const
{
error
,
helperText
}
=
getCustomTemplateParameterCheckResult
({
...
item
,
isLine
:
true
,
});
return
{
...
item
,
isLine
:
true
,
helperText
,
error
};
}
else
{
return
item
;
...
...
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