可以在流程设计写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'
})
}
}