From 0ade558d3d49a73697fd4e071c87251f79be9647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 26 Nov 2021 09:56:27 +0800 Subject: [PATCH] Update add.js --- src/pages/plan/add/add.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/pages/plan/add/add.js b/src/pages/plan/add/add.js index 220dc65d..7d22f693 100644 --- a/src/pages/plan/add/add.js +++ b/src/pages/plan/add/add.js @@ -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:
是否返回计划列表?
, + onConfirm:()=>{ self.props.history.push('/home/plan-list/');}, + onCancel: this.onCancel, + className:'questModal', + parentComponent: this + }); + }