Update add.js
This commit is contained in:
parent
787f30f906
commit
0ade558d3d
|
@ -1,7 +1,7 @@
|
|||
import ReactDOM from 'react-dom';
|
||||
import React, { Component } from 'react';
|
||||
import { HashRouter as Router, Route, Link } from "react-router-dom";
|
||||
import { Button ,Card,Icon ,Notify,Radio,RadioGroup,smoothScroll} from 'zent';
|
||||
import { Button ,Card,Icon ,Notify,Radio,RadioGroup,smoothScroll,Sweetalert} from 'zent';
|
||||
import "./add.less"
|
||||
import Step1 from "./step1.js"
|
||||
import Step2 from "./step2.js"
|
||||
|
@ -36,18 +36,20 @@ export default class add extends React.Component{
|
|||
this.refs.step1.submit();
|
||||
}
|
||||
onCancel(){
|
||||
if(this.state.curstep == 1||this.state.audit_visible)
|
||||
{
|
||||
this.props.history.push('/home/plan-list/');
|
||||
}
|
||||
else{
|
||||
if(this.state.keys.length > 1 && this.state.curstep == 2)
|
||||
{
|
||||
delete this.state.keys[this.state.keys.length - 1]
|
||||
this.setState({keys:this.state.keys})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
let self = this;
|
||||
Sweetalert.confirm({
|
||||
type:'warning',
|
||||
closeBtn:true,
|
||||
title:'确认操作',
|
||||
content:<p> 是否返回计划列表?</p>,
|
||||
onConfirm:()=>{ self.props.history.push('/home/plan-list/');},
|
||||
onCancel: this.onCancel,
|
||||
className:'questModal',
|
||||
parentComponent: this
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue