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
aa15b8ae
Commit
aa15b8ae
authored
Jul 13, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 删除逻辑修改
parent
059b4969
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
24 deletions
+60
-24
index.tsx
src/views/Project/components/Flow/index.tsx
+22
-9
index.module.css
...ews/WorkFlowEdit/components/OperatorList/index.module.css
+15
-0
index.tsx
src/views/WorkFlowEdit/components/OperatorList/index.tsx
+23
-15
No files found.
src/views/Project/components/Flow/index.tsx
View file @
aa15b8ae
...
...
@@ -52,6 +52,7 @@ const Flow = (props: IProps) => {
type
:
flowType
=
"default"
,
setTasks
,
onFlowNodeClick
,
...
other
}
=
props
;
/** 自定义的节点类型 */
const
nodeTypes
=
useMemo
(()
=>
{
...
...
@@ -96,10 +97,9 @@ const Flow = (props: IProps) => {
const
deleteSelectBatchNode
=
useCallback
(
(
e
:
any
)
=>
{
if
(
e
.
keyCode
===
8
)
{
let
val
:
ITask
[]
=
[];
/** 删除批节点逻辑 */
if
(
inSideBatchNodeId
)
{
v
al
=
const
newV
al
=
(
tasks
?.
length
&&
tasks
.
filter
((
item
)
=>
{
return
(
...
...
@@ -108,11 +108,12 @@ const Flow = (props: IProps) => {
);
}))
||
[];
setTasks
&&
setTasks
(
newVal
);
}
if
(
selectedEdge
)
{
val
=
tasksDeleteLine
(
selectedEdge
);
const
newVal
=
tasksDeleteLine
(
selectedEdge
);
setTasks
&&
setTasks
(
newVal
);
}
setTasks
&&
setTasks
(
val
);
}
},
[
inSideBatchNodeId
,
selectedEdge
,
setTasks
,
tasks
,
tasksDeleteLine
]
...
...
@@ -316,11 +317,16 @@ const Flow = (props: IProps) => {
}
else
{
setInSideFlowNodeId
(
node
.
id
);
setInSideBatchNodeId
(
""
);
setSelectedBatchNodeId
&&
setSelectedBatchNodeId
(
""
);
}
}
});
onFlowNodeClick
&&
onFlowNodeClick
(
node
.
id
);
if
(
onFlowNodeClick
)
{
onFlowNodeClick
(
node
.
id
);
}
/** 点击node统一清除选中的edge */
setSelectedEdge
(
undefined
);
};
const
handlePaneClick
=
()
=>
{
...
...
@@ -456,9 +462,16 @@ const Flow = (props: IProps) => {
);
/** 点击连线 */
const
onEdgeClick
=
useCallback
((
e
:
any
,
val
:
Edge
)
=>
{
setSelectedEdge
(
val
);
},
[]);
const
onEdgeClick
=
useCallback
(
(
e
:
any
,
val
:
Edge
)
=>
{
setSelectedEdge
(
val
);
/** 点击连线清除选中的node ID */
setInSideFlowNodeId
(
""
);
setInSideBatchNodeId
(
""
);
setSelectedBatchNodeId
&&
setSelectedBatchNodeId
(
""
);
},
[
setSelectedBatchNodeId
]
);
return
(
<
ReactFlow
...
...
@@ -474,7 +487,7 @@ const Flow = (props: IProps) => {
nodeTypes=
{
nodeTypes
}
onPaneClick=
{
handlePaneClick
}
onNodeClick=
{
onNodeClick
}
{
...
props
}
{
...
other
}
>
<
Controls
/>
<
Background
color=
"#aaa"
gap=
{
16
}
/>
...
...
src/views/WorkFlowEdit/components/OperatorList/index.module.css
View file @
aa15b8ae
...
...
@@ -59,3 +59,18 @@
padding
:
0
8px
;
border-radius
:
2px
;
}
.noData
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
flex-direction
:
column
;
}
.noDataImg
{
margin
:
160px
0
8px
0
;
}
.noDataText
{
font-size
:
14px
;
line-height
:
22px
;
color
:
rgba
(
138
,
144
,
153
,
1
);
}
src/views/WorkFlowEdit/components/OperatorList/index.tsx
View file @
aa15b8ae
...
...
@@ -12,9 +12,10 @@ import useMyRequest from "@/hooks/useMyRequest";
import
{
IResponse
}
from
"@/api/http"
;
import
{
fetchOperatorList
,
fetchVersionOperator
}
from
"@/api/workbench_api"
;
import
{
useStores
}
from
"@/store"
;
import
noTemplate
from
"@/assets/project/noTemplate.svg"
;
import
MyMenu
from
"@/components/mui/MyMenu"
;
import
styles
from
"./index.module.css"
;
import
MyMenu
from
"@/components/mui/MyMenu"
;
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
...
...
@@ -255,20 +256,27 @@ const OperatorList = observer((props: IOperatorListProps) => {
/>
</
div
>
<
div
className=
{
styles
.
listBox
}
>
{
operatorListData
.
filter
((
item
)
=>
item
.
type
===
"BATCH"
)
.
map
((
item
)
=>
{
return
(
<
OperatorItem
key=
{
item
.
id
}
info=
{
item
}
setOperatorListData=
{
setOperatorListData
}
operatorListData=
{
operatorListData
}
templateConfigInfo=
{
templateConfigInfo
}
setTemplateConfigInfo=
{
setTemplateConfigInfo
}
/>
);
})
}
{
operatorListData
.
filter
((
item
)
=>
item
.
type
===
"BATCH"
)?.
length
?
(
operatorListData
.
filter
((
item
)
=>
item
.
type
===
"BATCH"
)
.
map
((
item
)
=>
{
return
(
<
OperatorItem
key=
{
item
.
id
}
info=
{
item
}
setOperatorListData=
{
setOperatorListData
}
operatorListData=
{
operatorListData
}
templateConfigInfo=
{
templateConfigInfo
}
setTemplateConfigInfo=
{
setTemplateConfigInfo
}
/>
);
})
)
:
(
<
div
className=
{
styles
.
noData
}
>
<
img
src=
{
noTemplate
}
alt=
""
className=
{
styles
.
noDataImg
}
/>
<
span
className=
{
styles
.
noDataText
}
>
没有找到相关算子
</
span
>
</
div
>
)
}
</
div
>
</
div
>
);
...
...
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