From 8b02d54c8aa4f4d8cf531caf69e9981704b11caa Mon Sep 17 00:00:00 2001 From: zwjamnsss Date: Thu, 27 Jul 2017 15:55:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=94=B9=E7=94=A8=E6=B0=94=E6=B3=A1=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectGroups/GroupList/GroupList.js | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/client/containers/ProjectGroups/GroupList/GroupList.js b/client/containers/ProjectGroups/GroupList/GroupList.js index 828091e0..a13c8675 100644 --- a/client/containers/ProjectGroups/GroupList/GroupList.js +++ b/client/containers/ProjectGroups/GroupList/GroupList.js @@ -1,13 +1,12 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { Button, Icon, Modal, Input, message, Menu, Row, Col } from 'antd' +import { Button, Icon, Popconfirm, Modal, Input, message, Menu, Row, Col } from 'antd' import { autobind } from 'core-decorators'; import axios from 'axios'; import { withRouter } from 'react-router'; const { TextArea } = Input; const Search = Input.Search; -const confirm = Modal.confirm; const TYPE_EDIT = 'edit'; import { @@ -164,21 +163,15 @@ export default class GroupList extends Component { deleteGroup() { const self = this; const { currGroup } = self.props; - confirm({ - title: `你确定要删除分组 ${currGroup.group_name}?`, - content: `分组简介:${currGroup.group_desc}`, - onOk() { - axios.post('/group/del', {id: currGroup._id}).then(res => { - if (res.data.errcode) { - message.error(res.data.errmsg); - } else { - message.success('删除成功'); - self.props.fetchGroupList().then(() => { - const currGroup = self.props.groupList[0] || { group_name: '', group_desc: '' }; - self.setState({groupList: self.props.groupList}); - self.props.setCurrGroup(currGroup) - }); - } + axios.post('/group/del', {id: currGroup._id}).then(res => { + if (res.data.errcode) { + message.error(res.data.errmsg); + } else { + message.success('删除成功'); + self.props.fetchGroupList().then(() => { + const currGroup = self.props.groupList[0] || { group_name: '', group_desc: '' }; + self.setState({groupList: self.props.groupList}); + self.props.setCurrGroup(currGroup) }); } }); @@ -205,7 +198,9 @@ export default class GroupList extends Component {
{currGroup.group_name}
this.showModal(TYPE_EDIT)}/> - + + +
简介:{currGroup.group_desc}