From 649ba0bff9ff9de6aade6f4d44191f6ecc3ec439 Mon Sep 17 00:00:00 2001 From: "wenbo.dong" Date: Fri, 18 Aug 2017 19:47:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E4=BA=8C=E6=AC=A1=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../containers/Group/GroupList/GroupList.js | 8 ++-- .../Setting/ProjectMember/ProjectMember.js | 5 +-- .../Setting/ProjectMessage/ProjectMessage.js | 37 ++++++++++++++++++- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/client/containers/Group/GroupList/GroupList.js b/client/containers/Group/GroupList/GroupList.js index ab38626e..548ec699 100644 --- a/client/containers/Group/GroupList/GroupList.js +++ b/client/containers/Group/GroupList/GroupList.js @@ -167,11 +167,13 @@ export default class GroupList extends Component { showConfirm =()=> { let that = this; confirm({ - title: "确认删除"+that.props.currGroup.group_name+"分组吗?", + title: "确认删除 "+that.props.currGroup.group_name+" 分组吗?", content:
- -
请输入分组名称确认此操作:
+
+

请输入分组名称确认此操作:

+ +
, onOk() { let groupName = document.getElementById('group_name').value; diff --git a/client/containers/Project/Setting/ProjectMember/ProjectMember.js b/client/containers/Project/Setting/ProjectMember/ProjectMember.js index 2e48feb7..f381cd0a 100644 --- a/client/containers/Project/Setting/ProjectMember/ProjectMember.js +++ b/client/containers/Project/Setting/ProjectMember/ProjectMember.js @@ -140,12 +140,11 @@ class ProjectMember extends Component { @autobind onUserSelect(childState) { - console.log(childState); this.setState({ inputUid: childState.uid }) } - + async componentWillMount() { const groupMemberList = await this.props.fetchGroupMemberList(this.props.projectMsg.group_id); const rojectMsg = await this.props.getProjectMsg(this.props.projectId); @@ -159,8 +158,6 @@ class ProjectMember extends Component { } render () { - console.log(this.props); - console.log(this.state); const columns = [{ title: ' 项目成员 ('+this.state.projectMemberList.length + ') 人', dataIndex: 'username', diff --git a/client/containers/Project/Setting/ProjectMessage/ProjectMessage.js b/client/containers/Project/Setting/ProjectMessage/ProjectMessage.js index 637f52eb..1bfd1326 100644 --- a/client/containers/Project/Setting/ProjectMessage/ProjectMessage.js +++ b/client/containers/Project/Setting/ProjectMessage/ProjectMessage.js @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import { Form, Input, Icon, Tooltip, Select, Button, Row, Col, message, Card, Radio } from 'antd'; +import { Form, Input, Icon, Tooltip, Select, Button, Row, Col, message, Card, Radio, Alert, Modal } from 'antd'; import PropTypes from 'prop-types'; import { updateProject, delProject, getProjectMsg } from '../../../../reducer/modules/project'; import { fetchGroupMsg } from '../../../../reducer/modules/group'; @@ -8,6 +8,7 @@ const { TextArea } = Input; const FormItem = Form.Item; const Option = Select.Option; const RadioGroup = Radio.Group; +const confirm = Modal.confirm; import '../Setting.scss'; // layout @@ -138,6 +139,38 @@ class ProjectMessage extends Component { }); } + showConfirm = () => { + let that = this; + confirm({ + title: "确认删除 "+that.props.projectMsg.name+" 分组吗?", + content:
+ +
+

请输入项目名称确认此操作:

+ +
+
, + onOk() { + let groupName = document.getElementById('project_name').value; + if(that.props.projectMsg.name !== groupName){ + message.error('分组名称有误') + return new Promise((resolve, reject)=>{ + reject('error') + }) + }else{ + that.props.delProject(that.props.projectId).then((res) => { + if (res.payload.data.errcode == 0) { + message.success('删除成功!'); + } + }); + } + + }, + iconType: 'delete', + onCancel() { } + }); + } + async componentWillMount() { await this.props.getProjectMsg(this.props.projectId); const groupMsg = await this.props.fetchGroupMsg(this.props.projectMsg.group_id); @@ -369,7 +402,7 @@ class ProjectMessage extends Component {

删除项目

项目一旦删除,将无法恢复数据,请慎重操作!

- +