feat: 新增流程监听

This commit is contained in:
tony
2022-12-25 14:17:29 +08:00
parent ff0cf07746
commit 532f791cc3
14 changed files with 968 additions and 73 deletions

View File

@@ -32,7 +32,9 @@ export function documentationParse(obj) {
export function conditionExpressionParse(obj) {
if ('conditionExpression' in obj) {
obj.conditionExpression = obj.conditionExpression.body
if (obj.conditionExpression) {
obj.conditionExpression = obj.conditionExpression.body
}
}
return obj
}

View File

@@ -76,13 +76,13 @@ export default {
{ label: '表达式', value: 'expression' },
{ label: '委托表达式', value: 'delegateExpression' }
],
tooltip: `类:示例 com.company.MyCustomListener自定义类必须实现 org.flowable.engine.delegate.TaskListener 接口 <br />
tooltip: `类:示例 com.company.MyCustomListener自定义类必须实现 org.flowable.engine.delegate.ExecutionListener 接口 <br />
表达式:示例 \${myObject.callMethod(task, task.eventName)} <br />
委托表达式:示例 \${myListenerSpringBean} ,该 springBean 需要实现 org.flowable.engine.delegate.TaskListener 接口
委托表达式:示例 \${myListenerSpringBean} ,该 springBean 需要实现 org.flowable.engine.delegate.ExecutionListener 接口
`
},
{
label: 'java 类名',
label: '',
name: 'className',
xType: 'input',
rules: [{ required: true, message: '请输入', trigger: ['blur', 'change'] }]

View File

@@ -81,21 +81,25 @@ export default {
{ label: '类', value: 'class' },
{ label: '表达式', value: 'expression' },
{ label: '委托表达式', value: 'delegateExpression' }
]
],
tooltip: `类:示例 com.company.MyCustomListener自定义类必须实现 org.flowable.engine.delegate.TaskListener 接口 <br />
表达式:示例 \${myObject.callMethod(task, task.eventName)} <br />
委托表达式:示例 \${myListenerSpringBean} ,该 springBean 需要实现 org.flowable.engine.delegate.TaskListener 接口
`
},
{
label: 'java 类名',
label: '',
name: 'className',
xType: 'input',
rules: [{ required: true, message: '请输入', trigger: ['blur', 'change'] }]
},
{
xType: 'slot',
label: '参数',
width: 120,
slot: true,
name: 'params'
}
// {
// xType: 'slot',
// label: '参数',
// width: 120,
// slot: true,
// name: 'params'
// }
]
}
]

View File

@@ -54,12 +54,12 @@ export default {
name: 'executionListener',
label: '执行监听器'
},
{
xType: 'input',
name: 'initiator',
label: '发起人',
show: !!_this.showConfig.initiator
},
// {
// xType: 'input',
// name: 'initiator',
// label: '发起人',
// show: !!_this.showConfig.initiator
// },
// {
// xType: 'input',
// name: 'formKey',

View File

@@ -362,7 +362,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
translate('Append Gateway')
),
'append.append-user-task': appendAction(
'bpmn:Task',
'bpmn:UserTask',
'bpmn-icon-user-task',
'添加用户任务'
),

View File

@@ -53,7 +53,6 @@
import customTranslate from './common/customTranslate'
import Modeler from 'bpmn-js/lib/Modeler'
import panel from './PropertyPanel'
import BpmData from './BpmData'
import getInitStr from './flowable/init'
// 引入flowable的节点文件
import FlowableModule from './flowable/flowable.json'
@@ -167,58 +166,6 @@ export default {
console.error(err.message, err.warnings)
}
},
// 调整左侧工具栏排版
adjustPalette() {
try {
// 获取 bpmn 设计器实例
const canvas = this.$refs.canvas
const djsPalette = canvas.children[0].children[1].children[4]
const djsPalStyle = {
width: '130px',
padding: '5px',
background: 'white',
left: '20px',
borderRadius: 0
}
for (var key in djsPalStyle) {
djsPalette.style[key] = djsPalStyle[key]
}
const palette = djsPalette.children[0]
const allGroups = palette.children
allGroups[0].style['display'] = 'none'
// 修改控件样式
for (var gKey in allGroups) {
const group = allGroups[gKey]
for (var cKey in group.children) {
const control = group.children[cKey]
const controlStyle = {
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center',
width: '100%',
padding: '5px'
}
if (
control.className &&
control.dataset &&
control.className.indexOf('entry') !== -1
) {
const controlProps = new BpmData().getControl(
control.dataset.action
)
control.innerHTML = `<div style='font-size: 14px;font-weight:500;margin-left:15px;'>${
controlProps['title']
}</div>`
for (var csKey in controlStyle) {
control.style[csKey] = controlStyle[csKey]
}
}
}
}
} catch (e) {
console.log(e)
}
},
// 对外 api
getProcess() {
const element = this.getProcessElement()