diff --git a/config/routes/index.ts b/config/routes/index.ts index d9f85b0..0a1042a 100644 --- a/config/routes/index.ts +++ b/config/routes/index.ts @@ -1,7 +1,47 @@ const routes = [ - {path: '/', component: '@/pages/index'}, - {path: '/home', component: '@/pages/index'}, - // {path: '/aaa', component: '@/pages/Aaa/index', layout: false}, + { path: '/', redirect: '/teamViewer/paramsSetting', }, + + // ------------------------------GLQ远程维护---------------------------------- + // 建立远程链接 + { path: '/teamViewer/paramsSetting', name: '参数设置', component: '@/pages/GLQ/TeamViewer/ParamsSetting' }, + // 交互维护命令 + { path: '/teamViewer/systemTime', name: '系统时间', component: '@/pages/GLQ/TeamViewer/SystemTime' }, + { path: '/teamViewer/currentIP', name: '当前IP', component: '@/pages/GLQ/TeamViewer/CurrentIP' }, + { path: '/teamViewer/pingCommand', name: 'PING命令', component: '@/pages/GLQ/TeamViewer/PingCommand' }, + { path: '/teamViewer/telnetCommand', name: 'TELNET命令', component: '@/pages/GLQ/TeamViewer/TelnetCommand' }, + { path: '/teamViewer/otherCommand', name: '其他命令', component: '@/pages/GLQ/TeamViewer/OtherCommand' }, + // --------------------------------------------------------------------------- + + // ------------------------------网络MMJ管理---------------------------------- + { path: '/webMMJ/mmjInitInstall', name: 'MMJ初装', component: '@/pages/GLQ/WebMMJ/MmjInitInstall' }, + { path: '/webMMJ/statusQuery', name: '状态查询', component: '@/pages/GLQ/WebMMJ/StatusQuery' }, + { path: '/webMMJ/keyDestruction', name: '密钥销毁', component: '@/pages/GLQ/WebMMJ/KeyDestruction' }, + { path: '/webMMJ/keyRemoteKill', name: '密钥遥毙', component: '@/pages/GLQ/WebMMJ/KeyRemoteKill' }, + { path: '/webMMJ/mmjRemoteKill', name: 'MMJ遥毙', component: '@/pages/GLQ/WebMMJ/MmjRemoteKill' }, + // --------------------------------------------------------------------------- + + // ------------------------------网络GLQ配置---------------------------------- + // 获取配置信息 + // { path: '/webGLQ/systemTime', name: '服务列表信息', component: '@/pages/GLQ/webGLQ/SystemTime' }, + // { path: '/webGLQ/currentIP', name: '网络配置信息', component: '@/pages/GLQ/webGLQ/CurrentIP' }, + // { path: '/webGLQ/pingCommand', name: '安全策略信息', component: '@/pages/GLQ/webGLQ/PingCommand' }, + // { path: '/webGLQ/telnetCommand', name: '管理配置信息', component: '@/pages/GLQ/webGLQ/TelnetCommand' }, + // { path: '/webGLQ/otherCommand', name: 'VPN策略信息', component: '@/pages/GLQ/webGLQ/OtherCommand' }, + // { path: '/webGLQ/paramsSetting', name: '防火墙策略信息', component: '@/pages/GLQ/webGLQ/ParamsSetting' }, + // { path: '/webGLQ/paramsSetting', name: '日志记录信息', component: '@/pages/GLQ/webGLQ/ParamsSetting' }, + // 远程文件配置 + // { path: '/webMMJ/systemTime', name: '服务列表', component: '@/pages/GLQ/webMMJ/SystemTime' }, + // { path: '/webMMJ/currentIP', name: '网络参数', component: '@/pages/GLQ/webMMJ/CurrentIP' }, + // { path: '/webMMJ/pingCommand', name: '安全策略', component: '@/pages/GLQ/webMMJ/PingCommand' }, + // { path: '/webMMJ/telnetCommand', name: '管理配置', component: '@/pages/GLQ/webMMJ/TelnetCommand' }, + // { path: '/webMMJ/otherCommand', name: 'VPN策略', component: '@/pages/GLQ/webMMJ/OtherCommand' }, + // --------------------------------------------------------------------------- + + { + path: '*', + component: '@/pages/404', + layout: false + } ] export default routes; \ No newline at end of file diff --git a/src/components/LeftMenuOne/index.tsx b/src/components/LeftMenuOne/index.tsx index 74b72db..446fde5 100644 --- a/src/components/LeftMenuOne/index.tsx +++ b/src/components/LeftMenuOne/index.tsx @@ -1,5 +1,6 @@ import { FC, useEffect, useState } from 'react'; import styles from './index.less'; +import {history} from 'umi'; interface PageProps { data: Array<{ @@ -18,7 +19,10 @@ const LeftMenuCom: FC = ({ data }) => { useEffect(() => { data.forEach((item,index) => { - item.check = (index == 0 ? true : false); + // 默认展开第一个 + // item.check = (index == 0 ? true : false); + // 默认全部展开 + item.check = true; }) setList([...data]) }, []) @@ -41,7 +45,7 @@ const LeftMenuCom: FC = ({ data }) => { { item.data.map((item1: any, index1: number) => { return ( -
+
history.push(item1.url)}>
{item1.name}
diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index f59e54e..2dc236a 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -1,5 +1,5 @@ -import { Outlet } from 'umi'; +import { Outlet, history } from 'umi'; import styles from './index.less'; import { useEffect, useState } from 'react'; import { MenuType, tabsType } from '@/utils/menu'; @@ -104,6 +104,15 @@ export default function Layout() { onClick={() => { setActive(item.id) setActiveName(item.name) + + // 改变activeName时跳转菜单栏的第一个路由 + let info = MenuType[item.name]; + if (info[0].data) { + history.push(`${info[0].data[0].url}`) + }else { + history.push(`${info[0].url}`) + } + }}> {item.name}
diff --git a/src/pages/404.tsx b/src/pages/404.tsx new file mode 100644 index 0000000..6953af2 --- /dev/null +++ b/src/pages/404.tsx @@ -0,0 +1,18 @@ +import { history } from 'umi'; +import { Button, Result } from 'antd'; +import React from 'react'; + +const NoFoundPage: React.FC = () => ( + history.push('/')}> + Back Home + + } + /> +); + +export default NoFoundPage; diff --git a/src/pages/GLQ/TeamViewer/index.less b/src/pages/GLQ/TeamViewer/CurrentIP/index.less similarity index 100% rename from src/pages/GLQ/TeamViewer/index.less rename to src/pages/GLQ/TeamViewer/CurrentIP/index.less diff --git a/src/pages/GLQ/TeamViewer/CurrentIP/index.tsx b/src/pages/GLQ/TeamViewer/CurrentIP/index.tsx new file mode 100644 index 0000000..92c38b4 --- /dev/null +++ b/src/pages/GLQ/TeamViewer/CurrentIP/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> 当前IP +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> 当前IP'} +
+ ); +} diff --git a/src/pages/GLQ/WebGLQ/index.less b/src/pages/GLQ/TeamViewer/OtherCommand/index.less similarity index 100% rename from src/pages/GLQ/WebGLQ/index.less rename to src/pages/GLQ/TeamViewer/OtherCommand/index.less diff --git a/src/pages/GLQ/TeamViewer/OtherCommand/index.tsx b/src/pages/GLQ/TeamViewer/OtherCommand/index.tsx new file mode 100644 index 0000000..92c38b4 --- /dev/null +++ b/src/pages/GLQ/TeamViewer/OtherCommand/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> 当前IP +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> 当前IP'} +
+ ); +} diff --git a/src/pages/GLQ/WebMMJ/index.less b/src/pages/GLQ/TeamViewer/ParamsSetting/index.less similarity index 100% rename from src/pages/GLQ/WebMMJ/index.less rename to src/pages/GLQ/TeamViewer/ParamsSetting/index.less diff --git a/src/pages/GLQ/TeamViewer/ParamsSetting/index.tsx b/src/pages/GLQ/TeamViewer/ParamsSetting/index.tsx new file mode 100644 index 0000000..1bc8491 --- /dev/null +++ b/src/pages/GLQ/TeamViewer/ParamsSetting/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 建立远程链接--> 参数设置 +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 建立远程链接--> 参数设置'} +
+ ); +} diff --git a/src/pages/GLQ/TeamViewer/PingCommand/index.less b/src/pages/GLQ/TeamViewer/PingCommand/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/GLQ/TeamViewer/PingCommand/index.tsx b/src/pages/GLQ/TeamViewer/PingCommand/index.tsx new file mode 100644 index 0000000..d763a91 --- /dev/null +++ b/src/pages/GLQ/TeamViewer/PingCommand/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> PING命令 +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> PING命令'} +
+ ); +} diff --git a/src/pages/GLQ/TeamViewer/SystemTime/index.less b/src/pages/GLQ/TeamViewer/SystemTime/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/GLQ/TeamViewer/SystemTime/index.tsx b/src/pages/GLQ/TeamViewer/SystemTime/index.tsx new file mode 100644 index 0000000..161ec38 --- /dev/null +++ b/src/pages/GLQ/TeamViewer/SystemTime/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> 系统时间 +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> 系统时间'} +
+ ); +} diff --git a/src/pages/GLQ/TeamViewer/TelnetCommand/index.less b/src/pages/GLQ/TeamViewer/TelnetCommand/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/GLQ/TeamViewer/TelnetCommand/index.tsx b/src/pages/GLQ/TeamViewer/TelnetCommand/index.tsx new file mode 100644 index 0000000..b107b63 --- /dev/null +++ b/src/pages/GLQ/TeamViewer/TelnetCommand/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令-->TELNET命令 +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令-->TELNET命令'} +
+ ); +} diff --git a/src/pages/GLQ/TeamViewer/index.tsx b/src/pages/GLQ/TeamViewer/index.tsx deleted file mode 100644 index 1edb77d..0000000 --- a/src/pages/GLQ/TeamViewer/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import styles from './index.less'; - -// GLQ远程维护 -export default function Page() { - return ( -
- aaaa -
- ); -} diff --git a/src/pages/GLQ/WebGLQ/index.tsx b/src/pages/GLQ/WebGLQ/index.tsx deleted file mode 100644 index 70b34fc..0000000 --- a/src/pages/GLQ/WebGLQ/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import styles from './index.less'; - -// 网络GLQ配置 -export default function Page() { - return ( -
- aaaa -
- ); -} diff --git a/src/pages/GLQ/WebMMJ/KeyDestruction/index.less b/src/pages/GLQ/WebMMJ/KeyDestruction/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/GLQ/WebMMJ/KeyDestruction/index.tsx b/src/pages/GLQ/WebMMJ/KeyDestruction/index.tsx new file mode 100644 index 0000000..92c38b4 --- /dev/null +++ b/src/pages/GLQ/WebMMJ/KeyDestruction/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> 当前IP +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> 当前IP'} +
+ ); +} diff --git a/src/pages/GLQ/WebMMJ/KeyRemoteKill/index.less b/src/pages/GLQ/WebMMJ/KeyRemoteKill/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/GLQ/WebMMJ/KeyRemoteKill/index.tsx b/src/pages/GLQ/WebMMJ/KeyRemoteKill/index.tsx new file mode 100644 index 0000000..92c38b4 --- /dev/null +++ b/src/pages/GLQ/WebMMJ/KeyRemoteKill/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> 当前IP +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> 当前IP'} +
+ ); +} diff --git a/src/pages/GLQ/WebMMJ/MmjInitInstall/index.less b/src/pages/GLQ/WebMMJ/MmjInitInstall/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/GLQ/WebMMJ/MmjInitInstall/index.tsx b/src/pages/GLQ/WebMMJ/MmjInitInstall/index.tsx new file mode 100644 index 0000000..92c38b4 --- /dev/null +++ b/src/pages/GLQ/WebMMJ/MmjInitInstall/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> 当前IP +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> 当前IP'} +
+ ); +} diff --git a/src/pages/GLQ/WebMMJ/MmjRemoteKill/index.less b/src/pages/GLQ/WebMMJ/MmjRemoteKill/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/GLQ/WebMMJ/MmjRemoteKill/index.tsx b/src/pages/GLQ/WebMMJ/MmjRemoteKill/index.tsx new file mode 100644 index 0000000..92c38b4 --- /dev/null +++ b/src/pages/GLQ/WebMMJ/MmjRemoteKill/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> 当前IP +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> 当前IP'} +
+ ); +} diff --git a/src/pages/GLQ/WebMMJ/StatusQuery/index.less b/src/pages/GLQ/WebMMJ/StatusQuery/index.less new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/GLQ/WebMMJ/StatusQuery/index.tsx b/src/pages/GLQ/WebMMJ/StatusQuery/index.tsx new file mode 100644 index 0000000..92c38b4 --- /dev/null +++ b/src/pages/GLQ/WebMMJ/StatusQuery/index.tsx @@ -0,0 +1,10 @@ +import styles from './index.less'; + +// GLQ远程维护 --> 交互维护命令--> 当前IP +export default function Page() { + return ( +
+ {'GLQ远程维护 --> 交互维护命令--> 当前IP'} +
+ ); +} diff --git a/src/pages/GLQ/WebMMJ/index.tsx b/src/pages/GLQ/WebMMJ/index.tsx deleted file mode 100644 index e883768..0000000 --- a/src/pages/GLQ/WebMMJ/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import styles from './index.less'; - -// 网络MMJ管理 -export default function Page() { - return ( -
- aaaa -
- ); -} diff --git a/src/utils/menu.ts b/src/utils/menu.ts index 6332cf1..f62cd9c 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -35,25 +35,25 @@ export const MenuType: any = { { name: '建立远程连接', check: true, - data: [{ name: '参数设置', url: '', img: '' }] + data: [{ name: '参数设置', url: '/teamViewer/paramsSetting', img: '' }] }, { name: '交互维护命令', - check: false, + check: true, data: [ - { name: '系统时间', url: '', img: '' }, - { name: '当前IP', url: '', img: '' }, - { name: 'PING命令', url: '', img: '' }, - { name: 'TELNET命令', url: '', img: '' }, - { name: '其他命令', url: '', img: '' }, + { name: '系统时间', url: '/teamViewer/systemTime', img: '' }, + { name: '当前IP', url: '/teamViewer/currentIP', img: '' }, + { name: 'PING命令', url: '/teamViewer/pingCommand', img: '' }, + { name: 'TELNET命令', url: '/teamViewer/telnetCommand', img: '' }, + { name: '其他命令', url: '/teamViewer/otherCommand', img: '' }, ] }, ], '网络MMJ管理' : [ - { name: 'MMJ初装', url: '', img: '' }, - { name: '状态查询', url: '', img: '' }, - { name: '密钥销毁', url: '', img: '' }, - { name: '密钥遥毙', url: '', img: '' }, - { name: 'MMJ遥毙', url: '', img: '' }, + { name: 'MMJ初装', url: '/webMMJ/mmjInitInstall', img: '' }, + { name: '状态查询', url: '/webMMJ/statusQuery', img: '' }, + { name: '密钥销毁', url: '/webMMJ/keyDestruction', img: '' }, + { name: '密钥遥毙', url: '/webMMJ/keyRemoteKill', img: '' }, + { name: 'MMJ遥毙', url: '/webMMJ/mmjRemoteKill', img: '' }, ], '网络GLQ配置' : [ { @@ -70,7 +70,7 @@ export const MenuType: any = { ] }, { name: '远程文件配置', - check: false, + check: true, data: [ { name: '服务列表', url: '', img: '' }, { name: '网络参数', url: '', img: '' },