Skip to content

Commit 9516540

Browse files
committed
fix handleTrySubmitFlow validateFields
1 parent ebb1477 commit 9516540

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

admin-ui/src/components/Flow/flow/events.tsx

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff 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
// 撤回流程

0 commit comments

Comments
 (0)