diff --git a/.gitignore b/.gitignore index 955c8f40..e95654ed 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,5 @@ node_modules/ runtime/ prd/ dev/ +.tags +.tags1 diff --git a/client/Application.js b/client/Application.js index c0a23b81..2eb8b727 100644 --- a/client/Application.js +++ b/client/Application.js @@ -56,7 +56,7 @@ export default class App extends Component {
- + diff --git a/client/components/Header/Header.js b/client/components/Header/Header.js index cea7289a..9a3e170f 100644 --- a/client/components/Header/Header.js +++ b/client/components/Header/Header.js @@ -10,18 +10,8 @@ import { withRouter } from 'react-router'; import Srch from './Search/Search' const { Header } = Layout; -const headerStyle = { - 'height': '.56rem', - 'lineHeight': '.56rem', - 'padding': 0 -}; - const MenuUser = (props) => ( - + 个人中心 @@ -171,7 +161,7 @@ export default class HeaderCom extends Component { render () { const { login, user, msg, uid } = this.props; return ( -
+
diff --git a/client/components/Header/Header.scss b/client/components/Header/Header.scss index 4b8c7072..6a6d6e56 100644 --- a/client/components/Header/Header.scss +++ b/client/components/Header/Header.scss @@ -13,6 +13,9 @@ $color-black-light : #404040; /* .header-box.css */ .header-box { + height: .56rem; + line-height: .56rem; + padding: 0; .logo { position: relative; float: left; @@ -46,6 +49,24 @@ $color-black-light : #404040; from { background-position: 0px; } to { background-position: -240px; } } + &:before, &:after { + content: ''; + display: block; + width: 2px; + height: .56rem; + background-color: #222; + border-left: 1px solid #575D67; + position: relative; + top: 0; + } + &:before { + float: left; + left: -.08rem; + } + &:after { + float: right; + right: -.27rem; + } } .nav-toolbar { diff --git a/client/containers/Project/AddProject/AddProject.js b/client/containers/AddProject/AddProject.js similarity index 68% rename from client/containers/Project/AddProject/AddProject.js rename to client/containers/AddProject/AddProject.js index 3b43f6ef..672111e6 100644 --- a/client/containers/Project/AddProject/AddProject.js +++ b/client/containers/AddProject/AddProject.js @@ -2,10 +2,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Button, Form, Input, Icon, Tooltip, Select, message, Row, Col, Radio } from 'antd'; -import { addProject, fetchProjectList, delProject, changeUpdateModal, changeTableLoading } from '../../../reducer/modules/project'; -// import { Link } from 'react-router-dom' -// import variable from '../../../constants/variable'; -// import common from '../../../common'; +import { addProject } from '../../reducer/modules/project.js'; +import { fetchGroupList } from '../../reducer/modules/group.js' import { autobind } from 'core-decorators'; const { TextArea } = Input; const FormItem = Form.Item; @@ -30,77 +28,46 @@ const formItemLayout = { @connect( state => { return { - projectList: state.project.projectList, - userInfo: state.project.userInfo, - tableLoading: state.project.tableLoading, - currGroup: state.group.currGroup, - total: state.project.total, - currPage: state.project.currPage + groupList: state.group.groupList } }, { - fetchProjectList, - addProject, - delProject, - changeUpdateModal, - changeTableLoading + fetchGroupList, + addProject } ) + class ProjectList extends Component { constructor(props) { super(props); this.state = { - visible: false, protocol: 'http:\/\/', - projectData: [] + groupList: [] } } static propTypes = { + groupList: PropTypes.array, form: PropTypes.object, - fetchProjectList: PropTypes.func, addProject: PropTypes.func, - delProject: PropTypes.func, - changeUpdateModal: PropTypes.func, - changeTableLoading: PropTypes.func, - projectList: PropTypes.array, - userInfo: PropTypes.object, - tableLoading: PropTypes.bool, - currGroup: PropTypes.object, - total: PropTypes.number, - currPage: PropTypes.number + fetchGroupList: PropTypes.func } // 确认添加项目 @autobind handleOk(e) { - const { form, currGroup, changeTableLoading, addProject, fetchProjectList } = this.props; - const that = this; + const { form, addProject } = this.props; e.preventDefault(); form.validateFields((err, values) => { - // console.log(values); + console.log(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); }); } }); @@ -114,18 +81,9 @@ class ProjectList extends Component { }) } - componentWillReceiveProps(nextProps) { - // 切换项目列表 - if (this.props.projectList !== nextProps.projectList) { - // console.log(nextProps.projectList); - const data = nextProps.projectList.map((item, index) => { - item.key = index; - return item; - }); - this.setState({ - projectData: data - }); - } + async componentWillMount() { + await this.props.fetchGroupList(); + this.setState({groupList: this.props.groupList}); } render() { @@ -157,8 +115,7 @@ class ProjectList extends Component { }] })( )} @@ -227,18 +184,18 @@ class ProjectList extends Component { {...formItemLayout} label="权限" > - {getFieldDecorator('radio-group', { + {getFieldDecorator('project_type', { rules: [{ required: true }], - initialValue: 1 + initialValue: 'private' })( - + 私有
只有组长和项目开发者可以索引并查看项目信息

- + 公开
任何人都可以索引并查看项目信息
diff --git a/client/containers/Project/AddProject/Addproject.scss b/client/containers/AddProject/Addproject.scss similarity index 90% rename from client/containers/Project/AddProject/Addproject.scss rename to client/containers/AddProject/Addproject.scss index cf805cb7..0b3ede2a 100644 --- a/client/containers/Project/AddProject/Addproject.scss +++ b/client/containers/AddProject/Addproject.scss @@ -1,4 +1,4 @@ -@import '../../../styles/common.scss'; +@import '../../styles/common.scss'; .m-container { margin: .24rem auto !important; diff --git a/client/containers/Group/Group.js b/client/containers/Group/Group.js index 0db97fb0..92ca6f07 100644 --- a/client/containers/Group/Group.js +++ b/client/containers/Group/Group.js @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import GroupList from './GroupList/GroupList.js'; import ProjectList from './ProjectList/ProjectList.js'; import Subnav from '../../components/Subnav/Subnav.js'; +import { Route, Switch, Redirect } from 'react-router-dom'; import { Row, Col } from 'antd'; import './Group.scss' @@ -12,6 +13,19 @@ export default class Group extends Component { } render () { + + const GroupContent = ( +
+ + + + + + + + +
+ ) return (
-
- - - - - - - - -
+ + + GroupContent} /> +
) } diff --git a/client/containers/Project/Activity/Activity.js b/client/containers/Project/Activity/Activity.js new file mode 100644 index 00000000..e69de29b diff --git a/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js b/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js new file mode 100644 index 00000000..1b92a5c6 --- /dev/null +++ b/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js @@ -0,0 +1,4 @@ +import React from 'react' +export default () => { + return

hello colContent

+} \ No newline at end of file diff --git a/client/containers/Project/Interface/InterfaceCol/InterfaceColMenu.js b/client/containers/Project/Interface/InterfaceCol/InterfaceColMenu.js new file mode 100644 index 00000000..1b92a5c6 --- /dev/null +++ b/client/containers/Project/Interface/InterfaceCol/InterfaceColMenu.js @@ -0,0 +1,4 @@ +import React from 'react' +export default () => { + return

hello colContent

+} \ No newline at end of file diff --git a/client/containers/Project/Interface/InterfaceList/Edit.js b/client/containers/Project/Interface/InterfaceList/Edit.js new file mode 100644 index 00000000..79fbcc4d --- /dev/null +++ b/client/containers/Project/Interface/InterfaceList/Edit.js @@ -0,0 +1,5 @@ +import React from 'react' + +export default () => { + return

接口Edit

+} \ No newline at end of file diff --git a/client/containers/Project/Interface/InterfaceList/InterfaceContent.js b/client/containers/Project/Interface/InterfaceList/InterfaceContent.js new file mode 100644 index 00000000..bb9cb3b8 --- /dev/null +++ b/client/containers/Project/Interface/InterfaceList/InterfaceContent.js @@ -0,0 +1,25 @@ +import React from 'react' +import { Tabs } from 'antd'; +import Edit from './Edit.js' +import View from './View.js' +import Run from './Run.js' + +const TabPane = Tabs.TabPane; + +const Content = () => { + return
+ + + + + + + + + + + +
+} + +export default Content \ No newline at end of file diff --git a/client/containers/Project/Interface/InterfaceList/InterfaceMenu.js b/client/containers/Project/Interface/InterfaceList/InterfaceMenu.js new file mode 100644 index 00000000..8cfa59c5 --- /dev/null +++ b/client/containers/Project/Interface/InterfaceList/InterfaceMenu.js @@ -0,0 +1,17 @@ +import React from 'react' +import { Menu, Button, Input, Icon, Tag } from 'antd'; +export default () => { + return
+
+ + +
+ + 获取用过个人信息 + + 获取用过个人信息 + + +
+ +} \ No newline at end of file diff --git a/client/containers/Project/Interface/InterfaceList/Run.js b/client/containers/Project/Interface/InterfaceList/Run.js new file mode 100644 index 00000000..3aa0a3ae --- /dev/null +++ b/client/containers/Project/Interface/InterfaceList/Run.js @@ -0,0 +1,5 @@ +import React from 'react' + +export default () => { + return

接口Run

+} \ No newline at end of file diff --git a/client/containers/Project/Interface/InterfaceList/View.js b/client/containers/Project/Interface/InterfaceList/View.js new file mode 100644 index 00000000..4fe8a1eb --- /dev/null +++ b/client/containers/Project/Interface/InterfaceList/View.js @@ -0,0 +1,6 @@ +import React from 'react' + +export default () => { + return

接口预览

+} + diff --git a/client/containers/Project/Interface/interface.scss b/client/containers/Project/Interface/interface.scss new file mode 100644 index 00000000..c2accb43 --- /dev/null +++ b/client/containers/Project/Interface/interface.scss @@ -0,0 +1,70 @@ +.web-content{ + .left-menu{ + min-height: 5rem; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); + background: #FFF; + border-radius:4px; + margin: 3px; + .ant-tabs-bar{ + border-bottom: none; + margin-bottom: 0 + + } + .ant-tabs-nav{ + width:100%; + background-color: #ececec + } + .ant-tabs-tab{ + min-width: 50%; + } + .ant-tabs.ant-tabs-card > .ant-tabs-bar .ant-tabs-tab{ + background-color: #fff + } + .ant-tabs.ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active{ + background-color: #efefef + } + + .interface-filter{ + padding-left: 10px; + height:45px; + line-height: 32px; + padding-top:7px; + background-color: #efefef + } + .interface-list{ + + .btn-http{ + height: 23px; + font-size: 10px; + margin-right: 7px; + padding: 0 5px; + width: 40px; + } + + .btn-http-get{ + background-color: #00a854; + border-color: #00a854 + } + } + } + + .right-content{ + margin:3px; + min-height: 5rem; + box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); + background: #FFF; + border-radius:4px; + .interface-content{ + .ant-tabs-nav{ + width:100% + } + .ant-tabs-nav-wrap{ + text-align: left; + } + } + } +} + + + + diff --git a/client/containers/Project/Project.js b/client/containers/Project/Project.js index 699cc87c..f69827bb 100644 --- a/client/containers/Project/Project.js +++ b/client/containers/Project/Project.js @@ -3,8 +3,11 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types' import { Route, Switch, Redirect } from 'react-router-dom'; import { Subnav } from '../../components/index' -import Interface from './Interface/Interface.js' import { getProject } from '../../reducer/modules/project'; +import { Interface } from './Interface/Interface.js' +import { Activity } from './Activity/Activity.js' +import { Setting } from './Setting/Setting.js' + @connect( state => { @@ -39,6 +42,7 @@ export default class Project extends Component { render () { const { match } = this.props; + console.log('project') return (
- - + + - +
) diff --git a/client/containers/Project/Setting/Setting.js b/client/containers/Project/Setting/Setting.js new file mode 100644 index 00000000..e69de29b diff --git a/client/containers/User/Profile.js b/client/containers/User/Profile.js index e6e04912..f755350c 100644 --- a/client/containers/User/Profile.js +++ b/client/containers/User/Profile.js @@ -3,11 +3,23 @@ import { Row, Col, Input, Button, Select, message, Upload, Icon } from 'antd' import axios from 'axios'; import {formatTime} from '../../common.js' import PropTypes from 'prop-types' +import { connect } from 'react-redux' + +@connect(state=>{ + return { + curUid: state.user.uid, + userType: state.user.type + } +},{ + +}) class Profile extends Component { static propTypes = { - match: PropTypes.object + match: PropTypes.object, + curUid: PropTypes.number, + userType: PropTypes.string } constructor(props) { @@ -126,12 +138,21 @@ class Profile extends Component { const Option = Select.Option; let userinfo = this.state.userinfo; let _userinfo = this.state._userinfo; - let roles = { admin: '管理员', member: '会员' } + let roles = { admin: '管理员', member: '会员' }; + let userType = ""; + if(this.props.userType === "third"){ + userType = false; + }else if(this.props.userType === "site"){ + userType = true; + }else{ + userType = false; + } + if (this.state.usernameEdit === false) { userNameEditHtml =
{userinfo.username}   {/* { this.handleEdit('usernameEdit', true) }}>修改*/} - + {userType?:""}
} else { userNameEditHtml =
@@ -147,7 +168,7 @@ class Profile extends Component { emailEditHtml =
{userinfo.email}   {/* { this.handleEdit('emailEdit', true) }} >修改*/} - + {userType?:""}
} else { emailEditHtml =
@@ -163,7 +184,7 @@ class Profile extends Component { roleEditHtml =
{roles[userinfo.role]}   {/* { this.handleEdit('roleEdit', true) }} >修改*/} - + {userType?:""}
} else { roleEditHtml =