File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
mobile-ui/src/components/flow/domain Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -171,25 +171,36 @@ export class FlowButtonClickContext {
171171 }
172172
173173 if ( button . type === "CUSTOM" ) {
174- if ( this . flowStateContext ?. hasRecordId ( ) ) {
174+ const customHandler = ( ) => {
175175 this . flowEventContext ?. customFlow ( button , ( res ) => {
176176 const customMessage = res . data ;
177177 this . flowStateContext ?. setResult ( {
178178 state : customMessage . resultState . toLowerCase ( ) ,
179179 ...customMessage
180180 } ) ;
181181 } ) ;
182+ }
183+ if ( this . flowStateContext ?. hasRecordId ( ) ) {
184+ customHandler ( ) ;
182185 } else {
183- Toast . show ( '流程尚未发起,无法操作' ) ;
186+ this . flowEventContext ?. trySubmitFlow ( ( res ) => {
187+ customHandler ( ) ;
188+ } ) ;
184189 }
185190 }
186191
187192 if ( button . type === 'VIEW' ) {
188- if ( this . flowStateContext ?. hasRecordId ( ) ) {
193+ const viewHandler = ( ) => {
189194 const eventKey = button . eventKey ;
190195 this . flowEventContext ?. triggerEvent ( eventKey ) ;
196+ }
197+
198+ if ( this . flowStateContext ?. hasRecordId ( ) ) {
199+ viewHandler ( ) ;
191200 } else {
192- Toast . show ( '流程尚未发起,无法操作' ) ;
201+ this . flowEventContext ?. trySubmitFlow ( ( res ) => {
202+ viewHandler ( ) ;
203+ } ) ;
193204 }
194205 }
195206 }
You can’t perform that action at this time.
0 commit comments