Commit 97dcfcca by bert

自动化构建

parent 2d18835f
......@@ -17,109 +17,113 @@ const SubMenu = Menu.SubMenu
import styles from '../../views/App/index.less'
const defaultProps = {
leftMenu: [],
currentIndex: 0
leftMenu: [],
currentIndex: 0
}
const propTypes = {
leftMenu: PropTypes.array,
currentIndex: PropTypes.number
leftMenu: PropTypes.array,
currentIndex: PropTypes.number
}
const contextTypes = {
router: PropTypes.object.isRequired,
store: PropTypes.object.isRequired
router: PropTypes.object.isRequired,
store: PropTypes.object.isRequired
};
class Sidebar extends React.Component {
constructor(props) {
super(props)
this.menuClickHandle = this.menuClickHandle.bind(this);
this.logout = this.logout.bind(this);
}
componentDidMount() {
this.props.MenuAction.getCaseMenu();
}
menuClickHandle(item) {
this.props.updateNavPath(item.keyPath, item.key)
console.log('menuClickHandle click ', item);
this.setState({
current: item.key,
});
}
logout() {
this.props.logout();
}
onClick(e) {
}
render() {
const { leftMenu } = this.props
let openKey = []
const menu = leftMenu.map((item) => {
openKey.push('sub' + item.key)
return (
<Menu.Item style={{ zIndex: 10 }} key={item.key}>
<Badge dot={item.dot}>
<Icon type={item.icon} />
</Badge>
<span className={styles["nav-text"]}>{item.name}</span>
<span className={styles["nav-badge"]} style={{ float: 'right' }}>{ item.num }</span>
</Menu.Item>
)
});
// <div className="nav-portrait-title">编辑显示昵称</div>
// return (
// <aside className="ant-layout-sider">
// <div className="ant-layout-logo"><img src={logo} /><span className="nav-text">催费跟踪后台</span></div>
// <div className="ant-layout-portrait">
// <div className="nav-portrait"><img src={OPERATOR_INFO.avatarUrl + OPERATOR_INFO.operatorId} /></div>
// <div className="nav-portrait-name">{OPERATOR_INFO.operator}</div>
// <div className="nav-portrait-title" onClick={this.logout}>注销</div>
// </div>
// <Menu mode="inline" theme="dark" onClick={this.onClick.bind(this)} selectedKeys={defaultSelectedKeys}>
// { menu }
// </Menu>
// </aside>
// )
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"]} style={{marginBottom: '10px'}}>
<div className={styles["nav-portrait"]}><img src={touxiang} /></div>
<div className={styles["nav-portrait-name"]}>admin</div>
</div>
<Menu mode="inline" theme="dark" onClick={this.onClick.bind(this) }>
{ menu }
</Menu>
</aside>
)
}
constructor(props) {
super(props)
this.menuClickHandle = this.menuClickHandle.bind(this);
this.logout = this.logout.bind(this);
}
componentDidMount() {
this.props.MenuAction.getCaseMenu();
}
menuClickHandle(item) {
this.props.updateNavPath(item.keyPath, item.key)
console.log('menuClickHandle click ', item);
this.setState({
current: item.key,
});
}
logout() {
this.props.logout();
}
onClick(e) {
}
render() {
const { leftMenu } = this.props
console.log('this.props', this.props.dispatch);
let openKey = []
const menu = leftMenu.map((item) => {
openKey.push('sub' + item.key)
return (
<Menu.Item style={{ zIndex: 10 }} key={item.key}>
<Link to={'' + item.key}>
<Badge dot={item.dot}>
<Icon type={item.icon} />
</Badge>
<span className={styles["nav-text"]}>{item.name}</span>
<span className={styles["nav-badge"]} style={{ float: 'right' }}>{ item.num }</span>
</Link>
</Menu.Item>
)
});
// <div className="nav-portrait-title">编辑显示昵称</div>
// return (
// <aside className="ant-layout-sider">
// <div className="ant-layout-logo"><img src={logo} /><span className="nav-text">催费跟踪后台</span></div>
// <div className="ant-layout-portrait">
// <div className="nav-portrait"><img src={OPERATOR_INFO.avatarUrl + OPERATOR_INFO.operatorId} /></div>
// <div className="nav-portrait-name">{OPERATOR_INFO.operator}</div>
// <div className="nav-portrait-title" onClick={this.logout}>注销</div>
// </div>
// <Menu mode="inline" theme="dark" onClick={this.onClick.bind(this)} selectedKeys={defaultSelectedKeys}>
// { menu }
// </Menu>
// </aside>
// )
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"]} style={{ marginBottom: '10px' }}>
<div className={styles["nav-portrait"]}><img src={touxiang} /></div>
<div className={styles["nav-portrait-name"]}>admin</div>
</div>
<Menu mode="inline" theme="dark" onClick={this.onClick.bind(this) }>
{ menu }
</Menu>
</aside>
)
}
}
Sidebar.propTypes = propTypes;
Sidebar.defaultProps = defaultProps;
Sidebar.contextTypes = contextTypes;
function mapStateToProps(state) {
console.log('state', state);
return {
leftMenuType: state.menu.leftMenuType,
leftMenu: state.menu.leftMenu,
currentIndex: state.menu.currentIndex,
}
console.log('state', state);
return {
leftMenuType: state.menu.leftMenuType,
leftMenu: state.menu.leftMenu,
currentIndex: state.menu.currentIndex,
}
}
function mapDispatchToProps(dispatch) {
return {
logout: bindActionCreators(logout, dispatch),
MenuAction: bindActionCreators(MenuAction, dispatch)
}
return {
logout: bindActionCreators(logout, dispatch),
MenuAction: bindActionCreators(MenuAction, dispatch)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Sidebar)
// 纯数据展现情况列表
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
import Reqwest from 'reqwest';
......
// 纯数据展现情况列表
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
import Reqwest from 'reqwest';
......
// 纯数据展现情况列表
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
import Reqwest from 'reqwest';
......
// 纯数据展现情况列表
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
import Reqwest from 'reqwest';
......
// 含有可操作 table 栏的数据展示
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
//https://github.com/ded/reqwest
......
// 含有可操作 table 栏的数据展示
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
//https://github.com/ded/reqwest
......
// 纯数据展现情况列表
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
import Reqwest from 'reqwest';
......
// 含有可操作 table 栏的数据展示
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
//https://github.com/ded/reqwest
......
// 含有可操作 table 栏的数据展示
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
//https://github.com/ded/reqwest
......
// 含有可操作 table 栏的数据展示
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
//https://github.com/ded/reqwest
......
// 含有可操作 table 栏的数据展示
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
//https://github.com/ded/reqwest
......
// 含有可操作 table 栏的数据展示
import React from 'react';
import FeatureSetConfig from '../component/FeatureSetConfig';
import FeatureSetConfig from '../components/FeatureSetConfig';
import Immutable from 'immutable';
//https://github.com/ded/reqwest
......
......@@ -3,7 +3,7 @@ import React from 'react';
import { Upload, Icon } from 'antd';
import baidubce from 'bce-sdk-js';
import BDUploader from '../component/BDUploader';
import BDUploader from '../components/BDUploader';
const Feature7 = React.createClass({
getInitialState: function() {
......
module.exports.caseMenu = [
{
key: 'ongoing',
name: '侧边菜单1',
key: 'home',
name: 'Home',
icon: 'info-circle-o',
num: '10',
dot: false
},
{
key: 'completed',
name: '侧边菜单2',
key: 'test',
name: 'Test',
icon: 'check-circle-o',
num: '20',
dot: false
},
{
key: 'confirm_completed',
name: '侧边菜单3',
key: 'feature1',
name: '列表',
icon: 'check-circle',
num: '11',
dot: false
},
{
key: 'closed',
name: '侧边菜单4',
key: 'feature1_1',
name: '表单',
icon: 'poweroff',
num: '12',
dot: false
},
{
key: 'feature1_3',
name: '统计图',
icon: 'poweroff',
num: '12',
dot: false
......
......@@ -8,20 +8,5 @@ module.exports = [
key: 'test',
name: 'Test',
icon: 'user'
},
{
key: 'login',
name: 'Login',
icon: 'eye-o'
},
{
key: 'test2',
name: '404错误',
icon: 'setting'
},
{
key: 'feature1',
name: 'Feature1',
icon: 'poweroff'
}
]
......@@ -5,6 +5,8 @@ import Home from '../views/Home';
import Login from '../views/Login';
import Test from '../views/Test';
import Feature1 from '../feature/Feature1';
import Feature1_1 from '../feature/Feature1-1';
import Feature1_3 from '../feature/Feature1-3';
import NotFound from '../components/NotFound';
function validate() {
......@@ -21,6 +23,8 @@ const Routes = ({ history }) =>
<Route path="app" component={App}/>
<Route path="test" component={Test}/>
<Route path="feature1" component={Feature1}/>
<Route path="feature1_1" component={Feature1_1}/>
<Route path="feature1_3" component={Feature1_3}/>
</Route>
</Route>
......
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