Commit 25b2b7d6 by bert

v1

parent 8b9789b8
# 1.0.0
`2016.07.23`
- 提供登入功能
- 提供主页框架与简单展示
\ No newline at end of file
......@@ -6,7 +6,7 @@ import styles from './index.less'
// import styles from './index.less';
import { Link } from 'react-router'
// import * as menu from '../../store/modules/menu/menu_action'
import * as menu from '../../store/modules/menu/menu_action'
import logo from './logo.png'
......@@ -35,7 +35,7 @@ class Header extends React.Component {
/**
* 初始化头部菜单,通过服务端获取。
*/
// this.props.menu.getTopMenu()
this.props.menu.getTopMenu()
}
menuClickHandle (item) {
......@@ -77,53 +77,8 @@ class Header extends React.Component {
}
render () {
// const { topMenu, user, collapse, routing } = this.props
// const basename = '/newIndex.html/';
// let selectKey = routing.locationBeforeTransitions && routing.locationBeforeTransitions.pathname.split('/')[1]
// console.log('selectKey', selectKey);
// console.log('routing', routing);
// console.log('THIS.PROPS', this.props);
const topMenu = [
{
key: 'add_task',
name: '发起任务',
icon: 'edit'
},
{
key: 'my_case',
name: '我的发布',
icon: 'book'
},
{
key: 'my_task',
name: '我的任务',
icon: 'user'
},
{
key: 'my_focus',
name: '我的关注',
icon: 'eye-o'
},
{
key: 'case_manage',
name: 'case管理',
icon: 'setting'
}, {
key: 'case_group',
name: '分组管理',
icon: 'tags-o'
}, {
key: 'case_rank',
name: '统计排名',
icon: 'line-chart'
}, {
key: 'index.html',
name: '返回旧版',
icon: 'retweet'
}
];
const { topMenu } = this.props;
console.log('topMenu', topMenu);
const menu = topMenu.map((item) => {
/**
* 遍历 `topMenu` 显示顶部信息
......@@ -177,58 +132,19 @@ Header.propTypes = propTypes;
Header.defaultProps = defaultProps;
const mapStateToProps = (state) => {
console.log('state', state);
return {
// topMenu : state.menu.topMenu,
topMenu : state.menu.topMenu,
// currentIndex : state.menu.currentIndex,
// collapse : state.menu.collapse,
// selectKey : state.menu.selectKey,
// router : state.router,
// routing : state.routing,
// selectKey : state.menu.selectKey
};
};
function mapDispatchToProps(dispatch) {
return {
// menu: bindActionCreators(menu, dispatch),
menu: bindActionCreators(menu, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Header);
\ No newline at end of file
// handleClick(e) {
// /**
// * 旧版头部功能
// *
// * 目前已经停用,留着以后用到时方便
// *
// */
// console.log('click ', e);
// this.setState({
// current: e.key,
// });
// }
// render () {
// const {user} = this.props
// return (
// <div className='ant-layout-header'>
// <div className="ant-layout-wrapper">
// <Menu className="header-menu" onClick={this.handleClick} style={{lineHeight: '64px'}}
// mode="horizontal">
// <SubMenu title={<span><Icon type="user" />{user.user}</span>}>
// <Menu.Item key="setting:1">选项1</Menu.Item>
// <Menu.Item key="setting:2">选项2</Menu.Item>
// <Menu.Divider />
// <Menu.Item key="setting:3">注销</Menu.Item>
// </SubMenu>
// <Menu.Item key="mail">
// <Icon type="question" />帮助
// </Menu.Item>
// </Menu>
// </div>
// </div>
// )
// }
\ No newline at end of file
......@@ -9,8 +9,8 @@ import { logout } from '../../store/modules/user/user_action';
// import * as Util from '../../util';
import logo from './logo.png'
import touxiang from './touxiang.png'
import logo from './logo.jpg'
import touxiang from './touxiang.jpg'
const SubMenu = Menu.SubMenu
......@@ -91,10 +91,9 @@ class Sidebar extends React.Component {
return (
<aside className={styles["ant-layout-sider"]}>
<div className={styles["ant-layout-logo"]}><img src={logo} /><span className={styles["nav-text"]}>xxxx后台</span></div>
<div className={styles["ant-layout-portrait"]}>
<div className={styles["ant-layout-portrait"]} style={{marginBottom: '10px'}}>
<div className={styles["nav-portrait"]}><img src={touxiang} /></div>
<div className={styles["nav-portrait-name"]}>admin</div>
<div className={styles["nav-portrait-title"]} onClick={this.logout}>注销</div>
</div>
<Menu mode="inline" theme="dark" onClick={this.onClick.bind(this) }>
{ menu }
......
module.exports.caseMenu = [
{
key: 'ongoing',
name: '待处理数',
name: '侧边菜单1',
icon: 'info-circle-o',
num: '10',
dot: false
},
{
key: 'completed',
name: '已完成数',
name: '侧边菜单2',
icon: 'check-circle-o',
num: '20',
dot: false
},
{
key: 'confirm_completed',
name: '确认完成',
name: '侧边菜单3',
icon: 'check-circle',
num: '11',
dot: false
},
{
key: 'closed',
name: '已关闭数',
name: '侧边菜单4',
icon: 'poweroff',
num: '12',
dot: false
},
{
key: 'gratuity',
name: '获得打赏',
icon: 'pay-circle-o',
num: '10',
dot: false
},
{
key: 'thumb_up',
name: '总点赞数',
icon: 'like',
num: '101',
dot: false
},
{
key: 'dislike',
name: '总差评数',
icon: 'dislike',
num: '0',
dot: false
}
]
......
import React from 'react'
import { Link } from 'react-router'
module.exports = [
{
title: '工号',
dataIndex: 'caseNo',
}, {
title: '标题',
render: (text, record, index) => <div className="yincang" style={{width: '300'}}>{record.caseTitle}</div>,
},{
title: '发起人',
dataIndex: 'createUser',
key: 'createUser'
},{
title: '发起时间',
dataIndex: 'createTime',
key: 'createTime',
sorter: true
},{
title: '执行人',
render: (text, record, index) => record.executorList[0] && record.executorList[0].userName,
key: 'executorUser'
},{
title: '类型',
dataIndex: 'caseTypeName',
key: 'caseTypeName' ,
filters: [
{ text: '管理', value: 'manage' },
{ text: '信息', value: 'info' },
{ text: '数据', value: 'data' },
{ text: '间接', value: 'indirect' },
{ text: '派单', value: 'dispatch' },
{ text: 'Bug信息', value: 'bug' }],
// filterMultiple: false
},{
title: '状态',
render: function(text, record, index){
switch (record.status) {
case '1':
return (<div><span className="case-state state-error"></span>进行中</div>);
case '2':
return (<div><span className="case-state state-success"></span>已完成</div>);
case '3':
return (<div><span className="case-state state-close"></span>确认完成</div>);
case '4':
return (<div><span className="case-state state-close"></span>已关闭</div>);
}
},
key: 'status',
},{
title: '催费金额',
dataIndex: 'amount',
key: 'amount',
sorter: true
},{
title: '关注人',
render: (text, record, index) => <div className="yincang" style={{width: '400'}}>{record.focusList}</div>,
key: 'focusUser'
},{
title: '管理',
key: 'operation',
fixed: 'right',
render: (record) => <Link to={{pathname:"case_detail/" + record.id}}>详情</Link>
}
]
\ No newline at end of file
module.exports = [
// {
// key: 'releaseTask',
// name: '发起任务',
// icon: 'edit'
// },
{
key: 'myMain',
name: '我的发布',
key: 'home',
name: 'Home',
icon: 'book'
},
{
key: 'home',
name: '我的任务',
key: 'test',
name: 'Test',
icon: 'user'
},
{
key: 'myTask',
name: '我的关注',
key: 'login',
name: 'Login',
icon: 'eye-o'
},
{
key: 'manage',
name: 'case管理',
key: 'test2',
name: '404错误',
icon: 'setting'
},{
key: 'index.html',
name: '返回旧版',
icon: 'retweet'
}
]
......@@ -12,7 +12,7 @@ function validate() {
const Routes = ({ history }) =>
<Router history={history}>
<Route path="/login" component={Login}/>
<Route path="/" onEnter={validate}>
<IndexRedirect to="home" />
<Route component={App}>
......
......@@ -2,7 +2,8 @@ import api from '../../../api';
import types from '../../types';
import reqwest from 'reqwest';
import {emptyMenu, caseMenu} from '../../../fake/leftMenu';
import {emptyMenu, caseMenu} from '../../../feature/leftMenu';
import topMenu from '../../../feature/topMenu';
/**
* 顶部菜单切换,更新面包屑
......@@ -32,8 +33,8 @@ export function updateNavPath(path, key) {
export function getTopMenu() {
return {
type: types.GET_TOP_MENU,
payload: {
promise: api.get('topmenu', {})
params: {
topMenu: topMenu
}
}
}
......
......@@ -6,8 +6,8 @@ import initialState from './menu_state';
import objectAssign from 'object-assign';
export default createReducer(initialState, {
[`${types.GET_TOP_MENU}_SUCCESS`]: (state, data) => {
return objectAssign({}, state, { topMenu: data.content });
[`${types.GET_TOP_MENU}`]: (state, data, params) => {
return objectAssign({}, state, { topMenu: params.topMenu });
},
[`${types.UPDATE_NAVPATH}`]: (state, data) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment