Browse Source

(*)网关管理菜单

master
wuqun 2 years ago
parent
commit
0e612bbc66
  1. 4
      code/web/client/src/sections/auth/containers/login.jsx
  2. 8
      code/web/client/src/sections/edition/containers/administer.jsx
  3. 37
      code/web/client/src/sections/edition/containers/gateway.jsx
  4. 5
      code/web/client/src/sections/edition/containers/index.js
  5. 10
      code/web/client/src/sections/edition/nav-item.jsx
  6. 15
      code/web/client/src/sections/edition/routes.js

4
code/web/client/src/sections/auth/containers/login.jsx

@ -20,7 +20,7 @@ const Login = props => {
useEffect(() => {
if (user && user.authorized) {
dispatch(push('/edition'));
dispatch(push('/edgeGateway/gateway'));
// localStorage.setItem('fs_iot_auth_selected_sider', JSON.stringify([]))
// localStorage.setItem('fs_iot_auth_open_sider', JSON.stringify([]))
}
@ -83,7 +83,7 @@ const Login = props => {
);
}
function mapStateToProps (state) {
function mapStateToProps(state) {
const { auth, global } = state;
return {
user: auth.user,

8
code/web/client/src/sections/edition/containers/administer.jsx

@ -5,7 +5,7 @@ import { push } from 'react-router-redux';
import { Form, Button, Toast } from '@douyinfe/semi-ui';
import { IconLock, IconUser } from '@douyinfe/semi-icons';
const Administer = props => {
const EditionManage = props => {
const { dispatch, user, error, actions, apiRoot, isRequesting } = props
@ -18,12 +18,12 @@ const Administer = props => {
return (
<div style={{}}>
5204620542045204
版本管理
</div>
);
}
function mapStateToProps (state) {
function mapStateToProps(state) {
const { auth, global } = state;
return {
user: auth.user,
@ -34,4 +34,4 @@ function mapStateToProps (state) {
}
}
export default connect(mapStateToProps)(Administer);
export default connect(mapStateToProps)(EditionManage);

37
code/web/client/src/sections/edition/containers/gateway.jsx

@ -0,0 +1,37 @@
'use strict';
import React, { useEffect, useRef } from 'react';
import { connect } from 'react-redux';
import { push } from 'react-router-redux';
import { Form, Button, Toast, Table } from '@douyinfe/semi-ui';
import { IconLock, IconUser } from '@douyinfe/semi-icons';
const GatewayManage = props => {
const { dispatch, user, error, actions, apiRoot, isRequesting } = props
useEffect(() => {
}, [])
return (
<div style={{}}>
网关设备列表
</div>
);
}
function mapStateToProps(state) {
const { auth, global } = state;
return {
user: auth.user,
error: auth.error,
actions: global.actions,
apiRoot: global.apiRoot,
isRequesting: auth.isRequesting
}
}
export default connect(mapStateToProps)(GatewayManage);

5
code/web/client/src/sections/edition/containers/index.js

@ -1,4 +1,5 @@
'use strict';
import Administer from './administer.jsx';
import EditionManage from './administer';
import GatewayManage from './gateway';
export { Administer };
export { EditionManage, GatewayManage };

10
code/web/client/src/sections/edition/nav-item.jsx

@ -1,11 +1,15 @@
import React from 'react';
import { IconCode } from '@douyinfe/semi-icons';
import { IconCheckList } from '@douyinfe/semi-icons';
export function getNavItem (user, dispatch) {
export function getNavItem(user, dispatch) {
return (
[
{
itemKey: 'edition', text: '版本管理', icon: <IconCode />, to: '/edition',
itemKey: 'edgeGateway', text: '网关管理', to: '/edgeGateway/gateway', icon: <IconCheckList />,
items: [
{ itemKey: 'gateway', to: '/edgeGateway/gateway', text: '设备列表' },
{ itemKey: 'edition', to: '/edgeGateway/edition', text: '版本管理' }
],
},
]
);

15
code/web/client/src/sections/edition/routes.js

@ -1,15 +1,24 @@
'use strict';
import { Administer } from './containers';
import { EditionManage, GatewayManage } from './containers';
export default [
{
type: 'inner',
route: {
key: 'edgeGateway',
path: "/edgeGateway",
childRoutes: [{
path: '/edition',
key: 'edition',
path: "/edition",
breadcrumb: '版本管理',
component: Administer,
component: EditionManage
}, {
path: '/gateway',
key: 'gateway',
breadcrumb: '网关管理',
component: GatewayManage
}]
}
}
];
Loading…
Cancel
Save