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
c7b135e1
authored
Feb 22, 2025
by
Lemon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码 切换点击条件分支后带来的 条件切换问题
parent
b2ddefe4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
11 deletions
+43
-11
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
+43
-11
No files found.
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
View file @
c7b135e1
...
@@ -63,9 +63,43 @@ const props = defineProps({
...
@@ -63,9 +63,43 @@ const props = defineProps({
})
})
const
settingVisible
=
ref
(
false
)
const
settingVisible
=
ref
(
false
)
const
currentNode
=
ref
<
SimpleFlowNode
>
(
props
.
conditionNode
)
const
currentNode
=
ref
<
SimpleFlowNode
>
(
props
.
conditionNode
)
const
condition
=
ref
<
any
>
()
const
condition
=
ref
<
any
>
({
conditionType
:
ConditionType
.
RULE
,
// 设置默认值
conditionExpression
:
''
,
conditionGroups
:
{
and
:
true
,
conditions
:
[{
and
:
true
,
rules
:
[{
opCode
:
'=='
,
leftSide
:
''
,
rightSide
:
''
}]
}]
}
})
const
open
=
()
=>
{
const
open
=
()
=>
{
condition
.
value
=
currentNode
.
value
.
conditionSetting
// 如果有已存在的配置则使用,否则使用默认值
if
(
currentNode
.
value
.
conditionSetting
)
{
condition
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
currentNode
.
value
.
conditionSetting
))
}
else
{
// 重置为默认值
condition
.
value
=
{
conditionType
:
ConditionType
.
RULE
,
conditionExpression
:
''
,
conditionGroups
:
{
and
:
true
,
conditions
:
[{
and
:
true
,
rules
:
[{
opCode
:
'=='
,
leftSide
:
''
,
rightSide
:
''
}]
}]
}
}
}
settingVisible
.
value
=
true
settingVisible
.
value
=
true
}
}
...
@@ -123,15 +157,13 @@ const saveConfig = async () => {
...
@@ -123,15 +157,13 @@ const saveConfig = async () => {
return
false
return
false
}
}
currentNode
.
value
.
showText
=
showText
currentNode
.
value
.
showText
=
showText
currentNode
.
value
.
conditionSetting
!
.
conditionType
=
condition
.
value
?.
conditionType
// 深拷贝保存的条件设置,避免引用问题
if
(
currentNode
.
value
.
conditionSetting
?.
conditionType
===
ConditionType
.
EXPRESSION
)
{
currentNode
.
value
.
conditionSetting
=
JSON
.
parse
(
JSON
.
stringify
({
currentNode
.
value
.
conditionSetting
.
conditionGroups
=
undefined
...
currentNode
.
value
.
conditionSetting
,
currentNode
.
value
.
conditionSetting
.
conditionExpression
=
condition
.
value
?.
conditionExpression
conditionType
:
condition
.
value
?.
conditionType
,
}
conditionExpression
:
condition
.
value
?.
conditionType
===
ConditionType
.
EXPRESSION
?
condition
.
value
?.
conditionExpression
:
undefined
,
if
(
currentNode
.
value
.
conditionSetting
!
.
conditionType
===
ConditionType
.
RULE
)
{
conditionGroups
:
condition
.
value
?.
conditionType
===
ConditionType
.
RULE
?
condition
.
value
?.
conditionGroups
:
undefined
currentNode
.
value
.
conditionSetting
!
.
conditionExpression
=
undefined
}))
currentNode
.
value
.
conditionSetting
!
.
conditionGroups
=
condition
.
value
?.
conditionGroups
}
}
}
settingVisible
.
value
=
false
settingVisible
.
value
=
false
return
true
return
true
...
...
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