Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
38578c3e
authored
Jan 16, 2025
by
Lesan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 获取分支中的节点
parent
69ccd83a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue
+12
-8
No files found.
src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue
View file @
38578c3e
...
@@ -86,7 +86,7 @@ const currentNode = useWatchNode(props)
...
@@ -86,7 +86,7 @@ const currentNode = useWatchNode(props)
// 节点名称
// 节点名称
const
{
nodeName
,
showInput
,
clickIcon
,
blurEvent
}
=
useNodeName
(
NodeType
.
ROUTER_BRANCH_NODE
)
const
{
nodeName
,
showInput
,
clickIcon
,
blurEvent
}
=
useNodeName
(
NodeType
.
ROUTER_BRANCH_NODE
)
const
routerGroups
=
ref
<
RouterCondition
[]
>
([])
const
routerGroups
=
ref
<
RouterCondition
[]
>
([])
const
nodeOptions
=
ref
(
)
const
nodeOptions
=
ref
<
any
>
([]
)
const
conditionRef
=
ref
([])
const
conditionRef
=
ref
([])
/** 保存配置 */
/** 保存配置 */
...
@@ -94,7 +94,7 @@ const saveConfig = async () => {
...
@@ -94,7 +94,7 @@ const saveConfig = async () => {
// 校验表单
// 校验表单
let
valid
=
true
let
valid
=
true
for
(
const
item
of
conditionRef
.
value
)
{
for
(
const
item
of
conditionRef
.
value
)
{
if
(
!
(
await
item
.
validate
()))
{
if
(
item
&&
!
(
await
item
.
validate
()))
{
valid
=
false
valid
=
false
}
}
}
}
...
@@ -109,7 +109,7 @@ const saveConfig = async () => {
...
@@ -109,7 +109,7 @@ const saveConfig = async () => {
}
}
// 显示路由分支节点配置, 由父组件传过来
// 显示路由分支节点配置, 由父组件传过来
const
showRouteNodeConfig
=
(
node
:
SimpleFlowNode
)
=>
{
const
showRouteNodeConfig
=
(
node
:
SimpleFlowNode
)
=>
{
getRouterNode
()
getRouterNode
(
processNodeTree
?.
value
)
routerGroups
.
value
=
[]
routerGroups
.
value
=
[]
nodeName
.
value
=
node
.
name
nodeName
.
value
=
node
.
name
if
(
node
.
routerGroups
)
{
if
(
node
.
routerGroups
)
{
...
@@ -172,15 +172,14 @@ const deleteRouterGroup = (index: number) => {
...
@@ -172,15 +172,14 @@ const deleteRouterGroup = (index: number) => {
routerGroups
.
value
.
splice
(
index
,
1
)
routerGroups
.
value
.
splice
(
index
,
1
)
}
}
const
getRouterNode
=
()
=>
{
// 递归获取所有节点
// TODO @lesan 还需要满足以下要求
const
getRouterNode
=
(
node
)
=>
{
// TODO 最好还需要满足以下要求
// 并行分支、包容分支内部节点不能跳转到外部节点
// 并行分支、包容分支内部节点不能跳转到外部节点
// 条件分支节点可以向上跳转到外部节点
// 条件分支节点可以向上跳转到外部节点
let
node
=
processNodeTree
?.
value
nodeOptions
.
value
=
[]
while
(
true
)
{
while
(
true
)
{
if
(
!
node
)
break
if
(
!
node
)
break
if
(
node
.
type
!==
NodeType
.
ROUTER_BRANCH_NODE
)
{
if
(
node
.
type
!==
NodeType
.
ROUTER_BRANCH_NODE
&&
node
.
type
!==
NodeType
.
CONDITION_NODE
)
{
nodeOptions
.
value
.
push
({
nodeOptions
.
value
.
push
({
label
:
node
.
name
,
label
:
node
.
name
,
value
:
node
.
id
value
:
node
.
id
...
@@ -189,6 +188,11 @@ const getRouterNode = () => {
...
@@ -189,6 +188,11 @@ const getRouterNode = () => {
if
(
!
node
.
childNode
||
node
.
type
===
NodeType
.
END_EVENT_NODE
)
{
if
(
!
node
.
childNode
||
node
.
type
===
NodeType
.
END_EVENT_NODE
)
{
break
break
}
}
if
(
node
.
conditionNodes
&&
node
.
conditionNodes
.
length
)
{
node
.
conditionNodes
.
forEach
((
item
)
=>
{
getRouterNode
(
item
)
})
}
node
=
node
.
childNode
node
=
node
.
childNode
}
}
}
}
...
...
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