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
13e0ede7
authored
Jul 02, 2023
by
芋道源码
Committed by
Gitee
Jul 02, 2023
Browse files
Options
Browse Files
Download
Plain Diff
!155 fix: 处理 window.bpmnInstances 有时候为 undefined 问题
Merge pull request !155 from OlyLis/master
parents
c0bf357d
6b3de50c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
+20
-20
No files found.
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
View file @
13e0ede7
...
...
@@ -113,18 +113,18 @@ const timer = ref()
provide
(
'prefix'
,
props
.
prefix
)
provide
(
'width'
,
props
.
width
)
const
bpmnInstances
=
()
=>
(
window
as
any
)?.
bpmnInstances
const
initModels
=
()
=>
{
// console.log(props, 'props')
// console.log(props.bpmnModeler, 'sakdjjaskdsajdkasdjkadsjk')
// 初始化 modeler 以及其他 moddle
// nextTick(() => {
if
(
!
props
.
bpmnModeler
)
{
// 监听 props.bpmnModeler 然后 initModels
const
unwatchBpmn
=
watch
(
()
=>
props
.
bpmnModeler
,
()
=>
{
// 避免加载时 流程图 并未加载完成
timer
.
value
=
setTimeout
(()
=>
initModels
(),
10
)
return
}
if
(
timer
.
value
)
{
clearTimeout
(
timer
.
value
)
if
(
!
props
.
bpmnModeler
)
{
console
.
log
(
'缺少props.bpmnModeler'
)
return
}
console
.
log
(
'props.bpmnModeler 有值了!!!'
)
const
w
=
window
as
any
w
.
bpmnInstances
=
{
modeler
:
props
.
bpmnModeler
,
...
...
@@ -137,12 +137,16 @@ const initModels = () => {
replace
:
props
.
bpmnModeler
.
get
(
'replace'
),
selection
:
props
.
bpmnModeler
.
get
(
'selection'
)
}
console
.
log
(
bpmnInstances
(),
'window.bpmnInstances'
)
getActiveElement
()
unwatchBpmn
()
},
{
immediate
:
true
}
)
console
.
log
(
bpmnInstances
(),
'window.bpmnInstances'
)
getActiveElement
()
// })
}
const
getActiveElement
=
()
=>
{
// 初始第一个选中元素 bpmn:Process
initFormOnChanged
(
null
)
...
...
@@ -190,11 +194,7 @@ const initFormOnChanged = (element) => {
)
formVisible
.
value
=
elementType
.
value
===
'UserTask'
||
elementType
.
value
===
'StartEvent'
}
onMounted
(()
=>
{
setTimeout
(()
=>
{
initModels
()
},
100
)
})
onBeforeUnmount
(()
=>
{
const
w
=
window
as
any
w
.
bpmnInstances
=
null
...
...
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