English
bpm.approve.render.after
About 455 wordsAbout 2 min
2025-12-16
Note: This event is used after the form/layout of a business flow approval node has been rendered. It is used to perform extra actions after the form/layout of a business flow approval node is rendered, including but not limited to the following function: 1. customize the content of the "Handle Approval" area in the approval content form/page.
Parameters
| Parameter | Description | Type |
|---|---|---|
| setSwitchLabel | Customize the content of the "Handle Approval" area in the approval content form/page (example) | Function |
| showSwitchContent | Customize the approval content form/page by hiding the handle-approval switch container + label text (example) | Function |
| showSwitchContainer | Customize the approval content form/page by hiding the handle-approval switch container (example) | Function |
| forceSwitchContainer | Customize the approval content form/page by forcibly opening/closing the handle-approval switch (example) | Function |
Basic Examples
1. setSwitchLabel
Feature Description
Users can customize the content of the "Handle Approval" area in the approval content form/page.
Parameters
| Parameter | Description | Type |
|---|---|---|
| DOM object / HTML string | Customize text content and style | Object/String |
| false | Hide | Boolean |
Note: if no parameter is passed, the default title is used.
Return Value
None
Parameter Code Example
// Take an HTML string as an example, passing the HTML string as a parameter
api.setSwitchLabel('<h5>Process Approval at the Same Time</h5>')Code Example
// setSwitchLabel()
export default class Plugin {
apply() {
return [
{
event: 'bpm.approve.render.after',
functional: this.bpmApproveRenderAfter.bind(this)
}
]
}
bpmApproveRenderAfter(api) {
api.setSwitchLabel('<h5>Process Approval at the Same Time</h5>')
// api.setSwitchLabel(false) // Hide the handle-approval label text
}
}2. showSwitchContent
Feature Description
Users can customize the approval content form/page by hiding the "Handle Approval" switch container + label text.
Parameters
| Parameter | Description | Type |
|---|---|---|
| false | Hide the handle-approval switch container + label text | Boolean |
Return Value
None
Parameter Code Example
// showSwitchContent()
export default class Plugin {
apply() {
return [
{
event: 'bpm.approve.render.after',
functional: this.bpmApproveRenderAfter.bind(this)
}
]
}
bpmApproveRenderAfter(api) {
api.showSwitchContent(false) // Hide the handle-approval switch container + label text
}
}3. showSwitchContainer
Feature Description
Users can customize the approval content form/page by hiding the "Handle Approval" switch container.
Parameters
| Parameter | Description | Type |
|---|---|---|
| false | Hide the handle-approval switch container | Boolean |
Return Value
None
Parameter Code Example
// showSwitchContainer()
export default class Plugin {
apply() {
return [
{
event: 'bpm.approve.render.after',
functional: this.bpmApproveRenderAfter.bind(this)
}
]
}
bpmApproveRenderAfter(api) {
api.showSwitchContainer(false) // Hide the handle-approval switch container
}
}4. forceSwitchContainer
Feature Description
Users can customize the approval content form/page by forcibly opening/closing the handle-approval switch.
Parameters
| Parameter | Description | Type |
|---|---|---|
| true | Force open | Boolean |
| false | Force close | Boolean |
Return Value
None
Parameter Code Example
// forceSwitchContainer()
export default class Plugin {
apply() {
return [
{
event: 'bpm.approve.render.after',
functional: this.bpmApproveRenderAfter.bind(this)
}
]
}
bpmApproveRenderAfter(api) {
api.forceSwitchContainer(true) // Force open the handle-approval switch
// api.forceSwitchContainer(false) // Force close the handle-approval switch
}
}