index.js 1.2 KB
Newer Older
王绍森's avatar
王绍森 committed
1
import React from 'react';
王绍森's avatar
王绍森 committed
2
import { Form } from 'antd';
王绍森's avatar
王绍森 committed
3
import router from 'umi/router';
王绍森's avatar
王绍森 committed
4
import Entrance from '../Entrance';
王绍森's avatar
王绍森 committed
5 6
import Shell from '@/baseComponent/Shell';
import SubmitButton from '@/webPublic/one_stop_public/AffairButton/SumbitButton';
王绍森's avatar
王绍森 committed
7 8
import { ModalInfo } from '@/baseComponent/Modal';
import withGoBack from '@/highOrderComponent/withGoBack';
王绍森's avatar
王绍森 committed
9

王绍森's avatar
王绍森 committed
10
let ApplyPage = ({ id, form }) => {
11 12 13 14 15 16
	function submitCb(res) {
		ModalInfo(`提交${res ? '成功' : '失败'}!`, { onOk: () => router.goBack() });
	}
	function saveDraftCb(res) {
		ModalInfo(`提交${res ? '成功' : '失败'}!`, { onOk: () => router.goBack() });
	}
王绍森's avatar
王绍森 committed
17

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
	return (
		<Shell styleShell={{ marginTop: 0 }}>
			<Entrance id={id} isCg="false" get="web" form={form} />
			<div style={{ padding: 16, textAlign: 'center' }}>
				<SubmitButton
					form={form}
					appId={id}
					text="提交"
					openDraftButton
					DraftButtonText="暂存"
					callback={submitCb}
					draftCallback={saveDraftCb}
				/>
			</div>
		</Shell>
	);
王绍森's avatar
王绍森 committed
34 35 36 37 38
};

ApplyPage = Form.create()(ApplyPage);

export default ({ hasGoBack = true, ...rest }) => {
39 40
	const WithGoBack = withGoBack(ApplyPage);
	return hasGoBack ? <WithGoBack {...rest} /> : <ApplyPage {...rest} />;
王绍森's avatar
王绍森 committed
41
};