增加审批组件
This commit is contained in:
parent
099b979ce7
commit
e0d58311c8
@ -215,10 +215,11 @@ const WorkflowDefinitionList: React.FC = () => {
|
||||
try {
|
||||
console.log('🚀 启动工作流,携带表单数据:', formData);
|
||||
|
||||
// 调用启动API,传递表单数据作为流程变量
|
||||
// 调用启动API,传递表单数据
|
||||
const result = await startWorkflowInstance({
|
||||
processKey: workflow.key, // 流程定义key
|
||||
variables: formData, // 表单数据作为流程变量
|
||||
formKey: formDefinition?.key, // 表单标识
|
||||
formData: formData, // 表单数据
|
||||
businessKey: undefined // 自动生成 businessKey
|
||||
});
|
||||
|
||||
|
||||
@ -102,7 +102,8 @@ export const startWorkflowInstance = (data: StartWorkflowInstanceRequest) => {
|
||||
const requestData: StartWorkflowInstanceRequest = {
|
||||
processKey: data.processKey,
|
||||
businessKey: data.businessKey || `workflow_${data.processKey}_${Date.now()}`,
|
||||
variables: data.variables || {}
|
||||
formKey: data.formKey,
|
||||
formData: data.formData || {}
|
||||
};
|
||||
|
||||
return request.post<StartWorkflowInstanceResponse>(`${INSTANCE_URL}/start`, requestData);
|
||||
|
||||
@ -137,8 +137,11 @@ export interface StartWorkflowInstanceRequest {
|
||||
/** 业务标识(可选,默认自动生成) */
|
||||
businessKey?: string;
|
||||
|
||||
/** 流程变量(表单数据) */
|
||||
variables?: Record<string, any>;
|
||||
/** 表单标识 */
|
||||
formKey?: string;
|
||||
|
||||
/** 表单数据 */
|
||||
formData?: Record<string, any>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user