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
2cc9652d
authored
Nov 21, 2024
by
芋道源码
Committed by
Gitee
Nov 21, 2024
Browse files
Options
Browse Files
Download
Plain Diff
!586 BPM模块的一些优化
Merge pull request !586 from Lesan/feature/bpm
parents
12bd71e7
eefabf34
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
105 additions
and
5 deletions
+105
-5
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
src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue
+3
-3
src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue
+1
-1
src/views/bpm/form/index.vue
+2
-1
No files found.
src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json
View file @
2cc9652d
...
@@ -1211,6 +1211,20 @@
...
@@ -1211,6 +1211,20 @@
"isAttr"
:
true
"isAttr"
:
true
}
}
]
]
},
{
"name"
:
"AssignStartUserHandlerType"
,
"superClass"
:
[
"Element"
],
"meta"
:
{
"allowedIn"
:
[
"bpmn:StartEvent"
,
"bpmn:UserTask"
]
},
"properties"
:
[
{
"name"
:
"value"
,
"type"
:
"Integer"
,
"isBody"
:
true
}
]
}
}
],
],
"emumerations"
:
[]
"emumerations"
:
[]
...
...
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
View file @
2cc9652d
...
@@ -54,6 +54,10 @@
...
@@ -54,6 +54,10 @@
<
template
#
title
><Icon
icon=
"ep:promotion"
/>
其他
</
template
>
<
template
#
title
><Icon
icon=
"ep:promotion"
/>
其他
</
template
>
<element-other-config
:id=
"elementId"
/>
<element-other-config
:id=
"elementId"
/>
</el-collapse-item>
</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>
</el-collapse>
</div>
</div>
</template>
</template>
...
...
src/components/bpmnProcessDesigner/package/penal/custom-config/ElementCustomConfig.vue
0 → 100644
View file @
2cc9652d
<
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
>
src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue
View file @
2cc9652d
...
@@ -268,9 +268,9 @@ const bpmnInstances = () => (window as any)?.bpmnInstances
...
@@ -268,9 +268,9 @@ const bpmnInstances = () => (window as any)?.bpmnInstances
const
resetFormList
=
()
=>
{
const
resetFormList
=
()
=>
{
bpmnELement
.
value
=
bpmnInstances
().
bpmnElement
bpmnELement
.
value
=
bpmnInstances
().
bpmnElement
formKey
.
value
=
bpmnELement
.
value
.
businessObject
.
formKey
formKey
.
value
=
bpmnELement
.
value
.
businessObject
.
formKey
if
(
formKey
.
value
?.
length
>
0
)
{
//
if (formKey.value?.length > 0) {
formKey
.
value
=
parseInt
(
formKey
.
value
)
//
formKey.value = parseInt(formKey.value)
}
//
}
// 获取元素扩展属性 或者 创建扩展属性
// 获取元素扩展属性 或者 创建扩展属性
elExtensionElements
.
value
=
elExtensionElements
.
value
=
bpmnELement
.
value
.
businessObject
.
get
(
'extensionElements'
)
||
bpmnELement
.
value
.
businessObject
.
get
(
'extensionElements'
)
||
...
...
src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue
View file @
2cc9652d
...
@@ -80,7 +80,7 @@ const resetAttributesList = () => {
...
@@ -80,7 +80,7 @@ const resetAttributesList = () => {
otherExtensionList
.
value
=
[]
// 其他扩展配置
otherExtensionList
.
value
=
[]
// 其他扩展配置
bpmnElementProperties
.
value
=
bpmnElementProperties
.
value
=
// bpmnElement.value.businessObject?.extensionElements?.filter((ex) => {
// bpmnElement.value.businessObject?.extensionElements?.filter((ex) => {
bpmnElement
.
value
.
businessObject
?.
extensionElements
?.
values
.
filter
((
ex
)
=>
{
bpmnElement
.
value
.
businessObject
?.
extensionElements
?.
values
?
.
filter
((
ex
)
=>
{
if
(
ex
.
$type
!==
`
${
prefix
}
:Properties`
)
{
if
(
ex
.
$type
!==
`
${
prefix
}
:Properties`
)
{
otherExtensionList
.
value
.
push
(
ex
)
otherExtensionList
.
value
.
push
(
ex
)
}
}
...
...
src/views/bpm/form/index.vue
View file @
2cc9652d
...
@@ -143,8 +143,9 @@ const openForm = (id?: number) => {
...
@@ -143,8 +143,9 @@ const openForm = (id?: number) => {
const
toRouter
:
{
name
:
string
;
query
?:
{
id
:
number
}
}
=
{
const
toRouter
:
{
name
:
string
;
query
?:
{
id
:
number
}
}
=
{
name
:
'BpmFormEditor'
name
:
'BpmFormEditor'
}
}
console
.
log
(
typeof
id
)
// 表单新建的时候id传的是event需要排除
// 表单新建的时候id传的是event需要排除
if
(
typeof
id
===
'number'
)
{
if
(
typeof
id
===
'number'
||
typeof
id
===
'string'
)
{
toRouter
.
query
=
{
toRouter
.
query
=
{
id
id
}
}
...
...
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