Skip to content

Commit e37a4a2

Browse files
committed
fix flow
1 parent 855c726 commit e37a4a2

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

mobile-ui/src/components/flow/domain/FlowButtonClickContext.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)