正在显示
10 个修改的文件
包含
183 行增加
和
20 行删除
| ... | ... | @@ -105,8 +105,8 @@ class SysMenu extends React.Component { |
| 105 | 105 | }); |
| 106 | 106 | } |
| 107 | 107 | render() { |
| 108 | - const { uaa_perms, openKeys, selectedKeys } = this.props; | |
| 109 | - const menus = formatMenu(uaa_perms); | |
| 108 | + const { system_menu_perms, openKeys, selectedKeys } = this.props; | |
| 109 | + const menus = formatMenu(system_menu_perms); | |
| 110 | 110 | return ( |
| 111 | 111 | <Menu className={cx('system_wrap')} |
| 112 | 112 | onClick={this.handleClick} |
| ... | ... | @@ -146,14 +146,14 @@ class SysMenu extends React.Component { |
| 146 | 146 | const mapState = (state) => { |
| 147 | 147 | const { |
| 148 | 148 | router = {}, |
| 149 | - // system: { system_menu_selected_keys: { openKeys, selectedKeys } } | |
| 149 | + system: { system_menu_selected_keys: { openKeys = [], selectedKeys = [] }, system_menu_perms = [] } | |
| 150 | 150 | } = state; |
| 151 | 151 | return { |
| 152 | 152 | router, |
| 153 | 153 | uaa_tenant: {}, |
| 154 | - uaa_perms: [], | |
| 155 | - openKeys: [], | |
| 156 | - selectedKeys: [] | |
| 154 | + system_menu_perms, | |
| 155 | + openKeys, | |
| 156 | + selectedKeys | |
| 157 | 157 | }; |
| 158 | 158 | }; |
| 159 | 159 | export default connect(mapState)(SysMenu); |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -27,14 +27,6 @@ class Login extends React.Component { |
| 27 | 27 | api.postLogin(values).then(data => { |
| 28 | 28 | console.log(data); |
| 29 | 29 | }) |
| 30 | - console.log("#########:::::::", values); | |
| 31 | - // if (values.grant_type == 'password') { //密码登录 | |
| 32 | - // dispatch(login(values)); | |
| 33 | - // } else if (values.grant_type == 'smscode') {//验证码登录 | |
| 34 | - // dispatch(login(values)); | |
| 35 | - // } else if (values.grant_type == 'change_tenant') {//选择tenant | |
| 36 | - // dispatch(changeTenant(values)); | |
| 37 | - // } | |
| 38 | 30 | } |
| 39 | 31 | backLogin() { |
| 40 | 32 | const { dispatch } = this.props; | ... | ... |
| 1 | +import React from 'react'; | |
| 2 | +import Iframe from 'react-iframe' | |
| 3 | +import { connect } from 'react-redux'; | |
| 4 | +import { Layout } from 'antd'; | |
| 5 | +import cx from 'classnames'; | |
| 6 | + | |
| 7 | +class StatisticsContainer extends React.Component { | |
| 8 | + static propTypes = { | |
| 9 | + } | |
| 10 | + constructor(props) { | |
| 11 | + super(props); | |
| 12 | + } | |
| 13 | + componentDidMount() { | |
| 14 | + } | |
| 15 | + render() { | |
| 16 | + return ( | |
| 17 | + <div className={cx('statistics_wrap')} style={{ width: '100%', height: '100%', overflowY: 'hidden' }}> | |
| 18 | + <Iframe url="https://www.baidu.com" | |
| 19 | + width="100%" | |
| 20 | + height="100%" | |
| 21 | + id="myId" | |
| 22 | + className="myClassname" | |
| 23 | + display="initial" | |
| 24 | + frameBorder={0} | |
| 25 | + position="relative" /> | |
| 26 | + </div> | |
| 27 | + ); | |
| 28 | + } | |
| 29 | +} | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | +const mapState = (state) => { | |
| 34 | + const { router: { location = {} } } = state; | |
| 35 | + return { | |
| 36 | + location | |
| 37 | + }; | |
| 38 | +}; | |
| 39 | +export default connect(mapState)(StatisticsContainer); | ... | ... |
| ... | ... | @@ -6,4 +6,119 @@ |
| 6 | 6 | width: 100vw; |
| 7 | 7 | height: 100vh; |
| 8 | 8 | overflow: hidden; |
| 9 | +} | |
| 10 | +.layout-header-wrap{ | |
| 11 | + height: 52px; | |
| 12 | + line-height: 52px; | |
| 13 | +} | |
| 14 | +.layout-content-wrap{ | |
| 15 | + position:absolute; | |
| 16 | + left: 0; | |
| 17 | + right: 0; | |
| 18 | + bottom: 0; | |
| 19 | + top: 52px; | |
| 20 | + overflow: hidden; | |
| 21 | +} | |
| 22 | +.layout-sider-wrap{ | |
| 23 | + height: 100%; | |
| 24 | + position: relative; | |
| 25 | + overflow-y: hidden; | |
| 26 | + overflow-x: hidden; | |
| 27 | + background: #ffffff; | |
| 28 | +} | |
| 29 | +.layout-sider-wrap:hover{ | |
| 30 | + overflow-y: auto; | |
| 31 | +} | |
| 32 | +.app-routes-wrap{ | |
| 33 | + width: 100%; | |
| 34 | + height: 100%; | |
| 35 | + background-color: transparent; | |
| 36 | +} | |
| 37 | + | |
| 38 | + | |
| 39 | +//loading | |
| 40 | +.sk-folding-cube { | |
| 41 | + margin: 20px auto; | |
| 42 | + width: 40px; | |
| 43 | + height: 40px; | |
| 44 | + position: relative; | |
| 45 | + -webkit-transform: rotateZ(45deg); | |
| 46 | + transform: rotateZ(45deg); | |
| 47 | +} | |
| 48 | +.sk-folding-cube .sk-cube { | |
| 49 | + float: left; | |
| 50 | + width: 50%; | |
| 51 | + height: 50%; | |
| 52 | + position: relative; | |
| 53 | + -webkit-transform: scale(1.1); | |
| 54 | + -ms-transform: scale(1.1); | |
| 55 | + transform: scale(1.1); | |
| 56 | +} | |
| 57 | +.sk-folding-cube .sk-cube:before { | |
| 58 | + content: ''; | |
| 59 | + position: absolute; | |
| 60 | + top: 0; | |
| 61 | + left: 0; | |
| 62 | + width: 100%; | |
| 63 | + height: 100%; | |
| 64 | + background-color: #333; | |
| 65 | + -webkit-animation: sk-foldCubeAngle 2.4s infinite linear both; | |
| 66 | + animation: sk-foldCubeAngle 2.4s infinite linear both; | |
| 67 | + -webkit-transform-origin: 100% 100%; | |
| 68 | + -ms-transform-origin: 100% 100%; | |
| 69 | + transform-origin: 100% 100%; | |
| 70 | +} | |
| 71 | +.sk-folding-cube .sk-cube2 { | |
| 72 | + -webkit-transform: scale(1.1) rotateZ(90deg); | |
| 73 | + transform: scale(1.1) rotateZ(90deg); | |
| 74 | +} | |
| 75 | +.sk-folding-cube .sk-cube3 { | |
| 76 | + -webkit-transform: scale(1.1) rotateZ(180deg); | |
| 77 | + transform: scale(1.1) rotateZ(180deg); | |
| 78 | +} | |
| 79 | +.sk-folding-cube .sk-cube4 { | |
| 80 | + -webkit-transform: scale(1.1) rotateZ(270deg); | |
| 81 | + transform: scale(1.1) rotateZ(270deg); | |
| 82 | +} | |
| 83 | +.sk-folding-cube .sk-cube2:before { | |
| 84 | + -webkit-animation-delay: 0.3s; | |
| 85 | + animation-delay: 0.3s; | |
| 86 | +} | |
| 87 | +.sk-folding-cube .sk-cube3:before { | |
| 88 | + -webkit-animation-delay: 0.6s; | |
| 89 | + animation-delay: 0.6s; | |
| 90 | +} | |
| 91 | +.sk-folding-cube .sk-cube4:before { | |
| 92 | + -webkit-animation-delay: 0.9s; | |
| 93 | + animation-delay: 0.9s; | |
| 94 | +} | |
| 95 | +@-webkit-keyframes sk-foldCubeAngle { | |
| 96 | + 0%, 10% { | |
| 97 | + -webkit-transform: perspective(140px) rotateX(-180deg); | |
| 98 | + transform: perspective(140px) rotateX(-180deg); | |
| 99 | + opacity: 0; | |
| 100 | + } 25%, 75% { | |
| 101 | + -webkit-transform: perspective(140px) rotateX(0deg); | |
| 102 | + transform: perspective(140px) rotateX(0deg); | |
| 103 | + opacity: 1; | |
| 104 | + } 90%, 100% { | |
| 105 | + -webkit-transform: perspective(140px) rotateY(180deg); | |
| 106 | + transform: perspective(140px) rotateY(180deg); | |
| 107 | + opacity: 0; | |
| 108 | + } | |
| 109 | +} | |
| 110 | +@keyframes sk-foldCubeAngle { | |
| 111 | + 0%, 10% { | |
| 112 | + -webkit-transform: perspective(140px) rotateX(-180deg); | |
| 113 | + transform: perspective(140px) rotateX(-180deg); | |
| 114 | + opacity: 0; | |
| 115 | + } 25%, 75% { | |
| 116 | + -webkit-transform: perspective(140px) rotateX(0deg); | |
| 117 | + transform: perspective(140px) rotateX(0deg); | |
| 118 | + opacity: 1; | |
| 119 | + } 90%, 100% { | |
| 120 | + -webkit-transform: perspective(140px) rotateY(180deg); | |
| 121 | + transform: perspective(140px) rotateY(180deg); | |
| 122 | + opacity: 0; | |
| 123 | + } | |
| 9 | 124 | } |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -7,4 +7,5 @@ export const FETCH_X_REQUEST_ID = 'FETCH_X_REQUEST_ID'; |
| 7 | 7 | export const FETCH_FORM_NAME = 'FETCH_FORM_NAME'; |
| 8 | 8 | |
| 9 | 9 | /*系统操作 */ |
| 10 | -export const SYSTEM_MENU_SELECTED_KEYS = 'SYSTEM_MENU_SELECTED_KEYS'; | |
| \ No newline at end of file | ||
| 10 | +export const SYSTEM_MENU_SELECTED_KEYS = 'SYSTEM_MENU_SELECTED_KEYS';//选中菜单 | |
| 11 | +export const SYSTEM_MENU_PERMS = 'SYSTEM_MENU_PERMS';//系统菜单权限 | |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -32,9 +32,8 @@ function* handldRouter() { |
| 32 | 32 | const { payload = {} } = routerAction; |
| 33 | 33 | const { location = {} } = payload; |
| 34 | 34 | const { pathname = '' } = location; |
| 35 | - // const { uaa: { uaa_perms = [] } } = state; | |
| 36 | - // yield selectSysMenus(uaa_perms); | |
| 37 | - yield selectSysMenus([]); | |
| 35 | + const { system: { system_menu_perms = [] } } = state; | |
| 36 | + yield selectSysMenus(system_menu_perms); | |
| 38 | 37 | } |
| 39 | 38 | } |
| 40 | 39 | ... | ... |
| ... | ... | @@ -3,7 +3,18 @@ import * as types from '../actionTypes'; |
| 3 | 3 | import { typeToLowerCase, reducerFactory } from '../../utils/commonUtils'; |
| 4 | 4 | |
| 5 | 5 | const initialState = { |
| 6 | - [typeToLowerCase(types.SYSTEM_MENU_SELECTED_KEYS)]: { openKeys: [], selectedKeys: [] } | |
| 6 | + [typeToLowerCase(types.SYSTEM_MENU_SELECTED_KEYS)]: { openKeys: [], selectedKeys: [] }, | |
| 7 | + [typeToLowerCase(types.SYSTEM_MENU_PERMS)]: [{ | |
| 8 | + module: "home", | |
| 9 | + module_name: "首页", | |
| 10 | + parent_module: "", | |
| 11 | + parent_module_name: "" | |
| 12 | + }, { | |
| 13 | + module: "statistics", | |
| 14 | + module_name: "统计", | |
| 15 | + parent_module: "", | |
| 16 | + parent_module_name: "" | |
| 17 | + }] | |
| 7 | 18 | }; |
| 8 | 19 | |
| 9 | 20 | export default reduceReducers(initialState, reducerFactory); |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -6,12 +6,17 @@ import asyncComponent from '../AsyncComponent'; |
| 6 | 6 | const HomeContainer = asyncComponent( |
| 7 | 7 | () => import(/* webpackChunkName: "home" */'../../containers/home') |
| 8 | 8 | ); |
| 9 | +//统计 | |
| 10 | +const StatisticsContainer = asyncComponent( | |
| 11 | + () => import(/* webpackChunkName: "home" */'../../containers/home/StatisticsContainer') | |
| 12 | +); | |
| 9 | 13 | |
| 10 | 14 | const homeRoute = (match) => { |
| 11 | 15 | return ( |
| 12 | 16 | <Switch> |
| 13 | 17 | {/* 首页 */} |
| 14 | 18 | <Route exact={true} path={`${match.path}/home`} component={HomeContainer} /> |
| 19 | + <Route exact={true} path={`${match.path}/statistics`} component={StatisticsContainer} /> | |
| 15 | 20 | </Switch> |
| 16 | 21 | ); |
| 17 | 22 | }; | ... | ... |
| ... | ... | @@ -50,7 +50,7 @@ class LayoutRoute extends React.Component { |
| 50 | 50 | headcccc |
| 51 | 51 | <a href="/signOut">退出</a> |
| 52 | 52 | </Header> |
| 53 | - <Layout className={cx("layout-content-wrap")}> | |
| 53 | + <Layout className={cx("layout-content-wrap")} > | |
| 54 | 54 | <Sider className="layout-sider-wrap" collapsedWidth={0} collapsible={false} width={180}> |
| 55 | 55 | <div> |
| 56 | 56 | <SysMenu></SysMenu> | ... | ... |
请
注册
或
登录
后发表评论