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
8665d0a4
authored
Jun 15, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review:【BPM 工作流】
https://github.com/yudaocode/yudao-ui-admin-vue3/pull/153/files
parent
9ee8f8e1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
43 deletions
+87
-43
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
+5
-11
src/components/bpmnProcessDesigner/package/penal/time-event-config/CycleConfig.vue
+0
-0
src/components/bpmnProcessDesigner/package/penal/time-event-config/DurationConfig.vue
+27
-7
src/components/bpmnProcessDesigner/package/penal/time-event-config/TimeEventConfig.vue
+55
-25
No files found.
src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
View file @
8665d0a4
...
...
@@ -88,8 +88,8 @@ import ElementProperties from './properties/ElementProperties.vue'
// import ElementForm from './form/ElementForm.vue'
import
UserTaskListeners
from
'./listeners/UserTaskListeners.vue'
import
{
getTaskCollapseItemName
,
isTaskCollapseItemShow
}
from
'./task/data'
import
TimeEventConfig
from
"./time-event-config/TimeEventConfig.vue"
import
{
ref
,
computed
,
watch
,
onMounted
}
from
'vue'
import
TimeEventConfig
from
'./time-event-config/TimeEventConfig.vue'
import
{
ref
,
watch
,
onMounted
}
from
'vue'
defineOptions
({
name
:
'MyPropertiesPanel'
})
...
...
@@ -150,7 +150,7 @@ const initBpmnInstances = () => {
}
// 检查所有实例是否都存在
const
allInstancesExist
=
Object
.
values
(
instances
).
every
(
instance
=>
instance
)
const
allInstancesExist
=
Object
.
values
(
instances
).
every
(
(
instance
)
=>
instance
)
if
(
allInstancesExist
)
{
const
w
=
window
as
any
w
.
bpmnInstances
=
instances
...
...
@@ -283,15 +283,9 @@ function updateNode() {
timerDef
.
timeCycle
=
moddle
.
create
(
'bpmn:FormalExpression'
,
{
body
:
condition
.
value
})
}
modeling
.
updateModdleProperties
(
element
,
element
.
businessObject
,
{
modeling
.
updateModdleProperties
(
element
,
element
.
businessObject
,
{
eventDefinitions
:
[
timerDef
]
}
)
console
.
log
(
'当前eventDefinitions:'
,
element
.
businessObject
.
eventDefinitions
)
})
}
// 初始化和监听
...
...
src/components/bpmnProcessDesigner/package/penal/time-event-config/CycleConfig.vue
View file @
8665d0a4
This diff is collapsed.
Click to expand it.
src/components/bpmnProcessDesigner/package/penal/time-event-config/DurationConfig.vue
View file @
8665d0a4
<
template
>
<div>
<div
style=
"margin-bottom: 10px;"
>
当前选择:
<el-input
v-model=
"isoString"
readonly
style=
"width: 300px;"
/></div>
<div
v-for=
"unit in units"
:key=
"unit.key"
style=
"margin-bottom: 8px;"
>
<div
style=
"margin-bottom: 10px"
>
当前选择:
<el-input
v-model=
"isoString"
readonly
style=
"width: 300px"
/></div>
<div
v-for=
"unit in units"
:key=
"unit.key"
style=
"margin-bottom: 8px"
>
<span>
{{
unit
.
label
}}
:
</span>
<el-button-group>
<el-button
v-for=
"val in unit.presets"
:key=
"val"
size=
"mini"
@
click=
"setUnit(unit.key, val)"
>
{{
val
}}
</el-button>
<el-input
v-model
.
number=
"custom[unit.key]"
size=
"mini"
style=
"width: 60px; margin-left: 8px;"
placeholder=
"自定义"
@
change=
"setUnit(unit.key, custom[unit.key])"
/>
<el-button
v-for=
"val in unit.presets"
:key=
"val"
size=
"mini"
@
click=
"setUnit(unit.key, val)"
>
{{
val
}}
</el-button
>
<el-input
v-model
.
number=
"custom[unit.key]"
size=
"mini"
style=
"width: 60px; margin-left: 8px"
placeholder=
"自定义"
@
change=
"setUnit(unit.key, custom[unit.key])"
/>
</el-button-group>
</div>
</div>
...
...
@@ -49,10 +63,14 @@ function updateIsoString() {
emit
(
'change'
,
isoString
.
value
)
}
watch
(()
=>
props
.
value
,
(
val
)
=>
{
watch
(
()
=>
props
.
value
,
(
val
)
=>
{
if
(
!
val
)
return
// 解析ISO 8601字符串到custom
const
match
=
val
.
match
(
/^P
(?:(\d
+
)
Y
)?(?:(\d
+
)
M
)?(?:(\d
+
)
D
)?(?:
T
(?:(\d
+
)
H
)?(?:(\d
+
)
M
)?(?:(\d
+
)
S
)?)?
$/
)
const
match
=
val
.
match
(
/^P
(?:(\d
+
)
Y
)?(?:(\d
+
)
M
)?(?:(\d
+
)
D
)?(?:
T
(?:(\d
+
)
H
)?(?:(\d
+
)
M
)?(?:(\d
+
)
S
)?)?
$/
)
if
(
match
)
{
custom
.
value
.
Y
=
match
[
1
]
||
''
custom
.
value
.
M
=
match
[
2
]
||
''
...
...
@@ -62,5 +80,7 @@ watch(() => props.value, (val) => {
custom
.
value
.
S
=
match
[
6
]
||
''
updateIsoString
()
}
},
{
immediate
:
true
})
},
{
immediate
:
true
}
)
</
script
>
src/components/bpmnProcessDesigner/package/penal/time-event-config/TimeEventConfig.vue
View file @
8665d0a4
<
template
>
<div
class=
"panel-tab__content"
>
<div
style=
"margin-top: 10px
;
"
>
<div
style=
"margin-top: 10px"
>
<span>
类型:
</span>
<el-button-group>
<el-button
size=
"mini"
:type=
"type==='time'?'primary':''"
@
click=
"setType('time')"
>
时间
</el-button>
<el-button
size=
"mini"
:type=
"type==='duration'?'primary':''"
@
click=
"setType('duration')"
>
持续
</el-button>
<el-button
size=
"mini"
:type=
"type==='cycle'?'primary':''"
@
click=
"setType('cycle')"
>
循环
</el-button>
<el-button
size=
"mini"
:type=
"type === 'time' ? 'primary' : ''"
@
click=
"setType('time')"
>
时间
</el-button
>
<el-button
size=
"mini"
:type=
"type === 'duration' ? 'primary' : ''"
@
click=
"setType('duration')"
>
持续
</el-button
>
<el-button
size=
"mini"
:type=
"type === 'cycle' ? 'primary' : ''"
@
click=
"setType('cycle')"
>
循环
</el-button
>
</el-button-group>
<el-icon
v-if=
"valid"
color=
"green"
style=
"margin-left:8px"
><CircleCheckFilled
/></el-icon>
<el-icon
v-if=
"valid"
color=
"green"
style=
"margin-left:
8px"
><CircleCheckFilled
/></el-icon>
</div>
<div
style=
"margin-top: 10px; display: flex; align-items: center
;
"
>
<div
style=
"margin-top: 10px; display: flex; align-items: center"
>
<span>
条件:
</span>
<el-input
v-model=
"condition"
:placeholder=
"placeholder"
style=
"width: calc(100% - 100px)
;
"
style=
"width: calc(100% - 100px)"
:readonly=
"type !== 'duration' && type !== 'cycle'"
@
focus=
"handleInputFocus"
@
blur=
"updateNode"
...
...
@@ -24,7 +33,9 @@
<el-icon
color=
"orange"
><WarningFilled
/></el-icon>
</el-tooltip>
<el-tooltip
:content=
"helpText"
placement=
"top"
>
<el-icon
color=
"#409EFF"
style=
"cursor: pointer"
@
click=
"showHelp = true"
><QuestionFilled
/></el-icon>
<el-icon
color=
"#409EFF"
style=
"cursor: pointer"
@
click=
"showHelp = true"
><QuestionFilled
/></el-icon>
</el-tooltip>
<el-button
v-if=
"type === 'time'"
...
...
@@ -57,40 +68,55 @@
</el-input>
</div>
<!-- 时间选择器 -->
<el-dialog
v-model=
"showDatePicker"
title=
"选择时间"
width=
"400px"
@
close=
"showDatePicker=false"
>
<el-dialog
v-model=
"showDatePicker"
title=
"选择时间"
width=
"400px"
@
close=
"showDatePicker = false"
>
<el-date-picker
v-model=
"dateValue"
type=
"datetime"
placeholder=
"选择日期时间"
style=
"width: 100%
;
"
style=
"width: 100%"
@
change=
"onDateChange"
/>
<
template
#
footer
>
<el-button
@
click=
"showDatePicker
=
false"
>
取消
</el-button>
<el-button
@
click=
"showDatePicker
=
false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onDateConfirm"
>
确定
</el-button>
</
template
>
</el-dialog>
<!-- 持续时长选择器 -->
<el-dialog
v-model=
"showDurationDialog"
title=
"时间配置"
width=
"600px"
@
close=
"showDurationDialog=false"
>
<el-dialog
v-model=
"showDurationDialog"
title=
"时间配置"
width=
"600px"
@
close=
"showDurationDialog = false"
>
<DurationConfig
:value=
"condition"
@
change=
"onDurationChange"
/>
<
template
#
footer
>
<el-button
@
click=
"showDurationDialog
=
false"
>
取消
</el-button>
<el-button
@
click=
"showDurationDialog
=
false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onDurationConfirm"
>
确定
</el-button>
</
template
>
</el-dialog>
<!-- 循环配置器 -->
<el-dialog
v-model=
"showCycleDialog"
title=
"时间配置"
width=
"800px"
@
close=
"showCycleDialog=false"
>
<el-dialog
v-model=
"showCycleDialog"
title=
"时间配置"
width=
"800px"
@
close=
"showCycleDialog = false"
>
<CycleConfig
:value=
"condition"
@
change=
"onCycleChange"
/>
<
template
#
footer
>
<el-button
@
click=
"showCycleDialog
=
false"
>
取消
</el-button>
<el-button
@
click=
"showCycleDialog
=
false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onCycleConfirm"
>
确定
</el-button>
</
template
>
</el-dialog>
<!-- 帮助说明 -->
<el-dialog
v-model=
"showHelp"
title=
"格式说明"
width=
"600px"
@
close=
"showHelp
=
false"
>
<el-dialog
v-model=
"showHelp"
title=
"格式说明"
width=
"600px"
@
close=
"showHelp
=
false"
>
<div
v-html=
"helpHtml"
></div>
<
template
#
footer
>
<el-button
@
click=
"showHelp
=
false"
>
关闭
</el-button>
<el-button
@
click=
"showHelp
=
false"
>
关闭
</el-button>
</
template
>
</el-dialog>
</div>
...
...
@@ -158,7 +184,6 @@ function syncFromBusinessObject() {
}
onMounted
(
syncFromBusinessObject
)
// 切换类型
function
setType
(
t
)
{
type
.
value
=
t
...
...
@@ -235,9 +260,10 @@ function updateNode() {
if
(
!
element
)
return
// 1. 复用原有 timerDef,或新建
let
timerDef
=
(
element
.
businessObject
.
eventDefinitions
&&
element
.
businessObject
.
eventDefinitions
[
0
])
let
timerDef
=
element
.
businessObject
.
eventDefinitions
&&
element
.
businessObject
.
eventDefinitions
[
0
]
if
(
!
timerDef
)
{
timerDef
=
bpmnInstances
().
bpmnFactory
.
create
(
'bpmn:TimerEventDefinition'
,
{})
timerDef
=
bpmnInstances
().
bpmnFactory
.
create
(
'bpmn:TimerEventDefinition'
,
{})
modeling
.
updateProperties
(
element
,
{
eventDefinitions
:
[
timerDef
]
})
...
...
@@ -250,11 +276,17 @@ function updateNode() {
// 3. 设置新的
if
(
type
.
value
===
'time'
&&
condition
.
value
)
{
timerDef
.
timeDate
=
bpmnInstances
().
bpmnFactory
.
create
(
'bpmn:FormalExpression'
,
{
body
:
condition
.
value
})
timerDef
.
timeDate
=
bpmnInstances
().
bpmnFactory
.
create
(
'bpmn:FormalExpression'
,
{
body
:
condition
.
value
})
}
else
if
(
type
.
value
===
'duration'
&&
condition
.
value
)
{
timerDef
.
timeDuration
=
bpmnInstances
().
bpmnFactory
.
create
(
'bpmn:FormalExpression'
,
{
body
:
condition
.
value
})
timerDef
.
timeDuration
=
bpmnInstances
().
bpmnFactory
.
create
(
'bpmn:FormalExpression'
,
{
body
:
condition
.
value
})
}
else
if
(
type
.
value
===
'cycle'
&&
condition
.
value
)
{
timerDef
.
timeCycle
=
bpmnInstances
().
bpmnFactory
.
create
(
'bpmn:FormalExpression'
,
{
body
:
condition
.
value
})
timerDef
.
timeCycle
=
bpmnInstances
().
bpmnFactory
.
create
(
'bpmn:FormalExpression'
,
{
body
:
condition
.
value
})
}
bpmnInstances
().
modeling
.
updateProperties
(
toRaw
(
element
),
{
...
...
@@ -262,13 +294,11 @@ function updateNode() {
})
}
watch
(
()
=>
props
.
businessObject
,
(
val
)
=>
{
if
(
val
)
{
nextTick
(()
=>
{
syncFromBusinessObject
()
})
}
...
...
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