master_055
张瑞宁 10 months ago
parent 311558a3a7
commit acd364f299

@ -1,6 +1,13 @@
const routes = [
{ path: '/', redirect: '/index', }, // 本地跑时为了方便先使用这个
// { path: '/', redirect: '/404', }, // 后续上线时开放
// 节点初始化工具
{ path: '/nodeInit', name: '节点初始化工具', component: '@/pages/NodeInitTool', layout: false },
// ------------------------------设备管理----------------------------------
{ path: '/machineManage/register', name: '设备注册', component: '@/pages/MachineManage/MachineRegister' },
// ---------------------------------------------------------------------------
// 桌面
{ path: '/index', name: '桌面', component: '@/pages/index', layout: false },

@ -0,0 +1,54 @@
.cont_warp {
border: 1px solid #000;
.header {
height: 40px;
line-height: 40px;
font-size: 16px;
font-weight: 600;
text-align: center;
border-bottom: 1px solid #000;
}
.main_body {
display: flex;
align-items: center;
justify-content: flex-start;
border-bottom: 1px solid #000;
height: 500px;
.body_left {
width: 200px;
height: 100%;
line-height:500px;
border-right: 1px solid #000;
}
.body_right {
display:flex;
flex-direction: column;
justify-content: flex-start;
height:100%;
.stepTitle{
margin-top:30px;
}
.stepDesc{
margin-top:30px;
}
}
}
.footer {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 10px;
.btns {
display: flex;
align-items: center;
justify-content: space-between;
}
}
}

@ -0,0 +1,64 @@
import { FC, useEffect, useState } from 'react';
import styles from './index.less';
import ButtonComp from '@/components/ButtonComp';
interface PageProps {
headTitle: string; //顶部标题
stepTitle: string; //步骤标题
stepDesc: string; //步骤描述
leftStep: string; //左侧步骤描述
nextbtn?:boolean; //下一步按钮是否显示
prebtn?:boolean; //上一步按钮是否显示
finishbtn?:boolean; //完成按钮是否显示
cancelbtn?:boolean; //取消按钮是否显示
children?: any; // 插槽内容
onNext?: () => void;
onPre?: () => void;
onFinish?: () => void;
onCancel?: () => void;
}
const NodeInitWrap: FC<PageProps> = ({
headTitle,
stepTitle,
stepDesc,
leftStep,
nextbtn=false,
prebtn=false,
finishbtn=false,
cancelbtn=false,
onNext = () => {},
onPre = () => {},
onFinish = () => {},
onCancel = () => {},
...props
}) => {
return (
<div className={styles.cont_warp}>
{/* 标题 */}
<div className={styles.header}>{headTitle}</div>
{/* 中间左右结构的主体 */}
<div className={styles.main_body}>
<div className={styles.body_left}>{leftStep}</div>
<div className={styles.body_right}>
<div className={styles.stepTitle}>{stepTitle}</div>
<div className={styles.stepDesc}>{stepDesc}</div>
<div>{props?.children}</div>
</div>
</div>
{/* 底部 */}
<div className={styles.footer}>
<div>xxx</div>
<div className={styles.btns}>
{nextbtn && <ButtonComp text='上一步' style={{marginRight:'10px'}} onClick={onNext}/>}
{prebtn && <ButtonComp text='下一步' style={{marginRight:'10px'}} onClick={onPre} />}
{finishbtn && <ButtonComp text='完成' style={{marginRight:'10px'}} onClick={onFinish} />}
{cancelbtn && <ButtonComp text='取消' onClick={onCancel} />}
</div>
</div>
</div>
)
}
export default NodeInitWrap

@ -19,19 +19,19 @@ moment.locale('ZH-cn')
const options2 = [
{ value: 1, label: 'GLQ管理' },
{ value: 1, label: '设备管理' },
{ value: 2, label: 'MY管理' },
{ value: 3, label: 'SB管理' },
{ value: 4, label: 'SF管理' },
{ value: 5, label: 'SBJK二维版', disabled: true },
{ value: 6, label: '设备注册' }
{ value: 6, label: '日志管理' }
]
const leftMenuType: any = {
// GLQ管理
'GLQ远程维护': <LeftMenuOne key={1} data={MenuType['GLQ远程维护']} />,
'网络MMJ管理': <LeftMenuTwo key={2} data={MenuType['网络MMJ管理']} />,
'网络GLQ配置': <LeftMenuOne key={3} data={MenuType['网络GLQ配置']} />,
// 设备管理
'设备注册': <LeftMenuOne key={1} data={MenuType['设备注册']} />,
'在线管理': <LeftMenuTwo key={2} data={MenuType['在线管理']} />,
'离线管理': <LeftMenuOne key={3} data={MenuType['离线管理']} />,
// MY管理
'密钥体管理': <LeftMenuOne key={4} data={MenuType['密钥体管理']} />,
'密钥管理': <LeftMenuOne key={5} data={MenuType['密钥管理']} />,
@ -57,9 +57,9 @@ export default function Layout() {
const location = useLocation();
const [routeName, setRouteName] = useState<string>('');
const [selectVal, setSelectVal] = useState<number>(1);
const [tabList, setTabList] = useState<any>([]);
const [active, setActive] = useState<number>(1);
const [selectVal, setSelectVal] = useState<number>(1); //当前选中的是哪个一级菜单
const [tabList, setTabList] = useState<any>([]); //一级菜单包含的二级菜单列表
const [active, setActive] = useState<number>(1); //当前选中的是哪个二级菜单
const [activeName, setActiveName] = useState<any>('GLQ远程维护');
const [treeData, setTreeData] = useState<any>([
{
@ -144,7 +144,7 @@ export default function Layout() {
// 校验是否是树结构列表
const isTreeType = (info: any) => {
if (info.length > 0) {
if (info[0]?.name === '设备注册') {
if (info[0]?.name === '设备xx') {
return navigateToPath(info, '/registerManage/deviceRegister/{key}');
}
if (info[0]?.name === '单位位置管理') {

@ -0,0 +1,6 @@
.nav{
display:flex;
align-items: center;
margin-left:20px;
margin-top:10px;
}

@ -0,0 +1,43 @@
import { FC, useEffect, useState } from 'react';
import { history, useLocation, useParams } from 'umi';
import ButtonComp from '@/components/ButtonComp';
import ClearInfoDialog from '@/components/ClearInfoDialog';
import { getPlugCordResult } from '@/services/api';
import { validateNumber } from '@/utils/validate';
import theme from '@/styles/antd.theme';
import { Select,Form } from 'antd';
import styles from './index.less';
interface PageProps {
data: Array<{
// 菜单名称
name: string;
// 是否展开
check: boolean;
// 内容是否有目录结构
isTree?: boolean;
// 菜单列表 name: 名称; url: 路由; img: 图标;
data: Array<{ name: string; url: string; img: any; }>
}>;
}
const MachineRegister: FC<PageProps> = ({ }) => {
return (
<section>
<div className={styles.nav}>
<ButtonComp type={'special'} text={'密钥管理'} onClick={() => { }} style={{marginRight:'20px'}} />
<ButtonComp type={'special'} text={'邮箱管理'} onClick={() => { }} />
</div>
<div>
<Form>
</Form>
</div>
</section>
)
}
export default MachineRegister

@ -0,0 +1,35 @@
import { FC, useEffect, useState } from 'react';
import { history, useLocation, useParams } from 'umi';
import ButtonComp from '@/components/ButtonComp';
import ClearInfoDialog from '@/components/ClearInfoDialog';
import { getPlugCordResult } from '@/services/api';
import { validateNumber } from '@/utils/validate';
import theme from '@/styles/antd.theme';
import { Button, ConfigProvider, Form, Input, Modal, Radio, message } from 'antd';
// import styles from './index.less';
interface PageProps {
data: Array<{
// 菜单名称
name: string;
// 是否展开
check: boolean;
// 内容是否有目录结构
isTree?: boolean;
// 菜单列表 name: 名称; url: 路由; img: 图标;
data: Array<{ name: string; url: string; img: any; }>
}>;
}
const PageName: FC<PageProps> = ({ }) => {
return (
<section>
</section>
)
}
export default PageName

@ -0,0 +1,36 @@
import { FC, useEffect, useState } from 'react';
import { history, useLocation, useParams } from 'umi';
import ButtonComp from '@/components/ButtonComp';
import ClearInfoDialog from '@/components/ClearInfoDialog';
import NodeInitWrap from '@/components/NodeInitWrap';
import { getPlugCordResult } from '@/services/api';
import { validateNumber } from '@/utils/validate';
import theme from '@/styles/antd.theme';
import { Button, ConfigProvider, Form, Input, Modal, Radio, message } from 'antd';
import styles from './index.less';
interface PageProps {
}
const NodeInitTool: FC<PageProps> = ({ }) => {
return (
<section style={{width:'1200px',margin:'20px auto'}}>
<NodeInitWrap
headTitle='各级节点初始化工具'
stepTitle='第1步'
stepDesc='第一步描述'
leftStep='步骤1of4初始化'
nextbtn={true}
cancelbtn={true}
>
</NodeInitWrap>
</section>
)
}
export default NodeInitTool

@ -45,28 +45,23 @@ export default function IndexPage() {
const onFinish = async (data: any) => {
setLoading(true)
await getPlugCordResult(data).then(res => {
// if (res?.result == 'success' && JSON.parse(res?.data[0]).data) {
// setIsAuth(true)
// localStorage.setItem('is_auth', JSON.stringify(true));
// message.success("系统连接检测成功!")
// } else if (!JSON.parse(res?.data[0]).data) {
// message.error("系统连接检测失败!")
// }
if (res?.result == 'success') {
setIsAuth(true)
localStorage.setItem('is_auth', JSON.stringify(true));
message.success("系统连接检测成功!")
} else if (!JSON.parse(res?.data[0]).data) {
message.error("系统连接检测失败!")
}
})
setIsAuth(true)
// await getPlugCordResult(data).then(res => {
// if (res?.result == 'success') {
// setIsAuth(true)
// localStorage.setItem('is_auth', JSON.stringify(true));
// message.success("系统连接检测成功!")
// } else if (!JSON.parse(res?.data[0]).data) {
// message.error("系统连接检测失败!")
// }
// })
setLoading(false)
};
return (
<ConfigProvider theme={theme}>
<div className={styles.index_con}>
<ButtonComp type='special' text='管理员身份认证' onClick={()=>{setVisibility(true)}} />
{
isAuth ?
list.map((item, index) => {
@ -84,36 +79,19 @@ export default function IndexPage() {
<div>{item.name}</div>
</div>
)
}) :
<Modal
title={'系统连接检测'}
open={visibility}
centered
width={500}
closeIcon={false}
footer={null}
maskClosable={false}
}) : <ClearInfoDialog title={'管理员身份认证'} visibility={visibility}
onCancel={()=>{setVisibility(false)}}
onOk={()=>{form.submit()}}
>
<Form form={form} layout={'inline'} onFinish={onFinish}>
<Form.Item name="sysType" label="系统类型" style={{ marginBottom: 15 }} rules={[
{ required: true, message: '请选择系统类型' }
]}>
<Radio.Group style={{}}>
<Radio value={49} style={{ margin: "0 20px 0 5px" }}> 49 </Radio>
<Radio value={52}> 52 </Radio>
</Radio.Group>
</Form.Item>
<Form.Item name="workbenchNumber" label="工作台编号" rules={[
{ required: true, message: '请输入工作台编号' },
<Form.Item name="password" label="口令" rules={[
{ required: true, message: '请输入口令' },
{ validator: validateNumber }
]}>
<Input style={{ width: 260, marginLeft: 5 }} placeholder="请输入工作台编号" />
<Input style={{ width: 260, marginLeft: 5 }} placeholder="请输入口令" />
</Form.Item>
</Form>
<div className='flex_jE mt20'>
<ButtonComp text={'连接检测'} loading={loading} onClick={() => form.submit()} />
</div>
</Modal>
</ClearInfoDialog>
}
</div>
</ConfigProvider>

@ -1,8 +1,10 @@
export const tabsType: any = {
1: [
{ id: 1, name: 'GLQ远程维护', },
{ id: 2, name: '网络MMJ管理' },
{ id: 3, name: '网络GLQ配置' }
{ id: 1, name: '设备注册', },
{ id: 2, name: '在线管理' },
{ id: 3, name: '离线管理' },
{ id: 4, name: '黑名单' },
{ id: 5, name: '报表管理' },
],
2: [
{ id: 1, name: '密钥体管理' },
@ -31,31 +33,34 @@ export const tabsType: any = {
}
export const MenuType: any = {
'GLQ远程维护': [
'设备注册': [
{
name: '建立远程连接',
check: true,
data: [{ name: '参数设置', url: '/teamViewer/paramsSetting', img: '' }]
}, {
name: '交互维护命令',
name: '设备注册',
check: true,
data: [
{ 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管理': [
isTree:true,
url:'/machineManage/register',
// data: [{ name: '参数设置', url: '/teamViewer/paramsSetting', img: '' }]
},
// {
// name: '交互维护命令',
// check: true,
// data: [
// { 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: '' },
// ]
// },
],
'在线管理': [
{ 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配置': [
'离线管理': [
{
name: '获取配置信息',
check: true,

Loading…
Cancel
Save