feat: jump to page after successful form submission
This commit is contained in:
parent
3268267ccd
commit
6c75950b6a
@ -76,41 +76,50 @@ export function Page(props: any) {
|
||||
message.success('草稿保存成功');
|
||||
return;
|
||||
}
|
||||
if (
|
||||
view.draft.returnType === 'message' &&
|
||||
view.draft.message
|
||||
) {
|
||||
Modal.success({
|
||||
title: '草稿保存成功',
|
||||
content: (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: markdown(view.draft.message),
|
||||
}}
|
||||
/>
|
||||
),
|
||||
});
|
||||
} else if (view.draft.returnType === 'redirect') {
|
||||
const path = get(view, 'draft.redirect.name');
|
||||
path && history.push(`${path}`);
|
||||
if (!view.draft.message) {
|
||||
return;
|
||||
}
|
||||
Modal.success({
|
||||
title: '草稿保存成功',
|
||||
content: (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: markdown(view.draft.message),
|
||||
}}
|
||||
/>
|
||||
),
|
||||
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) {
|
||||
Modal.success({
|
||||
title: '提交成功',
|
||||
content: (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: markdown(view.message),
|
||||
}}
|
||||
/>
|
||||
),
|
||||
});
|
||||
} else if (view.returnType === 'redirect') {
|
||||
const path = get(view, 'redirect.name');
|
||||
path && history.push(`${path}`);
|
||||
if (!view.message) {
|
||||
return;
|
||||
}
|
||||
Modal.success({
|
||||
title: '提交成功',
|
||||
content: (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: markdown(view.message),
|
||||
}}
|
||||
/>
|
||||
),
|
||||
onOk: () => {
|
||||
const path = get(view, 'redirect.name');
|
||||
path && history.push(`${path}`);
|
||||
},
|
||||
onCancel: () => {
|
||||
const path = get(view, 'redirect.name');
|
||||
path && history.push(`${path}`);
|
||||
},
|
||||
});
|
||||
}}
|
||||
viewName={viewName}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user