@@ -4,21 +4,19 @@ import {ProForm, ProFormTextArea} from "@ant-design/pro-components";
44import { CustomButtonType , FlowFormView , FlowFormViewProps } from "@/components/Flow/flow/types" ;
55import { FlowData } from "@/components/Flow/flow/data" ;
66import { useDispatch , useSelector } from "react-redux" ;
7- import {
8- clearTriggerClick ,
9- FlowReduxState ,
10- hideOpinionEditor ,
11- showOpinionEditor
12- } from "@/components/Flow/store/FlowSlice" ;
7+ import { FlowReduxState , hideOpinionEditor , showOpinionEditor } from "@/components/Flow/store/FlowSlice" ;
138import { FormInstance } from "antd/es/form/hooks/useForm" ;
149
1510interface FlowDetailProps {
1611 view : React . ComponentType < FlowFormViewProps > | FlowFormView ;
17- visible : boolean ;
18- form : any ;
12+ form : FormInstance < any > ;
1913 adviceForm : FormInstance < any > ;
2014 review ?: boolean ;
2115 flowData : FlowData ;
16+ // 请求数据加载
17+ requestLoading : boolean ;
18+ // 设置请求数据加载状态
19+ setRequestLoading : ( loading : boolean ) => void ;
2220 // 流程交互操作
2321 handlerClick : ( data : {
2422 type : CustomButtonType ;
@@ -31,23 +29,26 @@ const FlowDetail: React.FC<FlowDetailProps> = (props) => {
3129
3230 const FlowFormView = flowData . getFlowFormView ( props . view ) as React . ComponentType < FlowFormViewProps > ;
3331
34- // 触发点击事件
35- const triggerClickVisible = useSelector ( ( state : FlowReduxState ) => state . flow . triggerClickVisible ) ;
32+ // 触发点击事件Key
33+ const eventKey = useSelector ( ( state : FlowReduxState ) => state . flow . eventKey ) ;
3634
3735 // 审批意见输入框
3836 const opinionEditorVisible = useSelector ( ( state : FlowReduxState ) => state . flow . opinionEditorVisible ) ;
3937
38+ // 流程视图内容
39+ const flowViewVisible = useSelector ( ( state : FlowReduxState ) => state . flow . flowViewVisible ) ;
40+
4041 // flow store redux
4142 const dispatch = useDispatch ( ) ;
4243
4344 useEffect ( ( ) => {
44- if ( props . visible ) {
45+ if ( flowViewVisible ) {
4546 const advice = flowData . getOpinionAdvice ( ) ;
4647 props . adviceForm . setFieldsValue ( {
4748 advice : advice
4849 } ) ;
4950 }
50- } , [ props . visible ] ) ;
51+ } , [ flowViewVisible ] ) ;
5152
5253 return (
5354 < >
@@ -60,21 +61,20 @@ const FlowDetail: React.FC<FlowDetailProps> = (props) => {
6061 data = { flowData . getFlowData ( ) }
6162 form = { props . form }
6263 flowData = { flowData }
63- visible = { props . visible }
64+ visible = { flowViewVisible }
6465 opinions = { flowData . getOpinions ( ) }
6566 editable = { ! flowData . isDone ( ) && flowData . getFlowNodeEditable ( ) }
6667 compare = { ! flowData . isStartFlow ( ) }
67- triggerClickVisible = { triggerClickVisible }
68+ eventKey = { eventKey }
69+ requestLoading = { props . requestLoading }
70+ setRequestLoading = { props . setRequestLoading }
6871 opinionEditorVisible = { ( visible ) => {
6972 if ( visible ) {
7073 dispatch ( showOpinionEditor ( ) ) ;
7174 } else {
7275 dispatch ( hideOpinionEditor ( ) ) ;
7376 }
7477 } }
75- clearTriggerClick = { ( ) => {
76- dispatch ( clearTriggerClick ( ) ) ;
77- } }
7878 />
7979 </ div >
8080 ) }
0 commit comments