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
eb6f3a3e
authored
Dec 04, 2024
by
Lesan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 通过ExtensionElements获取多实例类型
parent
175d6ba0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
26 deletions
+36
-26
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
+1
-1
src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTask.vue
+1
-1
src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue
+34
-24
No files found.
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
View file @
eb6f3a3e
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
key=
"multiInstance"
key=
"multiInstance"
>
>
<
template
#
title
><Icon
icon=
"ep:help-filled"
/>
多实例(会签配置)
</
template
>
<
template
#
title
><Icon
icon=
"ep:help-filled"
/>
多实例(会签配置)
</
template
>
<element-multi-instance
:business-object=
"elementBusinessObject"
:type=
"elementType"
/>
<element-multi-instance
:
id=
"elementId"
:
business-object=
"elementBusinessObject"
:type=
"elementType"
/>
</el-collapse-item>
</el-collapse-item>
<el-collapse-item
name=
"listeners"
key=
"listeners"
>
<el-collapse-item
name=
"listeners"
key=
"listeners"
>
<
template
#
title
><Icon
icon=
"ep:bell-filled"
/>
执行监听器
</
template
>
<
template
#
title
><Icon
icon=
"ep:bell-filled"
/>
执行监听器
</
template
>
...
...
src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTask.vue
View file @
eb6f3a3e
...
@@ -246,7 +246,7 @@ const resetCustomConfigList = () => {
...
@@ -246,7 +246,7 @@ const resetCustomConfigList = () => {
elExtensionElements
.
value
.
values
?.
filter
(
elExtensionElements
.
value
.
values
?.
filter
(
(
ex
)
=>
ex
.
$type
===
`
${
prefix
}
:AssignEmptyUserIds`
(
ex
)
=>
ex
.
$type
===
`
${
prefix
}
:AssignEmptyUserIds`
)?.[
0
]
||
bpmnInstances
().
moddle
.
create
(
`
${
prefix
}
:AssignEmptyUserIds`
,
{
value
:
''
})
)?.[
0
]
||
bpmnInstances
().
moddle
.
create
(
`
${
prefix
}
:AssignEmptyUserIds`
,
{
value
:
''
})
assignEmptyUserIds
.
value
=
assignEmptyUserIdsEl
.
value
.
value
.
split
(
','
).
map
((
item
)
=>
{
assignEmptyUserIds
.
value
=
assignEmptyUserIdsEl
.
value
.
value
?
.
split
(
','
).
map
((
item
)
=>
{
// 如果数字超出了最大安全整数范围,则将其作为字符串处理
// 如果数字超出了最大安全整数范围,则将其作为字符串处理
let
num
=
Number
(
item
)
let
num
=
Number
(
item
)
return
num
>
Number
.
MAX_SAFE_INTEGER
||
num
<
-
Number
.
MAX_SAFE_INTEGER
?
item
:
num
return
num
>
Number
.
MAX_SAFE_INTEGER
||
num
<
-
Number
.
MAX_SAFE_INTEGER
?
item
:
num
...
...
src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue
View file @
eb6f3a3e
...
@@ -106,7 +106,8 @@ defineOptions({ name: 'ElementMultiInstance' })
...
@@ -106,7 +106,8 @@ defineOptions({ name: 'ElementMultiInstance' })
const
props
=
defineProps
({
const
props
=
defineProps
({
businessObject
:
Object
,
businessObject
:
Object
,
type
:
String
type
:
String
,
id
:
String
})
})
const
prefix
=
inject
(
'prefix'
)
const
prefix
=
inject
(
'prefix'
)
const
loopCharacteristics
=
ref
(
''
)
const
loopCharacteristics
=
ref
(
''
)
...
@@ -296,25 +297,17 @@ const changeConfig = (config) => {
...
@@ -296,25 +297,17 @@ const changeConfig = (config) => {
/**
/**
* -----新版本多实例-----
* -----新版本多实例-----
*/
*/
const
approveMethod
=
ref
(
1
)
const
approveMethod
=
ref
()
const
approveRatio
=
ref
(
100
)
const
approveRatio
=
ref
(
100
)
const
getElementLoopNew
=
({
loopCharacteristics
})
=>
{
const
otherExtensions
=
ref
()
if
(
!
loopCharacteristics
)
{
const
getElementLoopNew
=
()
=>
{
approveMethod
.
value
=
ApproveMethodType
.
RANDOM_SELECT_ONE_APPROVE
const
extensionElements
=
bpmnElement
.
value
.
businessObject
?.
extensionElements
??
[]
return
approveMethod
.
value
=
extensionElements
.
values
.
filter
(
}
(
ex
)
=>
ex
.
$type
===
`
${
prefix
}
:ApproveMethod`
if
(
loopCharacteristics
.
isSequential
)
{
)?.[
0
]?.
value
approveMethod
.
value
=
ApproveMethodType
.
SEQUENTIAL_APPROVE
}
else
{
otherExtensions
.
value
=
if
(
loopCharacteristics
.
completionCondition
.
body
===
'${ nrOfCompletedInstances > 0 }'
)
{
extensionElements
.
values
.
filter
((
ex
)
=>
ex
.
$type
!==
`
${
prefix
}
:ApproveMethod`
)
??
[]
approveMethod
.
value
=
ApproveMethodType
.
ANY_APPROVE
}
if
(
loopCharacteristics
.
completionCondition
.
body
.
includes
(
'nrOfCompletedInstances/nrOfInstances'
)
)
{
approveMethod
.
value
=
ApproveMethodType
.
APPROVE_BY_RATIO
}
}
}
}
const
onApproveMethodChange
=
()
=>
{
const
onApproveMethodChange
=
()
=>
{
approveRatio
.
value
=
100
approveRatio
.
value
=
100
...
@@ -324,12 +317,12 @@ const onApproveRatioChange = () => {
...
@@ -324,12 +317,12 @@ const onApproveRatioChange = () => {
updateLoopCharacteristics
()
updateLoopCharacteristics
()
}
}
const
updateLoopCharacteristics
=
()
=>
{
const
updateLoopCharacteristics
=
()
=>
{
// 根据ApproveMethod生成multiInstanceLoopCharacteristics节点
if
(
approveMethod
.
value
===
ApproveMethodType
.
RANDOM_SELECT_ONE_APPROVE
)
{
if
(
approveMethod
.
value
===
ApproveMethodType
.
RANDOM_SELECT_ONE_APPROVE
)
{
bpmnInstances
().
modeling
.
updateProperties
(
toRaw
(
bpmnElement
.
value
),
{
bpmnInstances
().
modeling
.
updateProperties
(
toRaw
(
bpmnElement
.
value
),
{
loopCharacteristics
:
null
loopCharacteristics
:
null
})
})
return
}
else
{
}
if
(
approveMethod
.
value
===
ApproveMethodType
.
APPROVE_BY_RATIO
)
{
if
(
approveMethod
.
value
===
ApproveMethodType
.
APPROVE_BY_RATIO
)
{
multiLoopInstance
.
value
=
bpmnInstances
().
moddle
.
create
(
multiLoopInstance
.
value
=
bpmnInstances
().
moddle
.
create
(
'bpmn:MultiInstanceLoopCharacteristics'
,
'bpmn:MultiInstanceLoopCharacteristics'
,
...
@@ -372,10 +365,23 @@ const updateLoopCharacteristics = () => {
...
@@ -372,10 +365,23 @@ const updateLoopCharacteristics = () => {
}
}
)
)
}
}
bpmnInstances
().
modeling
.
updateProperties
(
toRaw
(
bpmnElement
.
value
),
{
bpmnInstances
().
modeling
.
updateProperties
(
toRaw
(
bpmnElement
.
value
),
{
loopCharacteristics
:
toRaw
(
multiLoopInstance
.
value
)
loopCharacteristics
:
toRaw
(
multiLoopInstance
.
value
)
})
})
}
// 添加ApproveMethod到ExtensionElements
const
extensions
=
bpmnInstances
().
moddle
.
create
(
'bpmn:ExtensionElements'
,
{
values
:
[
...
otherExtensions
.
value
,
bpmnInstances
().
moddle
.
create
(
`
${
prefix
}
:ApproveMethod`
,
{
value
:
approveMethod
.
value
})
]
})
bpmnInstances
().
modeling
.
updateProperties
(
toRaw
(
bpmnElement
.
value
),
{
extensionElements
:
extensions
})
}
}
onBeforeUnmount
(()
=>
{
onBeforeUnmount
(()
=>
{
...
@@ -384,11 +390,15 @@ onBeforeUnmount(() => {
...
@@ -384,11 +390,15 @@ onBeforeUnmount(() => {
})
})
watch
(
watch
(
()
=>
props
.
businessObject
,
()
=>
props
.
id
,
(
val
)
=>
{
(
val
)
=>
{
if
(
val
)
{
nextTick
(()
=>
{
bpmnElement
.
value
=
bpmnInstances
().
bpmnElement
bpmnElement
.
value
=
bpmnInstances
().
bpmnElement
// getElementLoop(val)
// getElementLoop(val)
getElementLoopNew
(
val
)
getElementLoopNew
()
})
}
},
},
{
immediate
:
true
}
{
immediate
:
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