简体中文
bpm.approve.render.after
约 702 字大约 2 分钟
2025-12-16
说明:该事件用于业务流审批节点,填写表单/布局渲染之后调用。 该事件用于业务流审批节点填写表单/布局渲染之后执行额外的动作,包括但不限于以下功能: 1. 自定义设置审批内容表单/页面,【处理审批】区域的内容
参数
| 参数 | 说明 | 类型 |
|---|---|---|
| setSwitchLabel | 自定义设置审批内容表单/页面,【处理审批】区域的内容(示例) | Function |
| showSwitchContent | 自定义设置审批内容表单/页面,隐藏处理审批开关容器+label文案(示例) | Function |
| showSwitchContainer | 自定义设置审批内容表单/页面,隐藏处理审批开关容器(示例) | Function |
| forceSwitchContainer | 自定义设置审批内容表单/页面,强制打开/关闭 处理审批开关(示例) | Function |
基础示例
一、setSwitchLabel
功能描述
用户可以自定义设置审批内容表单/页面,【处理审批】区域的内容。
参数
| 参数 | 说明 | 类型 |
|---|---|---|
| Dom对象/html字符串 | 自定义设置文字内容和样式 | Object/String |
| false | 隐藏 | Boolean |
注:不传参数,表示使用默认标题
返回结果
无
参数代码示例
// 以html字符串为例,将html字符串作为参数传入
api.setSwitchLabel('<h5>同时处理审批</h5>')代码示例
// setSwitchLabel()
export default class Plugin {
apply() {
return [
{
event: 'bpm.approve.render.after',
functional: this.bpmApproveRenderAfter.bind(this)
}
]
}
bpmApproveRenderAfter(api) {
api.setSwitchLabel('<h5>同时处理审批</h5>')
// api.setSwitchLabel(false) // 隐藏处理审批label文案
}
}二、showSwitchContent
功能描述
用户可以自定义控制审批内容表单/页面,隐藏【处理审批】开关容器+label文案
参数
| 参数 | 说明 | 类型 |
|---|---|---|
| false | 隐藏处理审批开关容器+label文案 | Boolean |
返回结果
无
参数代码示例
// showSwitchContent()
export default class Plugin {
apply() {
return [
{
event: 'bpm.approve.render.after',
functional: this.bpmApproveRenderAfter.bind(this)
}
]
}
bpmApproveRenderAfter(api) {
api.showSwitchContent(false) // 隐藏处理审批开关容器+label文案
}
}三、showSwitchContainer
功能描述
用户可以自定义控制审批内容表单/页面,隐藏【处理审批】开关容器
参数
| 参数 | 说明 | 类型 |
|---|---|---|
| false | 隐藏处理审批开关容器 | Boolean |
返回结果
无
参数代码示例
// showSwitchContainer()
export default class Plugin {
apply() {
return [
{
event: 'bpm.approve.render.after',
functional: this.bpmApproveRenderAfter.bind(this)
}
]
}
bpmApproveRenderAfter(api) {
api.showSwitchContainer(false) // 隐藏处理审批开关容器
}
}四、forceSwitchContainer
功能描述
用户可以自定义控制审批内容表单/页面,强制打开/关闭 处理审批开关
参数
| 参数 | 说明 | 类型 |
|---|---|---|
| true | 强制打开 | Boolean |
| false | 强制关闭 | Boolean |
返回结果
无
参数代码示例
// forceSwitchContainer()
export default class Plugin {
apply() {
return [
{
event: 'bpm.approve.render.after',
functional: this.bpmApproveRenderAfter.bind(this)
}
]
}
bpmApproveRenderAfter(api) {
api.forceSwitchContainer(true) // 强制打开处理审批开关
// api.forceSwitchContainer(false) // 强制关闭处理审批开关
}
}