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
42de3d91
authored
Jan 19, 2025
by
jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能优化】条件节点设置优化
parent
baa41166
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
35 deletions
+55
-35
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
+10
-2
src/components/SimpleProcessDesignerV2/src/consts.ts
+16
-8
src/components/SimpleProcessDesignerV2/src/node.ts
+0
-2
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
+28
-22
src/components/SimpleProcessDesignerV2/src/nodes/InclusiveNode.vue
+1
-1
No files found.
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
View file @
42de3d91
...
@@ -163,18 +163,21 @@ const addNode = (type: number) => {
...
@@ -163,18 +163,21 @@ const addNode = (type: number) => {
showText
:
''
,
showText
:
''
,
type
:
NodeType
.
CONDITION_NODE
,
type
:
NodeType
.
CONDITION_NODE
,
childNode
:
undefined
,
childNode
:
undefined
,
condition
Type
:
1
,
condition
Setting
:
{
defaultFlow
:
false
defaultFlow
:
false
},
},
},
{
{
id
:
'Flow_'
+
generateUUID
(),
id
:
'Flow_'
+
generateUUID
(),
name
:
'其它情况'
,
name
:
'其它情况'
,
showText
:
'未满足其它条件时,将进入此分支'
,
showText
:
'未满足其它条件时,将进入此分支'
,
type
:
NodeType
.
CONDITION_NODE
,
type
:
NodeType
.
CONDITION_NODE
,
childNode
:
undefined
,
childNode
:
undefined
,
condition
Type
:
undefined
,
condition
Setting
:
{
defaultFlow
:
true
defaultFlow
:
true
}
}
}
]
]
}
}
emits
(
'update:childNode'
,
data
)
emits
(
'update:childNode'
,
data
)
...
@@ -217,7 +220,10 @@ const addNode = (type: number) => {
...
@@ -217,7 +220,10 @@ const addNode = (type: number) => {
showText
:
''
,
showText
:
''
,
type
:
NodeType
.
CONDITION_NODE
,
type
:
NodeType
.
CONDITION_NODE
,
childNode
:
undefined
,
childNode
:
undefined
,
conditionSetting
:
{
defaultFlow
:
false
defaultFlow
:
false
}
},
},
{
{
id
:
'Flow_'
+
generateUUID
(),
id
:
'Flow_'
+
generateUUID
(),
...
@@ -225,8 +231,10 @@ const addNode = (type: number) => {
...
@@ -225,8 +231,10 @@ const addNode = (type: number) => {
showText
:
'未满足其它条件时,将进入此分支'
,
showText
:
'未满足其它条件时,将进入此分支'
,
type
:
NodeType
.
CONDITION_NODE
,
type
:
NodeType
.
CONDITION_NODE
,
childNode
:
undefined
,
childNode
:
undefined
,
conditionSetting
:
{
defaultFlow
:
true
defaultFlow
:
true
}
}
}
]
]
}
}
emits
(
'update:childNode'
,
data
)
emits
(
'update:childNode'
,
data
)
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
42de3d91
...
@@ -103,14 +103,8 @@ export interface SimpleFlowNode {
...
@@ -103,14 +103,8 @@ export interface SimpleFlowNode {
taskAssignListener
?:
ListenerHandler
taskAssignListener
?:
ListenerHandler
// 创建任务监听器
// 创建任务监听器
taskCompleteListener
?:
ListenerHandler
taskCompleteListener
?:
ListenerHandler
// 条件类型
// 条件设置
conditionType
?:
ConditionType
conditionSetting
?:
ConditionSetting
// 条件表达式
conditionExpression
?:
string
// 条件组
conditionGroups
?:
ConditionGroup
// 是否默认的条件
defaultFlow
?:
boolean
// 活动的状态,用于前端节点状态展示
// 活动的状态,用于前端节点状态展示
activityStatus
?:
TaskStatusEnum
activityStatus
?:
TaskStatusEnum
// 延迟设置
// 延迟设置
...
@@ -365,6 +359,20 @@ export enum TimeUnitType {
...
@@ -365,6 +359,20 @@ export enum TimeUnitType {
DAY
=
3
DAY
=
3
}
}
/**
* 条件节点设置结构定义,用于条件节点
*/
export
type
ConditionSetting
=
{
// 条件类型
conditionType
?:
ConditionType
,
// 条件表达式
conditionExpression
?:
string
,
// 条件组
conditionGroups
?:
ConditionGroup
,
// 是否默认的条件
defaultFlow
?:
boolean
}
// 条件配置类型 ( 用于条件节点配置 )
// 条件配置类型 ( 用于条件节点配置 )
export
enum
ConditionType
{
export
enum
ConditionType
{
/**
/**
...
...
src/components/SimpleProcessDesignerV2/src/node.ts
View file @
42de3d91
...
@@ -113,7 +113,6 @@ export function useFormFields() {
...
@@ -113,7 +113,6 @@ export function useFormFields() {
}
}
export
type
UserTaskFormType
=
{
export
type
UserTaskFormType
=
{
//candidateParamArray: any[]
candidateStrategy
:
CandidateStrategy
candidateStrategy
:
CandidateStrategy
approveMethod
:
ApproveMethodType
approveMethod
:
ApproveMethodType
roleIds
?:
number
[]
// 角色
roleIds
?:
number
[]
// 角色
...
@@ -152,7 +151,6 @@ export type UserTaskFormType = {
...
@@ -152,7 +151,6 @@ export type UserTaskFormType = {
}
}
export
type
CopyTaskFormType
=
{
export
type
CopyTaskFormType
=
{
// candidateParamArray: any[]
candidateStrategy
:
CandidateStrategy
candidateStrategy
:
CandidateStrategy
roleIds
?:
number
[]
// 角色
roleIds
?:
number
[]
// 角色
deptIds
?:
number
[]
// 部门
deptIds
?:
number
[]
// 部门
...
...
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
View file @
42de3d91
...
@@ -26,13 +26,16 @@
...
@@ -26,13 +26,16 @@
</div>
</div>
</
template
>
</
template
>
<div>
<div>
<div
class=
"mb-3 font-size-16px"
v-if=
"currentNode.
defaultFlow"
<div
class=
"mb-3 font-size-16px"
v-if=
"currentNode.
conditionSetting?.defaultFlow"
>
>
未满足其它条件时,将进入此分支(该分支不可编辑和删除)
</div
未满足其它条件时,将进入此分支(该分支不可编辑和删除)
>
</div
>
<div
v-else
>
<div
v-else
>
<el-form
ref=
"formRef"
:model=
"currentNode"
:rules=
"formRules"
label-position=
"top"
>
<el-form
ref=
"formRef"
:model=
"currentNode
.conditionSetting
"
:rules=
"formRules"
label-position=
"top"
>
<el-form-item
label=
"配置方式"
prop=
"conditionType"
>
<el-form-item
label=
"配置方式"
prop=
"conditionType"
>
<el-radio-group
v-model=
"currentNode.conditionType"
@
change=
"changeConditionType"
>
<el-radio-group
v-model=
"currentNode.conditionSetting!.conditionType"
@
change=
"changeConditionType"
>
<el-radio
<el-radio
v-for=
"(dict, index) in conditionConfigTypes"
v-for=
"(dict, index) in conditionConfigTypes"
:key=
"index"
:key=
"index"
...
@@ -45,18 +48,21 @@
...
@@ -45,18 +48,21 @@
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
v-if=
"currentNode.condition
Type === 1
"
v-if=
"currentNode.condition
Setting?.conditionType === ConditionType.EXPRESSION
"
label=
"条件表达式"
label=
"条件表达式"
prop=
"conditionExpression"
prop=
"conditionExpression"
>
>
<el-input
<el-input
type=
"textarea"
type=
"textarea"
v-model=
"currentNode.conditionExpression"
v-model=
"currentNode.condition
Setting.condition
Expression"
clearable
clearable
style=
"width: 100%"
style=
"width: 100%"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"currentNode.conditionType === 2"
label=
"条件规则"
>
<el-form-item
v-if=
"currentNode.conditionSetting?.conditionType === ConditionType.RULE"
label=
"条件规则"
>
<div
class=
"condition-group-tool"
>
<div
class=
"condition-group-tool"
>
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<div
class=
"mr-4"
>
条件组关系
</div>
<div
class=
"mr-4"
>
条件组关系
</div>
...
@@ -194,9 +200,9 @@ const props = defineProps({
...
@@ -194,9 +200,9 @@ const props = defineProps({
})
})
const
settingVisible
=
ref
(
false
)
const
settingVisible
=
ref
(
false
)
const
open
=
()
=>
{
const
open
=
()
=>
{
if
(
currentNode
.
value
.
conditionType
===
ConditionType
.
RULE
)
{
if
(
currentNode
.
value
.
condition
Setting
?.
condition
Type
===
ConditionType
.
RULE
)
{
if
(
currentNode
.
value
.
conditionGroups
)
{
if
(
currentNode
.
value
.
condition
Setting
?.
condition
Groups
)
{
conditionGroups
.
value
=
currentNode
.
value
.
conditionGroups
conditionGroups
.
value
=
currentNode
.
value
.
condition
Setting
.
condition
Groups
}
}
}
}
settingVisible
.
value
=
true
settingVisible
.
value
=
true
...
@@ -219,7 +225,7 @@ const blurEvent = () => {
...
@@ -219,7 +225,7 @@ const blurEvent = () => {
showInput
.
value
=
false
showInput
.
value
=
false
currentNode
.
value
.
name
=
currentNode
.
value
.
name
=
currentNode
.
value
.
name
||
currentNode
.
value
.
name
||
getDefaultConditionNodeName
(
props
.
nodeIndex
,
currentNode
.
value
?.
defaultFlow
)
getDefaultConditionNodeName
(
props
.
nodeIndex
,
currentNode
.
value
?.
conditionSetting
?.
defaultFlow
)
}
}
const
currentNode
=
ref
<
SimpleFlowNode
>
(
props
.
conditionNode
)
const
currentNode
=
ref
<
SimpleFlowNode
>
(
props
.
conditionNode
)
...
@@ -248,7 +254,7 @@ const formRef = ref() // 表单 Ref
...
@@ -248,7 +254,7 @@ const formRef = ref() // 表单 Ref
// 保存配置
// 保存配置
const
saveConfig
=
async
()
=>
{
const
saveConfig
=
async
()
=>
{
if
(
!
currentNode
.
value
.
defaultFlow
)
{
if
(
!
currentNode
.
value
.
conditionSetting
?.
defaultFlow
)
{
// 校验表单
// 校验表单
if
(
!
formRef
)
return
false
if
(
!
formRef
)
return
false
const
valid
=
await
formRef
.
value
.
validate
()
const
valid
=
await
formRef
.
value
.
validate
()
...
@@ -258,12 +264,12 @@ const saveConfig = async () => {
...
@@ -258,12 +264,12 @@ const saveConfig = async () => {
return
false
return
false
}
}
currentNode
.
value
.
showText
=
showText
currentNode
.
value
.
showText
=
showText
if
(
currentNode
.
value
.
conditionType
===
ConditionType
.
EXPRESSION
)
{
if
(
currentNode
.
value
.
condition
Setting
?.
condition
Type
===
ConditionType
.
EXPRESSION
)
{
currentNode
.
value
.
conditionGroups
=
undefined
currentNode
.
value
.
condition
Setting
.
condition
Groups
=
undefined
}
}
if
(
currentNode
.
value
.
conditionType
===
ConditionType
.
RULE
)
{
if
(
currentNode
.
value
.
condition
Setting
?.
condition
Type
===
ConditionType
.
RULE
)
{
currentNode
.
value
.
conditionExpression
=
undefined
currentNode
.
value
.
condition
Setting
.
condition
Expression
=
undefined
currentNode
.
value
.
conditionGroups
=
conditionGroups
.
value
currentNode
.
value
.
condition
Setting
.
condition
Groups
=
conditionGroups
.
value
}
}
}
}
settingVisible
.
value
=
false
settingVisible
.
value
=
false
...
@@ -271,12 +277,12 @@ const saveConfig = async () => {
...
@@ -271,12 +277,12 @@ const saveConfig = async () => {
}
}
const
getShowText
=
():
string
=>
{
const
getShowText
=
():
string
=>
{
let
showText
=
''
let
showText
=
''
if
(
currentNode
.
value
.
conditionType
===
ConditionType
.
EXPRESSION
)
{
if
(
currentNode
.
value
.
condition
Setting
?.
condition
Type
===
ConditionType
.
EXPRESSION
)
{
if
(
currentNode
.
value
.
conditionExpression
)
{
if
(
currentNode
.
value
.
condition
Setting
.
condition
Expression
)
{
showText
=
`表达式:
${
currentNode
.
value
.
conditionExpression
}
`
showText
=
`表达式:
${
currentNode
.
value
.
condition
Setting
.
condition
Expression
}
`
}
}
}
}
if
(
currentNode
.
value
.
conditionType
===
ConditionType
.
RULE
)
{
if
(
currentNode
.
value
.
condition
Setting
?.
condition
Type
===
ConditionType
.
RULE
)
{
// 条件组是否为与关系
// 条件组是否为与关系
const
groupAnd
=
conditionGroups
.
value
.
and
const
groupAnd
=
conditionGroups
.
value
.
and
let
warningMesg
:
undefined
|
string
=
undefined
let
warningMesg
:
undefined
|
string
=
undefined
...
...
src/components/SimpleProcessDesignerV2/src/nodes/InclusiveNode.vue
View file @
42de3d91
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
]"
]"
>
>
<div
class=
"branch-node-title-container"
>
<div
class=
"branch-node-title-container"
>
<div
v-if=
"showInputs[index]"
>
<div
v-if=
"
!readonly &&
showInputs[index]"
>
<input
<input
type=
"text"
type=
"text"
class=
"editable-title-input"
class=
"editable-title-input"
...
...
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