From d047389d9730ed536a226175724ba593354ef709 Mon Sep 17 00:00:00 2001 From: suxiaoxin Date: Fri, 14 Jul 2017 19:47:12 +0800 Subject: [PATCH] feat: add user module --- client/containers/User/index.js | 55 ++++++++++++++++++ client/containers/User/index.scss | 39 +++++++++++++ client/containers/User/userList/userList.js | 25 +++++++++ .../User/userTable/InterfaceTable.js | 56 +++++++++++++++++++ client/reducer/Login/login.js | 2 +- 5 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 client/containers/User/index.js create mode 100644 client/containers/User/index.scss create mode 100644 client/containers/User/userList/userList.js create mode 100644 client/containers/User/userTable/InterfaceTable.js diff --git a/client/containers/User/index.js b/client/containers/User/index.js new file mode 100644 index 00000000..5e288015 --- /dev/null +++ b/client/containers/User/index.js @@ -0,0 +1,55 @@ +import './index.scss' +import React, { Component } from 'react' +import { connect } from 'react-redux' +import PropTypes from 'prop-types' +import Header from '../../components/Header/Header.js' + + +@connect( + state => { + return { + + } + }, + { + // fetchInterfaceData, + // projectMember, + // closeProjectMember + } +) + +class user extends Component { + static propTypes = { + fetchInterfaceData: PropTypes.func, + interfaceData: PropTypes.array, + projectMember: PropTypes.func, + closeProjectMember: PropTypes.func, + modalVisible: PropTypes.bool + } + + constructor(props) { + super(props) + } + + componentWillMount () { + + } + + render () { + + + return ( +
+
+ +
+ + + +
+
+ ) + } +} + +export default Interface \ No newline at end of file diff --git a/client/containers/User/index.scss b/client/containers/User/index.scss new file mode 100644 index 00000000..e5733c85 --- /dev/null +++ b/client/containers/User/index.scss @@ -0,0 +1,39 @@ +/* .user-box.css */ +.user-box { + max-width: 11rem; + display: -webkit-box; + -webkit-box-flex: 1; + margin: 15px auto 0 auto; + font-size: 0.14rem; + background: #FFF; + + .user-list { + width: 216px; + line-height: 45px; + background: #f9fafe; + + li { + padding: 0 0 0 30px; + color: #344562; + cursor: pointer; + + &:hover, &.active { + background: #657289; + color: #FFF; + } + } + } + + .user-table { + -webkit-box-flex: 1; + margin: 0 0 0 20px; + + .ant-table-wrapper table { + font-size: .14rem; + + button { + margin: 0 10px 0 0; + } + } + } +} \ No newline at end of file diff --git a/client/containers/User/userList/userList.js b/client/containers/User/userList/userList.js new file mode 100644 index 00000000..9c6a689f --- /dev/null +++ b/client/containers/User/userList/userList.js @@ -0,0 +1,25 @@ +import React, { Component } from 'react' +import PropTypes from 'prop-types' + +class InterfaceList extends Component { + static propTypes = { + projectMember: PropTypes.func + } + + constructor(props) { + super(props) + } + + render () { + const { projectMember } = this.props + + return ( + + ) + } +} + +export default InterfaceList \ No newline at end of file diff --git a/client/containers/User/userTable/InterfaceTable.js b/client/containers/User/userTable/InterfaceTable.js new file mode 100644 index 00000000..c2e73fd2 --- /dev/null +++ b/client/containers/User/userTable/InterfaceTable.js @@ -0,0 +1,56 @@ +import React, { Component } from 'react' +import { Table, Button } from 'antd' +import PropTypes from 'prop-types' + +class InterfaceTable extends Component { + static propTypes = { + data: PropTypes.array + } + + constructor(props) { + super(props) + } + + render () { + const columns = [{ + title: 'Uid', + dataIndex: 'uid', + key: 'uid' + }, { + title: '用户名', + dataIndex: 'username', + key: 'username' + }, { + title: 'email', + dataIndex: 'email', + key: 'email' + }, { + title: '更新日期', + dataIndex: 'up_time', + key: 'up_time' + }, { + title: '功能', + 'key': 'action', + render: () => { + return ( + + + + + ) + } + }] + + const data = [ + {uid: 1, username: 'admin', email: 'admin@admin.com', up_time: '2017.07.01'} + ]; + + return ( +
+ + + ) + } +} + +export default InterfaceTable diff --git a/client/reducer/Login/login.js b/client/reducer/Login/login.js index a476c67d..c258b49f 100644 --- a/client/reducer/Login/login.js +++ b/client/reducer/Login/login.js @@ -4,7 +4,7 @@ import { } from '../../constants/action-types'; const initialState = { - isLogin: true, + isLogin: false, userName: null, uid: null, loginWrapActiveKey:"1"