File tree Expand file tree Collapse file tree 1 file changed +23
-16
lines changed
admin-ui/src/components/Flow/flow Expand file tree Collapse file tree 1 file changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -188,23 +188,30 @@ export const registerEvents = (id: string,
188188
189189 // 预提交
190190 const handleTrySubmitFlow = ( callback : ( res : any ) => void ) => {
191- const advice = adviceForm . getFieldValue ( 'advice' ) ;
192- const formData = form . getFieldsValue ( ) ;
193- const flowData = data . getFlowData ( ) ;
194- const body = {
195- recordId,
196- advice : advice ,
197- success : true ,
198- formData : {
199- ...flowData ,
200- ...formData ,
201- }
202- }
203- trySubmitFlow ( body ) . then ( res => {
204- if ( res . success ) {
205- callback && callback ( res ) ;
191+ setRequestLoading ( true ) ;
192+ form . validateFields ( ) . then ( ( formData ) => {
193+ const advice = adviceForm . getFieldValue ( 'advice' ) ;
194+ const flowData = data . getFlowData ( ) ;
195+ const body = {
196+ recordId,
197+ advice : advice ,
198+ success : true ,
199+ formData : {
200+ ...flowData ,
201+ ...formData ,
202+ }
206203 }
207- } )
204+ trySubmitFlow ( body ) . then ( res => {
205+ if ( res . success ) {
206+ callback && callback ( res ) ;
207+ }
208+ } ) . finally ( ( ) => {
209+ setRequestLoading ( false ) ;
210+ } ) ;
211+ } ) . catch ( e => {
212+ console . log ( e ) ;
213+ setRequestLoading ( false ) ;
214+ } ) ;
208215 }
209216
210217 // 撤回流程
You can’t perform that action at this time.
0 commit comments