Bladeren bron

bigfix: fix step from page

陈帅 7 jaren geleden
bovenliggende
commit
d00bec8c2a

+ 1 - 1
src/models/form.js

@@ -25,7 +25,7 @@ export default {
         type: 'saveStepFormData',
         payload,
       });
-      yield put(routerRedux.push('/Forms/StepForm/Step3'));
+      yield put(routerRedux.push('/form/step-form/result'));
     },
     *submitAdvancedForm({ payload }, { call }) {
       yield call(fakeSubmitForm, payload);

+ 1 - 1
src/pages/Forms/StepForm/Step1.js

@@ -27,7 +27,7 @@ class Step1 extends React.PureComponent {
             type: 'form/saveStepFormData',
             payload: values,
           });
-          dispatch(routerRedux.push('/Forms/StepForm/Step2'));
+          dispatch(routerRedux.push('/form/step-form/confirm'));
         }
       });
     };

+ 1 - 1
src/pages/Forms/StepForm/Step2.js

@@ -20,7 +20,7 @@ class Step2 extends React.PureComponent {
     const { form, data, dispatch, submitting } = this.props;
     const { getFieldDecorator, validateFields } = form;
     const onPrev = () => {
-      dispatch(routerRedux.push('/Forms/StepForm'));
+      dispatch(routerRedux.push('/form/step-form/info'));
     };
     const onValidateForm = e => {
       e.preventDefault();

+ 1 - 1
src/pages/Forms/StepForm/Step3.js

@@ -9,7 +9,7 @@ class Step3 extends React.PureComponent {
   render() {
     const { dispatch, data } = this.props;
     const onFinish = () => {
-      dispatch(routerRedux.push('/Forms/StepForm'));
+      dispatch(routerRedux.push('/form/step-form/info'));
     };
     const information = (
       <div className={styles.information}>

+ 3 - 15
src/pages/Forms/StepForm/index.js

@@ -14,11 +14,11 @@ export default class StepForm extends PureComponent {
     const { pathname } = location;
     const pathList = pathname.split('/');
     switch (pathList[pathList.length - 1]) {
-      case 'Step1':
+      case 'info':
         return 0;
-      case 'Step2':
+      case 'confirm':
         return 1;
-      case 'Step3':
+      case 'result':
         return 2;
       default:
         return 0;
@@ -41,18 +41,6 @@ export default class StepForm extends PureComponent {
               <Step title="完成" />
             </Steps>
             {children}
-            {/* <Switch>
-              {getRoutes(match.path, routerData).map(item => (
-                <Route
-                  key={item.key}
-                  path={item.path}
-                  component={item.component}
-                  exact={item.exact}
-                />
-              ))}
-              <Redirect exact from="/form/step-form" to="/form/step-form/info" />
-              <Redirect to="/exception/404" />
-            </Switch> */}
           </Fragment>
         </Card>
       </PageHeaderLayout>