mounted页面加载完成时

各位大佬请教个问题,就是关于流程审批页面打开之后,触发当前JS脚本。修改当前表单中的内容如:单项选择按钮发起时为选项一,当下一节点审批人进入审批界面自动变为选项二。这种怎么通过页面JS实现

请先 登录 后评论

1 个回答

vv

可以在流程设计写JS,判断不同的流程节点,使用setFormData设置不同的选项值

export function mounted() {
  console.log('mounted', this)
  // 流程节点标识
  const processId = this.context.processInfo.docInfo.activityDefinitionId
  if (processId === 'obj_01' || !this.context.processInfo.docInfo.taskId) {
    this.context.form.setFormData({
      '单项选择1': '1'
    })
  } else if (processId === 'obj_02') {
    this.context.form.setFormData({
      '单项选择1': '2'
    })
  }
}
D8fkyd6e6863b839e492c.png

请先 登录 后评论
  • 1 关注
  • 0 收藏,93 浏览
  • 泥嚎 提出于 2025-06-25 17:48

相似问题