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
9c9f09fb
authored
Feb 24, 2025
by
Lesan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 代码审查修改
parent
357955ce
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
60 deletions
+53
-60
src/assets/svgs/bpm/async-child-process.svg
+0
-2
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
+2
-8
src/components/SimpleProcessDesignerV2/src/consts.ts
+6
-11
src/components/SimpleProcessDesignerV2/src/nodes-config/ChildProcessNodeConfig.vue
+44
-33
src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
+1
-2
src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
+0
-4
No files found.
src/assets/svgs/bpm/async-child-process.svg
deleted
100644 → 0
View file @
357955ce
<svg
t=
"1740116978908"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"1356"
width=
"200"
height=
"200"
><path
d=
"M860.544 633.856c-82.368 0-152.128 69.632-158.464 152h-354.88c-31.616 0-63.296-31.68-63.296-63.296V437.376c12.608 0 25.344 6.4 44.288 6.4h380.16c12.672 69.696 76.032 126.656 152.128 126.656 88.704 0 158.336-69.696 158.336-158.4s-69.632-158.4-158.336-158.4c-76.096 0-139.456 57.024-152.128 126.656h-361.216c-31.616 0-63.296-31.68-63.296-63.296v-133.12h164.736c31.68 0 63.296-22.848 63.296-54.528a55.04 55.04 0 0 0-56-56h-380.16c-31.68 0-70.72 17.984-70.72 56s31.68 54.528 63.36 54.528h133.056v538.624c0 69.696 57.088 126.656 126.72 126.656h386.56c25.344 57.088 82.368 101.376 145.728 101.376a156.8 156.8 0 0 0 158.336-158.4 156.608 156.608 0 0 0-158.208-158.272z m0-316.8c50.624 0 94.912 44.288 94.912 94.976s-44.288 94.976-94.912 94.976c-50.752 0-95.104-44.288-95.104-94.976s44.352-94.976 95.104-94.976z m0 570.24c-50.752 0-95.104-44.352-95.104-95.04s44.352-95.04 95.104-95.04c50.624 0 94.912 44.352 94.912 95.04s-44.288 95.04-94.912 95.04z"
p-id=
"1357"
fill=
"#ffffff"
></path></svg>
\ No newline at end of file
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
View file @
9c9f09fb
...
...
@@ -69,12 +69,6 @@
</div>
<div
class=
"handler-item-text"
>
子流程
</div>
</div>
<div
class=
"handler-item"
@
click=
"addNode(NodeType.ASYNC_CHILD_PROCESS_NODE)"
>
<div
class=
"handler-item-icon async-child-process"
>
<span
class=
"iconfont icon-size icon-async-child-process"
></span>
</div>
<div
class=
"handler-item-text"
>
异步子流程
</div>
</div>
</div>
<template
#
reference
>
<div
class=
"add-icon"
><Icon
icon=
"ep:plus"
/></div>
...
...
@@ -303,8 +297,8 @@ const addNode = (type: number) => {
type
:
NodeType
.
CHILD_PROCESS_NODE
,
childNode
:
props
.
childNode
,
childProcessSetting
:
{
called
Element
:
''
,
called
Element
Name
:
''
,
called
ProcessDefinitionKey
:
''
,
called
ProcessDefinition
Name
:
''
,
async
:
false
,
skipStartUserNode
:
false
,
startUserSetting
:
{
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
9c9f09fb
...
...
@@ -39,16 +39,11 @@ export enum NodeType {
TRIGGER_NODE
=
15
,
/**
*
触发器
节点
*
子流程
节点
*/
CHILD_PROCESS_NODE
=
20
,
/**
* 触发器节点
*/
ASYNC_CHILD_PROCESS_NODE
=
21
,
/**
* 条件节点
*/
CONDITION_NODE
=
50
,
...
...
@@ -804,11 +799,11 @@ export const TRIGGER_TYPES: DictDataVO[] = [
* 子流程节点结构定义
*/
export
type
ChildProcessSetting
=
{
called
Element
:
string
called
Element
Name
:
string
called
ProcessDefinitionKey
:
string
called
ProcessDefinition
Name
:
string
async
:
boolean
,
inVariable
?:
IOParameter
[],
outVariable
?:
IOParameter
[],
inVariable
s
?:
IOParameter
[],
outVariable
s
?:
IOParameter
[],
skipStartUserNode
:
boolean
,
startUserSetting
:
StartUserSetting
,
}
...
...
@@ -823,5 +818,5 @@ export type IOParameter = {
export
type
StartUserSetting
=
{
type
:
number
formField
?:
string
empty
Handle
Type
?:
number
emptyType
?:
number
}
src/components/SimpleProcessDesignerV2/src/nodes-config/ChildProcessNodeConfig.vue
View file @
9c9f09fb
...
...
@@ -27,9 +27,16 @@
<el-tab-pane
label=
"子流程"
name=
"child"
>
<div>
<el-form
ref=
"formRef"
:model=
"configForm"
label-position=
"top"
:rules=
"formRules"
>
<el-form-item
label=
"选择子流程"
prop=
"calledElement"
>
<el-form-item
label=
"是否异步"
prop=
"async"
>
<el-switch
v-model=
"configForm.async"
active-text=
"异步"
inactive-text=
"不异步"
/>
</el-form-item>
<el-form-item
label=
"选择子流程"
prop=
"calledProcessDefinitionKey"
>
<el-select
v-model=
"configForm.called
Element
"
v-model=
"configForm.called
ProcessDefinitionKey
"
clearable
@
change=
"handleCalledElementChange"
>
...
...
@@ -48,11 +55,11 @@
inactive-text=
"不跳过"
/>
</el-form-item>
<el-form-item
label=
"主→子变量传递"
prop=
"inVariable"
>
<div
class=
"flex pt-2"
v-for=
"(item, index) in configForm.inVariable"
:key=
"index"
>
<el-form-item
label=
"主→子变量传递"
prop=
"inVariable
s
"
>
<div
class=
"flex pt-2"
v-for=
"(item, index) in configForm.inVariable
s
"
:key=
"index"
>
<div
class=
"mr-2"
>
<el-form-item
:prop=
"`inVariable.${index}.source`"
:prop=
"`inVariable
s
.${index}.source`"
:rules=
"{
required: true,
message: '变量不能为空',
...
...
@@ -71,7 +78,7 @@
</div>
<div
class=
"mr-2"
>
<el-form-item
:prop=
"`inVariable.${index}.target`"
:prop=
"`inVariable
s
.${index}.target`"
:rules=
"{
required: true,
message: '变量不能为空',
...
...
@@ -92,23 +99,23 @@
<Icon
icon=
"ep:delete"
:size=
"18"
@
click=
"deleteVariable(configForm.inVariable, index)"
@
click=
"deleteVariable(configForm.inVariable
s
, index)"
/>
</div>
</div>
<el-button
type=
"primary"
text
@
click=
"addVariable(configForm.inVariable)"
>
<el-button
type=
"primary"
text
@
click=
"addVariable(configForm.inVariable
s
)"
>
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
添加一行
</el-button>
</el-form-item>
<el-form-item
v-if=
"c
urrentNode.childProcessSetting?
.async === false"
v-if=
"c
onfigForm
.async === false"
label=
"子→主变量传递"
prop=
"outVariable"
prop=
"outVariable
s
"
>
<div
class=
"flex pt-2"
v-for=
"(item, index) in configForm.outVariable"
:key=
"index"
>
<div
class=
"flex pt-2"
v-for=
"(item, index) in configForm.outVariable
s
"
:key=
"index"
>
<div
class=
"mr-2"
>
<el-form-item
:prop=
"`outVariable.${index}.source`"
:prop=
"`outVariable
s
.${index}.source`"
:rules=
"{
required: true,
message: '变量不能为空',
...
...
@@ -127,7 +134,7 @@
</div>
<div
class=
"mr-2"
>
<el-form-item
:prop=
"`outVariable.${index}.target`"
:prop=
"`outVariable
s
.${index}.target`"
:rules=
"{
required: true,
message: '变量不能为空',
...
...
@@ -148,11 +155,11 @@
<Icon
icon=
"ep:delete"
:size=
"18"
@
click=
"deleteVariable(configForm.outVariable, index)"
@
click=
"deleteVariable(configForm.outVariable
s
, index)"
/>
</div>
</div>
<el-button
type=
"primary"
text
@
click=
"addVariable(configForm.outVariable)"
>
<el-button
type=
"primary"
text
@
click=
"addVariable(configForm.outVariable
s
)"
>
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
添加一行
</el-button>
</el-form-item>
...
...
@@ -227,7 +234,8 @@ const activeTabName = ref('child')
const
formRef
=
ref
()
// 表单 Ref
// 表单校验规则
const
formRules
=
reactive
({
calledElement
:
[{
required
:
true
,
message
:
'子流程不能为空'
,
trigger
:
'change'
}],
async
:
[{
required
:
true
,
message
:
'是否异步不能为空'
,
trigger
:
'change'
}],
calledProcessDefinitionKey
:
[{
required
:
true
,
message
:
'子流程不能为空'
,
trigger
:
'change'
}],
skipStartUserNode
:
[
{
required
:
true
,
message
:
'是否自动跳过子流程发起节点不能为空'
,
trigger
:
'change'
}
],
...
...
@@ -238,10 +246,10 @@ const formRules = reactive({
startUserFormField
:
[{
required
:
true
,
message
:
'发起人表单不能为空'
,
trigger
:
'change'
}]
})
const
configForm
=
ref
({
called
Element
:
''
,
called
ProcessDefinitionKey
:
''
,
skipStartUserNode
:
false
,
inVariable
:
[],
outVariable
:
[],
inVariable
s
:
[],
outVariable
s
:
[],
startUserType
:
1
,
startUserEmptyType
:
1
,
startUserFormField
:
''
...
...
@@ -257,17 +265,18 @@ const saveConfig = async () => {
const
valid
=
await
formRef
.
value
.
validate
()
if
(
!
valid
)
return
false
const
childInfo
=
childProcessOptions
.
value
.
find
(
(
option
)
=>
option
.
key
===
configForm
.
value
.
called
Element
(
option
)
=>
option
.
key
===
configForm
.
value
.
called
ProcessDefinitionKey
)
currentNode
.
value
.
name
=
nodeName
.
value
!
if
(
currentNode
.
value
.
childProcessSetting
)
{
currentNode
.
value
.
childProcessSetting
.
calledElement
=
childInfo
.
key
currentNode
.
value
.
childProcessSetting
.
calledElementName
=
childInfo
.
name
currentNode
.
value
.
childProcessSetting
.
async
=
configForm
.
value
.
async
currentNode
.
value
.
childProcessSetting
.
calledProcessDefinitionKey
=
childInfo
.
key
currentNode
.
value
.
childProcessSetting
.
calledProcessDefinitionName
=
childInfo
.
name
currentNode
.
value
.
childProcessSetting
.
skipStartUserNode
=
configForm
.
value
.
skipStartUserNode
currentNode
.
value
.
childProcessSetting
.
inVariable
=
configForm
.
value
.
inVariable
currentNode
.
value
.
childProcessSetting
.
outVariable
=
configForm
.
value
.
outVariable
currentNode
.
value
.
childProcessSetting
.
inVariable
s
=
configForm
.
value
.
inVariables
currentNode
.
value
.
childProcessSetting
.
outVariable
s
=
configForm
.
value
.
outVariables
currentNode
.
value
.
childProcessSetting
.
startUserSetting
.
type
=
configForm
.
value
.
startUserType
currentNode
.
value
.
childProcessSetting
.
startUserSetting
.
empty
Handle
Type
=
currentNode
.
value
.
childProcessSetting
.
startUserSetting
.
emptyType
=
configForm
.
value
.
startUserEmptyType
currentNode
.
value
.
childProcessSetting
.
startUserSetting
.
formField
=
configForm
.
value
.
startUserFormField
...
...
@@ -280,13 +289,15 @@ const saveConfig = async () => {
const
showChildProcessNodeConfig
=
(
node
:
SimpleFlowNode
)
=>
{
nodeName
.
value
=
node
.
name
if
(
node
.
childProcessSetting
)
{
configForm
.
value
.
calledElement
=
node
.
childProcessSetting
.
calledElement
configForm
.
value
.
async
=
node
.
childProcessSetting
.
async
configForm
.
value
.
calledProcessDefinitionKey
=
node
.
childProcessSetting
.
calledProcessDefinitionKey
configForm
.
value
.
skipStartUserNode
=
node
.
childProcessSetting
.
skipStartUserNode
configForm
.
value
.
inVariable
=
node
.
childProcessSetting
.
inVariable
configForm
.
value
.
outVariable
=
node
.
childProcessSetting
.
outVariable
configForm
.
value
.
inVariable
s
=
node
.
childProcessSetting
.
inVariables
configForm
.
value
.
outVariable
s
=
node
.
childProcessSetting
.
outVariables
configForm
.
value
.
startUserType
=
node
.
childProcessSetting
.
startUserSetting
.
type
configForm
.
value
.
startUserEmptyType
=
node
.
childProcessSetting
.
startUserSetting
.
emptyHandleType
??
1
configForm
.
value
.
startUserEmptyType
=
node
.
childProcessSetting
.
startUserSetting
.
emptyType
??
1
configForm
.
value
.
startUserFormField
=
node
.
childProcessSetting
.
startUserSetting
.
formField
??
''
}
loadFormInfo
()
...
...
@@ -304,13 +315,13 @@ const deleteVariable = (arr, index: number) => {
arr
.
splice
(
index
,
1
)
}
const
handleCalledElementChange
=
()
=>
{
configForm
.
value
.
inVariable
=
[]
configForm
.
value
.
outVariable
=
[]
configForm
.
value
.
inVariable
s
=
[]
configForm
.
value
.
outVariable
s
=
[]
loadFormInfo
()
}
const
loadFormInfo
=
async
()
=>
{
const
childInfo
=
childProcessOptions
.
value
.
find
(
(
option
)
=>
option
.
key
===
configForm
.
value
.
called
Element
(
option
)
=>
option
.
key
===
configForm
.
value
.
called
ProcessDefinitionKey
)
const
formInfo
=
await
getForm
(
childInfo
.
formId
)
childFormFieldOptions
.
value
=
[]
...
...
src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
View file @
9c9f09fb
...
...
@@ -86,8 +86,7 @@ const setSimpleModelNodeTaskStatus = (
simpleModel
.
type
===
NodeType
.
START_USER_NODE
||
simpleModel
.
type
===
NodeType
.
USER_TASK_NODE
||
simpleModel
.
type
===
NodeType
.
TRANSACTOR_NODE
||
simpleModel
.
type
===
NodeType
.
CHILD_PROCESS_NODE
||
simpleModel
.
type
===
NodeType
.
ASYNC_CHILD_PROCESS_NODE
simpleModel
.
type
===
NodeType
.
CHILD_PROCESS_NODE
)
{
simpleModel
.
activityStatus
=
TaskStatusEnum
.
NOT_START
if
(
rejectedTaskActivityIds
.
includes
(
simpleModel
.
id
))
{
...
...
src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
View file @
9c9f09fb
...
...
@@ -182,7 +182,6 @@ import parallelSvg from '@/assets/svgs/bpm/parallel.svg'
import
finishSvg
from
'@/assets/svgs/bpm/finish.svg'
import
transactorSvg
from
'@/assets/svgs/bpm/transactor.svg'
import
childProcessSvg
from
'@/assets/svgs/bpm/child-process.svg'
import
asyncChildProcessSvg
from
'@/assets/svgs/bpm/async-child-process.svg'
defineOptions
({
name
:
'BpmProcessInstanceTimeline'
})
withDefaults
(
...
...
@@ -254,8 +253,6 @@ const nodeTypeSvgMap = {
[
NodeType
.
PARALLEL_BRANCH_NODE
]:
{
color
:
'#14bb83'
,
svg
:
parallelSvg
},
// 子流程节点
[
NodeType
.
CHILD_PROCESS_NODE
]:
{
color
:
'#14bb83'
,
svg
:
childProcessSvg
},
// 异步子流程节点
[
NodeType
.
ASYNC_CHILD_PROCESS_NODE
]:
{
color
:
'#14bb83'
,
svg
:
asyncChildProcessSvg
}
}
// 只有只有状态是 -1、0、1 才展示头像右小角状态小icon
...
...
@@ -276,7 +273,6 @@ const getApprovalNodeIcon = (taskStatus: number, nodeType: NodeType) => {
nodeType
===
NodeType
.
USER_TASK_NODE
||
nodeType
===
NodeType
.
TRANSACTOR_NODE
||
nodeType
===
NodeType
.
CHILD_PROCESS_NODE
||
nodeType
===
NodeType
.
ASYNC_CHILD_PROCESS_NODE
||
nodeType
===
NodeType
.
END_EVENT_NODE
)
{
return
statusIconMap
[
taskStatus
]?.
icon
...
...
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