diff --git a/client/containers/ProjectGroups/GroupList/GroupList.js b/client/containers/ProjectGroups/GroupList/GroupList.js index 1c9979f2..8b67323a 100644 --- a/client/containers/ProjectGroups/GroupList/GroupList.js +++ b/client/containers/ProjectGroups/GroupList/GroupList.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { Button, Icon, Modal, Input, message, Menu } from 'antd' +import { Button, Icon, Modal, Input, message, Menu, Row, Col } from 'antd' import { autobind } from 'core-decorators'; import axios from 'axios'; @@ -10,7 +10,8 @@ const Search = Input.Search; import { fetchGroupList, setCurrGroup, - addGroup + addGroup, + fetchProjectList } from '../../../actions/group.js' import './GroupList.scss' @@ -23,7 +24,8 @@ import './GroupList.scss' { fetchGroupList, setCurrGroup, - addGroup + addGroup, + fetchProjectList } ) export default class GroupList extends Component { @@ -32,7 +34,8 @@ export default class GroupList extends Component { groupList: PropTypes.array, currGroup: PropTypes.object, fetchGroupList: PropTypes.func, - setCurrGroup: PropTypes.func + setCurrGroup: PropTypes.func, + fetchProjectList: PropTypes.func } state = { @@ -88,6 +91,14 @@ export default class GroupList extends Component { this.setState({newGroupDesc: e.target.value}); } + @autobind + selectGroup(e) { + const groupId = e.key; + const currGroup = this.props.groupList.find((group) => { return +group._id === +groupId }); + this.props.setCurrGroup(currGroup); + // this.props.fetchProjectList(groupId); + } + render () { const { groupList, currGroup } = this.props; @@ -107,10 +118,15 @@ export default class GroupList extends Component { - + { - groupList.map((group, index) => ( - + groupList.map((group) => ( + {group.group_name} )) @@ -122,13 +138,20 @@ export default class GroupList extends Component { visible={this.state.addGroupModalVisible} onOk={this.addGroup} onCancel={this.handleCancel} + className="add-group-modal" > -
- 分组名: -
-
- 简介: -
+ +
分组名:
+ + + +
+ +
简介:
+ + + +
) diff --git a/client/containers/ProjectGroups/GroupList/GroupList.scss b/client/containers/ProjectGroups/GroupList/GroupList.scss index 000690ef..24202810 100644 --- a/client/containers/ProjectGroups/GroupList/GroupList.scss +++ b/client/containers/ProjectGroups/GroupList/GroupList.scss @@ -56,6 +56,12 @@ } } } -.modal-input { - margin: 24px; +.add-group-modal { + .modal-input { + margin: 24px; + } + .label { + text-align: right; + line-height: 28px; + } }