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
1d7b6335
Commit
1d7b6335
authored
Jul 12, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 点击样式修改
parent
4722964b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
index.tsx
...ews/Project/components/Flow/components/FlowNode/index.tsx
+1
-2
index.tsx
src/views/Project/components/Flow/index.tsx
+15
-6
No files found.
src/views/Project/components/Flow/components/FlowNode/index.tsx
View file @
1d7b6335
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-12 11:29:46
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-12
16:29:39
* @LastEditTime: 2022-07-12
21:06:48
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/FlowNode/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -37,7 +37,6 @@ const FlowNode = (props: any) => {
selectedStatus
,
info
:
{
title
,
isCheck
,
executionStatus
},
}
=
data
;
console
.
log
(
selectedStatus
,
"selectedStatus"
);
return
(
<
div
className=
{
classNames
({
...
...
src/views/Project/components/Flow/index.tsx
View file @
1d7b6335
...
...
@@ -6,6 +6,7 @@ import ReactFlow, {
ReactFlowProps
,
Node
,
Connection
,
Edge
,
}
from
"react-flow-renderer"
;
import
{
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
_
from
"lodash"
;
...
...
@@ -62,7 +63,7 @@ const Flow = (props: IProps) => {
const
[
inSideFlowNodeId
,
setInSideFlowNodeId
]
=
useState
<
string
>
(
""
);
const
Message
=
useMessage
();
/** 删除批节点 */
/** 删除批
或者线
节点 */
const
deleteSelectBatchNode
=
useCallback
(
(
e
:
any
)
=>
{
if
(
e
.
keyCode
===
8
)
{
...
...
@@ -255,6 +256,7 @@ const Flow = (props: IProps) => {
?
setSelectedBatchNodeId
(
id
)
:
setInSideBatchNodeId
(
id
);
onBatchClick
&&
onBatchClick
(
id
);
setInSideFlowNodeId
(
""
);
document
.
getElementById
(
`point
${
id
}
`
)?.
scrollIntoView
(
true
);
},
[
onBatchClick
,
setSelectedBatchNodeId
]
...
...
@@ -264,11 +266,12 @@ const Flow = (props: IProps) => {
const
onNodeClick
=
(
e
:
any
,
node
:
Node
)
=>
{
tasks
?.
forEach
((
item
)
=>
{
if
(
item
.
id
===
node
.
id
)
{
if
(
item
.
parentNode
)
{
setInSideFlowNodeId
(
node
.
id
);
setNodeIdFun
(
item
.
parentNode
);
}
else
{
if
(
item
.
type
===
"BATCH"
)
{
setNodeIdFun
(
node
.
id
);
}
else
{
setInSideFlowNodeId
(
node
.
id
);
setInSideBatchNodeId
(
""
);
setSelectedBatchNodeId
&&
setSelectedBatchNodeId
(
""
);
}
}
});
...
...
@@ -371,7 +374,7 @@ const Flow = (props: IProps) => {
if
(
every
.
name
===
connection
.
targetHandle
)
{
inputClassType
=
every
.
classType
;
}
if
(
every
.
name
===
connection
.
source
)
{
if
(
every
.
name
===
connection
.
source
Handle
)
{
outClassType
=
every
.
classType
;
}
});
...
...
@@ -433,6 +436,11 @@ const Flow = (props: IProps) => {
[
Message
,
connectCheck
,
getClassType
,
setTasks
,
tasksDeleteLine
]
);
/** 点击连线 */
const
onEdgeClick
=
useCallback
((
e
:
any
,
val
:
Edge
)
=>
{
console
.
log
(
val
,
"1111"
);
},
[]);
return
(
<
ReactFlow
nodes=
{
nodes
}
...
...
@@ -442,6 +450,7 @@ const Flow = (props: IProps) => {
onEdgesChange=
{
onEdgesChange
}
onNodeDragStop=
{
onNodeDragStop
}
onConnect=
{
onConnect
}
onEdgeClick=
{
onEdgeClick
}
// proOptions={{ hideAttribution: true, account: "" }}
nodeTypes=
{
nodeTypes
}
onPaneClick=
{
handlePaneClick
}
...
...
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