From 0e612bbc6689783d4c3ffb7e8544edecd7257a1a Mon Sep 17 00:00:00 2001 From: wuqun Date: Tue, 13 Dec 2022 09:22:55 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E7=BD=91=E5=85=B3=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/auth/containers/login.jsx | 6 +-- .../edition/containers/administer.jsx | 8 ++-- .../sections/edition/containers/gateway.jsx | 37 +++++++++++++++++++ .../src/sections/edition/containers/index.js | 5 ++- .../client/src/sections/edition/nav-item.jsx | 10 +++-- .../web/client/src/sections/edition/routes.js | 19 +++++++--- 6 files changed, 68 insertions(+), 17 deletions(-) create mode 100644 code/web/client/src/sections/edition/containers/gateway.jsx diff --git a/code/web/client/src/sections/auth/containers/login.jsx b/code/web/client/src/sections/auth/containers/login.jsx index 54c6f49..496b80e 100644 --- a/code/web/client/src/sections/auth/containers/login.jsx +++ b/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([])) } @@ -52,7 +52,7 @@ const Login = props => { onSubmit={values => { dispatch(login(values.username, values.password)).then(res => { const data = res.payload.user - // dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token })) + // dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token })) }) }} getFormApi={formApi => form.current = formApi} @@ -83,7 +83,7 @@ const Login = props => { ); } -function mapStateToProps (state) { +function mapStateToProps(state) { const { auth, global } = state; return { user: auth.user, diff --git a/code/web/client/src/sections/edition/containers/administer.jsx b/code/web/client/src/sections/edition/containers/administer.jsx index 530fe4b..d4e05e7 100644 --- a/code/web/client/src/sections/edition/containers/administer.jsx +++ b/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 (
- 5204620542045204 + 版本管理
); } -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); \ No newline at end of file +export default connect(mapStateToProps)(EditionManage); \ No newline at end of file diff --git a/code/web/client/src/sections/edition/containers/gateway.jsx b/code/web/client/src/sections/edition/containers/gateway.jsx new file mode 100644 index 0000000..fc27e03 --- /dev/null +++ b/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 ( +
+ 网关设备列表 +
+ ); +} + +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); \ No newline at end of file diff --git a/code/web/client/src/sections/edition/containers/index.js b/code/web/client/src/sections/edition/containers/index.js index 0f19b94..5d09c50 100644 --- a/code/web/client/src/sections/edition/containers/index.js +++ b/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 }; \ No newline at end of file +export { EditionManage, GatewayManage }; \ No newline at end of file diff --git a/code/web/client/src/sections/edition/nav-item.jsx b/code/web/client/src/sections/edition/nav-item.jsx index 8e0ab21..bae527d 100644 --- a/code/web/client/src/sections/edition/nav-item.jsx +++ b/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: , to: '/edition', + itemKey: 'edgeGateway', text: '网关管理', to: '/edgeGateway/gateway', icon: , + items: [ + { itemKey: 'gateway', to: '/edgeGateway/gateway', text: '设备列表' }, + { itemKey: 'edition', to: '/edgeGateway/edition', text: '版本管理' } + ], }, ] ); diff --git a/code/web/client/src/sections/edition/routes.js b/code/web/client/src/sections/edition/routes.js index 73f8f7c..d4004f2 100644 --- a/code/web/client/src/sections/edition/routes.js +++ b/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: 'edition', - path: "/edition", - breadcrumb: '版本管理', - component: Administer, + key: 'edgeGateway', + path: "/edgeGateway", + childRoutes: [{ + path: '/edition', + key: 'edition', + breadcrumb: '版本管理', + component: EditionManage + }, { + path: '/gateway', + key: 'gateway', + breadcrumb: '网关管理', + component: GatewayManage + }] } } ]; \ No newline at end of file