import { Card, Steps } from 'antd'; import React, { Component, Fragment } from 'react'; import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { connect } from 'dva'; import { StateType } from './model'; import Step1 from './components/Step1'; import Step2 from './components/Step2'; import Step3 from './components/Step3'; import styles from './style.less'; const { Step } = Steps; interface StepFormProps { current: StateType['current']; } @connect(({ formStepForm }: { formStepForm: StateType }) => ({ current: formStepForm.current, })) class StepForm extends Component { getCurrentStep() { const { current } = this.props; switch (current) { case 'info': return 0; case 'confirm': return 1; case 'result': return 2; default: return 0; } } render() { const currentStep = this.getCurrentStep(); let stepComponent; if (currentStep === 1) { stepComponent = ; } else if (currentStep === 2) { stepComponent = ; } else { stepComponent = ; } return ( {stepComponent} ); } } export default StepForm;