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
eefabf34
authored
Nov 17, 2024
by
LesanOuO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: bpmn设计器添加assignStartUserHandlerType适配Simple模式
parent
6ac0ee58
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
0 deletions
+99
-0
src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json
+14
-0
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
+4
-0
src/components/bpmnProcessDesigner/package/penal/custom-config/ElementCustomConfig.vue
+81
-0
No files found.
src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json
View file @
eefabf34
...
...
@@ -1211,6 +1211,20 @@
"isAttr"
:
true
}
]
},
{
"name"
:
"AssignStartUserHandlerType"
,
"superClass"
:
[
"Element"
],
"meta"
:
{
"allowedIn"
:
[
"bpmn:StartEvent"
,
"bpmn:UserTask"
]
},
"properties"
:
[
{
"name"
:
"value"
,
"type"
:
"Integer"
,
"isBody"
:
true
}
]
}
],
"emumerations"
:
[]
...
...
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
View file @
eefabf34
...
...
@@ -54,6 +54,10 @@
<
template
#
title
><Icon
icon=
"ep:promotion"
/>
其他
</
template
>
<element-other-config
:id=
"elementId"
/>
</el-collapse-item>
<el-collapse-item
name=
"customConfig"
v-if=
"elementType.indexOf('Task') !== -1"
key=
"customConfig"
>
<
template
#
title
><Icon
icon=
"ep:circle-plus-filled"
/>
自定义配置
</
template
>
<element-custom-config
:id=
"elementId"
:type=
"elementType"
/>
</el-collapse-item>
</el-collapse>
</div>
</template>
...
...
src/components/bpmnProcessDesigner/package/penal/custom-config/ElementCustomConfig.vue
0 → 100644
View file @
eefabf34
<
template
>
<div
class=
"panel-tab__content"
>
<el-divider
content-position=
"left"
>
审批人与提交人为同一人时
</el-divider>
<el-radio-group
v-model=
"assignStartUserHandlerType"
@
change=
"updateAssignStartUserHandlerType"
>
<div
class=
"flex-col"
>
<div
v-for=
"(item, index) in ASSIGN_START_USER_HANDLER_TYPES"
:key=
"index"
>
<el-radio
:key=
"item.value"
:value=
"item.value"
:label=
"item.label"
/>
</div>
</div>
</el-radio-group>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ASSIGN_START_USER_HANDLER_TYPES
}
from
'../../../../SimpleProcessDesignerV2/src/consts'
defineOptions
({
name
:
'ElementCustomConfig'
})
const
props
=
defineProps
({
id
:
String
,
type
:
String
})
const
prefix
=
inject
(
'prefix'
)
const
elExtensionElements
=
ref
()
const
assignStartUserHandlerTypeEl
=
ref
()
const
assignStartUserHandlerType
=
ref
()
const
otherExtensions
=
ref
()
const
bpmnElement
=
ref
()
const
bpmnInstances
=
()
=>
(
window
as
any
)?.
bpmnInstances
const
resetAttributesList
=
()
=>
{
bpmnElement
.
value
=
bpmnInstances
().
bpmnElement
// 获取元素扩展属性 或者 创建扩展属性
elExtensionElements
.
value
=
bpmnElement
.
value
.
businessObject
?.
extensionElements
??
bpmnInstances
().
moddle
.
create
(
'bpmn:ExtensionElements'
,
{
values
:
[]
})
assignStartUserHandlerTypeEl
.
value
=
elExtensionElements
.
value
.
values
?.
filter
(
(
ex
)
=>
ex
.
$type
===
`
${
prefix
}
:AssignStartUserHandlerType`
)?.[
0
]
||
bpmnInstances
().
moddle
.
create
(
`
${
prefix
}
:AssignStartUserHandlerType`
,
{
value
:
1
})
assignStartUserHandlerType
.
value
=
assignStartUserHandlerTypeEl
.
value
.
value
// 保留剩余扩展元素,便于后面更新该元素对应属性
otherExtensions
.
value
=
elExtensionElements
.
value
.
values
?.
filter
(
(
ex
)
=>
ex
.
$type
!==
`
${
prefix
}
:AssignStartUserHandlerType`
)
??
[]
// 更新元素扩展属性,避免后续报错
updateElementExtensions
()
}
const
updateAssignStartUserHandlerType
=
()
=>
{
assignStartUserHandlerTypeEl
.
value
.
value
=
assignStartUserHandlerType
.
value
updateElementExtensions
()
}
const
updateElementExtensions
=
(
properties
)
=>
{
const
extensions
=
bpmnInstances
().
moddle
.
create
(
'bpmn:ExtensionElements'
,
{
values
:
otherExtensions
.
value
.
concat
([
assignStartUserHandlerTypeEl
.
value
])
})
bpmnInstances
().
modeling
.
updateProperties
(
toRaw
(
bpmnElement
.
value
),
{
extensionElements
:
extensions
})
}
watch
(
()
=>
props
.
id
,
(
val
)
=>
{
val
&&
val
.
length
&&
nextTick
(()
=>
{
resetAttributesList
()
})
},
{
immediate
:
true
}
)
</
script
>
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