@@ -7,6 +7,7 @@ import {FlowUser} from "@/components/flow/types";
77import { FlowSubmitResultParser } from "@/components/flow/domain/FlowResultParser" ;
88import { UserSelectMode } from "@/components/flow/store/FlowSlice" ;
99import { FlowTriggerContext } from "@/components/flow/domain/FlowTriggerContext" ;
10+ import FormInstance from "@/components/form/domain/FormInstance" ;
1011
1112/**
1213 * 流程的事件控制上下文对象
@@ -15,28 +16,28 @@ export class FlowEventContext {
1516
1617 private readonly flowRecordContext : FlowRecordContext ;
1718 private readonly flowTriggerContext : FlowTriggerContext ;
18- private readonly flowAction : React . RefObject < FormAction > ;
19- private readonly opinionAction : React . RefObject < FormAction > ;
19+ private readonly flowInstance : FormInstance ;
20+ private readonly opinionInstance : FormInstance ;
2021 private readonly flowStateContext : FlowStateContext ;
2122
2223 constructor ( flowViewContext : FlowRecordContext ,
2324 flowTriggerContext :FlowTriggerContext ,
24- flowAction : React . RefObject < FormAction > ,
25- opinionAction : React . RefObject < FormAction > ,
25+ flowInstance : FormInstance ,
26+ opinionInstance : FormInstance ,
2627 flowStateContext : FlowStateContext ) {
2728 this . flowRecordContext = flowViewContext ;
2829 this . flowTriggerContext = flowTriggerContext ;
29- this . flowAction = flowAction ;
30- this . opinionAction = opinionAction ;
30+ this . flowInstance = flowInstance ;
31+ this . opinionInstance = opinionInstance ;
3132 this . flowStateContext = flowStateContext ;
3233 }
3334
3435 private getRequestBody = ( ) => {
35- const formData = this . flowAction . current ? .getFieldsValue ( ) ;
36+ const formData = this . opinionInstance . getFieldsValue ( ) ;
3637 const flowData = this . flowRecordContext . getFlowFormParams ( ) ;
3738 const workCode = this . flowRecordContext . getWorkCode ( ) ;
3839 const recordId = this . flowStateContext . getRecordId ( ) ;
39- const advice = this . opinionAction . current ? .getFieldsValue ( ) ;
40+ const advice = this . opinionInstance . getFieldsValue ( ) ;
4041
4142 return {
4243 recordId,
@@ -51,8 +52,8 @@ export class FlowEventContext {
5152
5253
5354 private validateForm = async ( ) => {
54- const formState = await this . flowAction . current ? .validate ( ) ;
55- const opinionState = await this . opinionAction . current ? .validate ( ) ;
55+ const formState = await this . flowInstance . validate ( ) ;
56+ const opinionState = await this . opinionInstance . validate ( ) ;
5657 return formState && opinionState ;
5758 }
5859
0 commit comments