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