|
@@ -1,143 +0,0 @@
|
|
|
-import React, { PureComponent } from 'react';
|
|
|
-import { connect } from 'react-redux';
|
|
|
-import { actionCreators } from './store';
|
|
|
-import { BrowserRouter, Route,Link } from 'react-router-dom';
|
|
|
-
|
|
|
-import Lockstore from '../content/lock_store.js';
|
|
|
-import Lockstatistics from '../content/lock_statistics.js';
|
|
|
-
|
|
|
-class Submenu extends PureComponent {
|
|
|
-
|
|
|
- render() {
|
|
|
- // const { inputValue, handleInputFocus,handleInputChange, menu, list } = this.props;
|
|
|
- return (
|
|
|
-
|
|
|
-
|
|
|
- <BrowserRouter>
|
|
|
-
|
|
|
- <aside className="page-sidebar">
|
|
|
- <div className="page-logo">
|
|
|
- <a href="#modal-shortcut" class="page-logo-link press-scale-down d-flex align-items-center position-relative" data-toggle="modal">
|
|
|
- <div className="icon-stack fa-2x">
|
|
|
- <i className="base base-7 icon-stack-3x opacity-100 color-danger-900 "></i>
|
|
|
- <i className="base base-4 icon-stack-2x opacity-100 color-danger-600 "></i>
|
|
|
- <i className="fal fa-box icon-stack-1x opacity-100 color-white"></i>
|
|
|
- </div>
|
|
|
- <span className="page-logo-text mr-1">产品</span>
|
|
|
- <span className="position-absolute text-white opacity-50 small pos-top pos-right mr-2 mt-n2"></span>
|
|
|
- <i className="ni ni-my-apps d-inline-block ml-1 fs-lg color-primary-300"></i>
|
|
|
- </a>
|
|
|
- </div>
|
|
|
- <nav id="js-primary-nav" className="primary-nav" role="navigation">
|
|
|
- <ul id="js-nav-menu" className="nav-menu">
|
|
|
- <li className="active open">
|
|
|
- <a href="#" title="软件锁" data-filter-tags="软件锁" class="waves-effect waves-themed">
|
|
|
- <i className="fal fa-magic "></i>
|
|
|
- <span className="nav-link-text">软件锁</span>
|
|
|
- </a>
|
|
|
- <ul>
|
|
|
- <li className="active">
|
|
|
- {<Link to='/product/Lockstore'>公共锁库</Link>}
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- {<Link to='/product/lockStatistics'>使用统计</Link>}
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </li>
|
|
|
- <li className="">
|
|
|
- <a href="#" title="Application Intel" data-filter-tags="application intel">
|
|
|
- <i className="fal fa-cloud "></i>
|
|
|
- <span className="nav-link-text">云版管理</span>
|
|
|
- </a>
|
|
|
- <ul>
|
|
|
- <li>
|
|
|
- <a href="intel_analytics_dashboard.html" title="Analytics Dashboard" data-filter-tags="application intel analytics dashboard">
|
|
|
- <span className="nav-link-text">养护云版</span>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <a href="intel_marketing_dashboard.html" title="Marketing Dashboard" data-filter-tags="application intel marketing dashboard">
|
|
|
- <span className="nav-link-text">建筑云版</span>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
-
|
|
|
- </nav>
|
|
|
-
|
|
|
- </aside>
|
|
|
- <div className="page-content-wrapper">
|
|
|
- <Route path='/product/Lockstore' exact component={Lockstore} ></Route>
|
|
|
- <Route path='/product/lockStatistics' exact component={Lockstatistics} ></Route>
|
|
|
- {/*<Route path='/product/lockStatistics' exact render={()=><div>16515</div>} ></Route>*/}
|
|
|
- </div>
|
|
|
- </BrowserRouter>
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- //组件即将要被挂在的时候执行的方法--
|
|
|
- componentDidMount(){
|
|
|
- //逻辑代码可以写在mapDispathToProps里 this.props.方法
|
|
|
-
|
|
|
- // axios.get('/api/submenuList.json').then((res) => {
|
|
|
- // const data = res.data;
|
|
|
- // dispatch(changeList(data.data));
|
|
|
- // }).catch(() => {
|
|
|
- // console.log('error');
|
|
|
- // })
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/**
|
|
|
- * store里的数据映射到这个组件里的state
|
|
|
- * @param {*} state
|
|
|
- */
|
|
|
-const mapStateToProps = (state) => {
|
|
|
-
|
|
|
- return {
|
|
|
- //menu: state.submenu.menu
|
|
|
- menu: state.getIn(['submenu', 'menu']),
|
|
|
- list: state.getIn(['submenu', 'list']),
|
|
|
- inputValue: state.getIn(['submenu', 'inputValue']),
|
|
|
- }
|
|
|
- // return {
|
|
|
- // focused: state.getIn(['header', 'focused']),
|
|
|
- // list: state.getIn(['header', 'list']),
|
|
|
- // page: state.getIn(['header', 'page']),
|
|
|
- // totalPage: state.getIn(['header', 'totalPage']),
|
|
|
- // mouseIn: state.getIn(['header', 'mouseIn'])
|
|
|
- // }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-/**
|
|
|
- * 要改变store里的内容需要调用dispatch方法
|
|
|
- * @param {*} dispatch
|
|
|
- */
|
|
|
-const mapDispathToProps = (dispatch) => {
|
|
|
- return {
|
|
|
- handleInputFocus(list) {
|
|
|
-
|
|
|
- // const action = {
|
|
|
- // type: 'aearch_focus'
|
|
|
- // };
|
|
|
- //发送给store--提取出action--避免发送重复的ajax请求
|
|
|
- (list.size === 0) && dispatch(actionCreators.getList());
|
|
|
- // if(list.size>0){
|
|
|
- // dispatch(actionCreators.getList());
|
|
|
- // }
|
|
|
- dispatch(actionCreators.searchFocus());
|
|
|
- },
|
|
|
- handleInputChange(ivalueElem){
|
|
|
-
|
|
|
- dispatch(actionCreators.changeInputValue(ivalueElem.value));
|
|
|
- },
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-export default connect(mapStateToProps, mapDispathToProps)(Submenu);
|