feat: jump to page after successful form submission

This commit is contained in:
chenos 2021-04-25 11:54:23 +08:00
parent 3268267ccd
commit 6c75950b6a

View File

@ -76,10 +76,9 @@ export function Page(props: any) {
message.success('草稿保存成功');
return;
}
if (
view.draft.returnType === 'message' &&
view.draft.message
) {
if (!view.draft.message) {
return;
}
Modal.success({
title: '草稿保存成功',
content: (
@ -89,14 +88,20 @@ export function Page(props: any) {
}}
/>
),
});
} else if (view.draft.returnType === 'redirect') {
const path = get(view, 'draft.redirect.name');
onCancel: () => {
const path = get(view, 'redirect.name');
path && history.push(`${path}`);
}
},
onOk: () => {
const path = get(view, 'redirect.name');
path && history.push(`${path}`);
},
});
}}
onFinish={() => {
if (view.returnType === 'message' && view.message) {
if (!view.message) {
return;
}
Modal.success({
title: '提交成功',
content: (
@ -106,11 +111,15 @@ export function Page(props: any) {
}}
/>
),
});
} else if (view.returnType === 'redirect') {
onOk: () => {
const path = get(view, 'redirect.name');
path && history.push(`${path}`);
}
},
onCancel: () => {
const path = get(view, 'redirect.name');
path && history.push(`${path}`);
},
});
}}
viewName={viewName}
/>