From eb931166ef77882d8c7e5fc32bc0707ea833682f Mon Sep 17 00:00:00 2001 From: "wenbo.dong" Date: Fri, 11 Aug 2017 17:47:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E5=B9=BF=E5=9C=BA?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectCard.js} | 6 +- .../ProjectCard.scss} | 0 client/components/index.js | 4 +- client/containers/Follows/Follows.js | 10 +- client/containers/Group/Group.js | 9 +- .../containers/Group/MemberList/MemberList.js | 16 ++ .../Group/MemberList/MemberList.scss | 8 + .../Group/ProjectList/ProjectList.js | 149 +----------------- .../Group/ProjectList/ProjectList.scss | 13 +- client/containers/Login/Login.scss | 5 - static/doc/api.html | 16 +- .../static/server/controllers/follow.js.html | 11 +- 12 files changed, 65 insertions(+), 182 deletions(-) rename client/components/{ProjectBox/ProjectBox.js => ProjectCard/ProjectCard.js} (76%) rename client/components/{ProjectBox/ProjectBox.scss => ProjectCard/ProjectCard.scss} (100%) create mode 100644 client/containers/Group/MemberList/MemberList.js create mode 100644 client/containers/Group/MemberList/MemberList.scss diff --git a/client/components/ProjectBox/ProjectBox.js b/client/components/ProjectCard/ProjectCard.js similarity index 76% rename from client/components/ProjectBox/ProjectBox.js rename to client/components/ProjectCard/ProjectCard.js index 40dd0207..210a9586 100644 --- a/client/components/ProjectBox/ProjectBox.js +++ b/client/components/ProjectCard/ProjectCard.js @@ -1,8 +1,8 @@ -import './ProjectBox.scss' +import './ProjectCard.scss' import React, { Component } from 'react' // import PropTypes from 'prop-types' -class ProjectBox extends Component { +class ProjectCard extends Component { constructor(props) { super(props); this.state = { @@ -25,4 +25,4 @@ class ProjectBox extends Component { } -export default ProjectBox \ No newline at end of file +export default ProjectCard diff --git a/client/components/ProjectBox/ProjectBox.scss b/client/components/ProjectCard/ProjectCard.scss similarity index 100% rename from client/components/ProjectBox/ProjectBox.scss rename to client/components/ProjectCard/ProjectCard.scss diff --git a/client/components/index.js b/client/components/index.js index 4bfa756d..f44bd2e2 100644 --- a/client/components/index.js +++ b/client/components/index.js @@ -4,7 +4,7 @@ import Header from './Header/Header.js' import Intro from './Intro/Intro.js' import Loading from './Loading/Loading.js' import MockDoc from './MockDoc/MockDoc.js' -import ProjectBox from './ProjectBox/ProjectBox.js' +import ProjectCard from './ProjectCard/ProjectCard.js' import Subnav from './Subnav/Subnav.js' export { @@ -14,6 +14,6 @@ export { Intro, Loading, MockDoc, - ProjectBox, + ProjectCard, Subnav } diff --git a/client/containers/Follows/Follows.js b/client/containers/Follows/Follows.js index 31aefb09..d5a2c60a 100644 --- a/client/containers/Follows/Follows.js +++ b/client/containers/Follows/Follows.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import './Follows.scss'; import Subnav from '../../components/Subnav/Subnav.js'; -import ProjectBox from '../../components/ProjectBox/ProjectBox.js'; +import ProjectCard from '../../components/ProjectCard/ProjectCard.js'; class Follows extends Component { render () { @@ -19,10 +19,10 @@ class Follows extends Component {
- - - - + + + +
diff --git a/client/containers/Group/Group.js b/client/containers/Group/Group.js index 92ca6f07..20204a10 100644 --- a/client/containers/Group/Group.js +++ b/client/containers/Group/Group.js @@ -1,9 +1,11 @@ import React, { Component } from 'react'; import GroupList from './GroupList/GroupList.js'; import ProjectList from './ProjectList/ProjectList.js'; +import MemberList from './MemberList/MemberList.js'; import Subnav from '../../components/Subnav/Subnav.js'; import { Route, Switch, Redirect } from 'react-router-dom'; -import { Row, Col } from 'antd'; +import { Row, Col, Tabs } from 'antd'; +const TabPane = Tabs.TabPane; import './Group.scss' @@ -21,7 +23,10 @@ export default class Group extends Component { - + + + + diff --git a/client/containers/Group/MemberList/MemberList.js b/client/containers/Group/MemberList/MemberList.js new file mode 100644 index 00000000..d1691ae8 --- /dev/null +++ b/client/containers/Group/MemberList/MemberList.js @@ -0,0 +1,16 @@ +import React, { Component } from 'react'; + +import './MemberList.scss' + +class MemberList extends Component { + render() { + return ( +
+ chengyuan 列表 成员 + +
+ ); + } +} + +export default MemberList; diff --git a/client/containers/Group/MemberList/MemberList.scss b/client/containers/Group/MemberList/MemberList.scss new file mode 100644 index 00000000..1b9f455e --- /dev/null +++ b/client/containers/Group/MemberList/MemberList.scss @@ -0,0 +1,8 @@ +.m-panel{ + background-color: #fff; + padding: 24px; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); + border-radius: 4px; + min-height: 5rem; + margin-top: 0; +} diff --git a/client/containers/Group/ProjectList/ProjectList.js b/client/containers/Group/ProjectList/ProjectList.js index f0c38eda..acbbf6da 100644 --- a/client/containers/Group/ProjectList/ProjectList.js +++ b/client/containers/Group/ProjectList/ProjectList.js @@ -1,16 +1,12 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; -import { Table, Button, Modal, Form, Input, Icon, Tooltip, Select, Popconfirm, message } from 'antd'; +import { Table, Popconfirm, message } from 'antd'; import { addProject, fetchProjectList, delProject, changeUpdateModal, changeTableLoading } from '../../../reducer/modules/project'; -import UpDateModal from './UpDateModal'; import { Link } from 'react-router-dom' import variable from '../../../constants/variable'; import common from '../../../common'; import { autobind } from 'core-decorators'; -const { TextArea } = Input; -const FormItem = Form.Item; -const Option = Select.Option; import './ProjectList.scss' @@ -78,17 +74,6 @@ const getColumns = (data, props) => { }]; } -const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 14 } - } -}; - @connect( state => { return { @@ -132,49 +117,6 @@ class ProjectList extends Component { currPage: PropTypes.number } - // 显示模态框 - 创建项目 - @autobind - showAddProjectModal() { - this.setState({ - visible: true - }); - } - - // 确认添加项目 - @autobind - handleOk(e) { - const { form, currGroup, changeTableLoading, addProject, fetchProjectList } = this.props; - const that = this; - e.preventDefault(); - form.validateFields((err, values) => { - if (!err) { - values.protocol = this.state.protocol.split(':')[0]; - // 获取当前分组id传入values - values.group_id = currGroup._id; - - changeTableLoading(true); - addProject(values).then((res) => { - // 添加项目成功后再次请求列表 - if (res.payload.data.errcode == 0) { - that.setState({ - visible: false - }); - form.resetFields(); - message.success('创建成功! '); - fetchProjectList(currGroup._id, this.props.currPage).then(() => { - changeTableLoading(false); - }); - } else { - changeTableLoading(false); - message.error(res.payload.data.errmsg); - } - }).catch(() => { - changeTableLoading(false); - }); - } - }); - } - // 取消修改 @autobind handleCancel() { @@ -235,93 +177,8 @@ class ProjectList extends Component { } render() { - const { getFieldDecorator } = this.props.form; return ( -
- -
- - - {getFieldDecorator('name', { - rules: [{ - required: true, message: '请输入项目名称!' - }] - })( - - )} - - - - 线上域名  - - - - - )} - > - {getFieldDecorator('prd_host', { - rules: [{ - required: true, - message: '请输入项目线上域名!' - }] - })( - - - - )} /> - )} - - - - 基本路径  - - - - - )} - > - {getFieldDecorator('basepath', { - rules: [{ - required: false, message: '请输入项目基本路径' - }] - })( - - )} - - - - {getFieldDecorator('desc', { - rules: [{ - required: false, message: '请输入描述!' - }] - })( -