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
Unverified
Commit
de35fd0a
authored
Feb 25, 2025
by
芋道源码
Committed by
Gitee
Feb 25, 2025
Browse files
Options
Browse Files
Download
Plain Diff
!708 优化代码 流程模型的流程设计中的条件分支问题 : 来回切换点击条件分支后带来的 条件切换问题
Merge pull request !708 from Lemon/feature/bpm-流程条件切换分支
parents
50df1f3e
ce0020ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
11 deletions
+44
-11
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
+44
-11
No files found.
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
View file @
de35fd0a
...
...
@@ -47,6 +47,7 @@ import { SimpleFlowNode, ConditionType } from '../consts'
import
{
getDefaultConditionNodeName
}
from
'../utils'
import
{
useFormFieldsAndStartUser
,
getConditionShowText
}
from
'../node'
import
Condition
from
'./components/Condition.vue'
import
{
cloneDeep
}
from
'lodash-es'
const
message
=
useMessage
()
// 消息弹窗
defineOptions
({
name
:
'ConditionNodeConfig'
...
...
@@ -63,9 +64,43 @@ const props = defineProps({
})
const
settingVisible
=
ref
(
false
)
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
=
()
=>
{
condition
.
value
=
currentNode
.
value
.
conditionSetting
// 如果有已存在的配置则使用,否则使用默认值
if
(
currentNode
.
value
.
conditionSetting
)
{
condition
.
value
=
cloneDeep
(
currentNode
.
value
.
conditionSetting
)
}
else
{
// 重置为默认值
condition
.
value
=
{
conditionType
:
ConditionType
.
RULE
,
conditionExpression
:
''
,
conditionGroups
:
{
and
:
true
,
conditions
:
[{
and
:
true
,
rules
:
[{
opCode
:
'=='
,
leftSide
:
''
,
rightSide
:
''
}]
}]
}
}
}
settingVisible
.
value
=
true
}
...
...
@@ -123,15 +158,13 @@ const saveConfig = async () => {
return
false
}
currentNode
.
value
.
showText
=
showText
currentNode
.
value
.
conditionSetting
!
.
conditionType
=
condition
.
value
?.
conditionType
if
(
currentNode
.
value
.
conditionSetting
?.
conditionType
===
ConditionType
.
EXPRESSION
)
{
currentNode
.
value
.
conditionSetting
.
conditionGroups
=
undefined
currentNode
.
value
.
conditionSetting
.
conditionExpression
=
condition
.
value
?.
conditionExpression
}
if
(
currentNode
.
value
.
conditionSetting
!
.
conditionType
===
ConditionType
.
RULE
)
{
currentNode
.
value
.
conditionSetting
!
.
conditionExpression
=
undefined
currentNode
.
value
.
conditionSetting
!
.
conditionGroups
=
condition
.
value
?.
conditionGroups
}
// 使用 cloneDeep 进行深拷贝
currentNode
.
value
.
conditionSetting
=
cloneDeep
({
...
currentNode
.
value
.
conditionSetting
,
conditionType
:
condition
.
value
?.
conditionType
,
conditionExpression
:
condition
.
value
?.
conditionType
===
ConditionType
.
EXPRESSION
?
condition
.
value
?.
conditionExpression
:
undefined
,
conditionGroups
:
condition
.
value
?.
conditionType
===
ConditionType
.
RULE
?
condition
.
value
?.
conditionGroups
:
undefined
})
}
settingVisible
.
value
=
false
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