master_basic
鲁誉程 1 year ago
parent b5e0d3082e
commit 4dab3a2d4b

@ -0,0 +1,40 @@
import { FC } from 'react';
import { Modal } from 'antd';
import ButtonComp from '../ButtonComp';
interface PageProps {
title?: string;
visibility: boolean;
onCancel: () => void;
onOk: () => void;
children?: any; // 插槽内容
}
const ClearInfoDialog: FC<PageProps> = ({
title = "提示框",
visibility = false,
onCancel,
onOk,
...props
}) => {
return (
<Modal
title={title}
open={visibility}
centered
width={420}
onCancel={onCancel}
footer={null}
maskClosable={false}
>
{props?.children}
<div className='flex_jE mt20'>
<ButtonComp style={{ marginRight: 20 }} text={'确定'} onClick={onOk} />
<ButtonComp type="cancel" text={'取消'} onClick={onCancel} />
</div>
</Modal>
)
}
export default ClearInfoDialog

@ -136,10 +136,9 @@
} }
.right_warp { .right_warp {
height: calc(100vh - 114px); height: calc(100% - 114px);
min-height: 600px; min-height: calc(100vh - 114px);
width: calc(100% - 261px)
width: calc(100vw - 261px)
} }
.right_route { .right_route {

@ -54,11 +54,13 @@ const leftMenuType: any = {
} }
export default function Layout() { export default function Layout() {
const location = useLocation();
const [routeName, setRouteName] = useState<string>('');
const [selectVal, setSelectVal] = useState<number>(1); const [selectVal, setSelectVal] = useState<number>(1);
const [tabList, setTabList] = useState<any>([]); const [tabList, setTabList] = useState<any>([]);
const [active, setActive] = useState<number>(1); const [active, setActive] = useState<number>(1);
const [activeName, setActiveName] = useState<any>('GLQ远程维护'); const [activeName, setActiveName] = useState<any>('GLQ远程维护');
const [treeData, setTreeData] = useState<any>([ const [treeData, setTreeData] = useState<any>([
{ {
title: 'Parent 1', title: 'Parent 1',
@ -110,6 +112,10 @@ export default function Layout() {
} }
}, []) }, [])
useEffect(() => {
setRouteName(getCurrentPageName(location.pathname))
}, [location]);
// 页面销毁前记录下当前布局信息 // 页面销毁前记录下当前布局信息
window.addEventListener('beforeunload', function (event) { window.addEventListener('beforeunload', function (event) {
let layoutInfo: any = { let layoutInfo: any = {
@ -125,7 +131,7 @@ export default function Layout() {
if (tabList.length > 0 && !layoutInfo) { if (tabList.length > 0 && !layoutInfo) {
setActiveName(tabList[0].name) setActiveName(tabList[0].name)
let info = MenuType[tabList[0].name]; let info = MenuType[tabList[0].name];
if(isTreeType(info)) return if (isTreeType(info)) return
if (info[0].data) { if (info[0].data) {
history.push(`${info[0].data[0].url}`) history.push(`${info[0].data[0].url}`)
@ -138,7 +144,7 @@ export default function Layout() {
// 校验是否是树结构列表 // 校验是否是树结构列表
const isTreeType = (info: any) => { const isTreeType = (info: any) => {
if (info[0].name == '设备注册') { if (info[0].name == '设备注册') {
for(let i=0; i<treeData.length; i++) { for (let i = 0; i < treeData.length; i++) {
if (treeData[i].children.length > 0) { if (treeData[i].children.length > 0) {
history.push(`/registerManage/deviceRegister/${treeData[i].children[0].key}`) history.push(`/registerManage/deviceRegister/${treeData[i].children[0].key}`)
break; break;
@ -148,6 +154,13 @@ export default function Layout() {
} }
} }
// 获取路由名称
const getCurrentPageName = (pathname: string) => {
const routes = require('../../config/routes/index').default;
const currentRoute = routes.find((route: any) => route.path === pathname);
return currentRoute?.name || '未知页面';
};
return ( return (
<ConfigProvider <ConfigProvider
locale={zhCN} locale={zhCN}
@ -204,7 +217,7 @@ export default function Layout() {
setActive(item.id) setActive(item.id)
setActiveName(item.name) setActiveName(item.name)
if(isTreeType(info)) return if (isTreeType(info)) return
if (info.length == 0 || info[0].data && info[0].data.length == 0) { if (info.length == 0 || info[0].data && info[0].data.length == 0) {
history.push('/construction'); history.push('/construction');
@ -253,7 +266,7 @@ export default function Layout() {
<div className={styles.footer}> <div className={styles.footer}>
<div>0.0.0</div> <div>0.0.0</div>
<div>admin</div> <div>admin</div>
<div></div> <div style={{minWidth: 180, textAlign: 'right'}}>{routeName}</div>
</div> </div>
</div> </div>
</div> </div>

@ -1,7 +1,7 @@
import { FC, useEffect, useState } from 'react'; import { FC, useEffect, useState } from 'react';
import { history, useLocation } from "umi"; import { history, useLocation } from "umi";
import styles from './index.less'; import styles from './index.less';
import { Input, Modal } from 'antd'; import { Input, Modal, message } from 'antd';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
interface PageProps { } interface PageProps { }
@ -34,13 +34,15 @@ const CoreSystemEntrance: FC<PageProps> = ({ }) => {
} }
const submit = () => { const submit = () => {
if (key == '一') { if (key == '一' && pin == '123123') {
setKey('二'); setKey('二');
setPin('') setPin('')
} else { } else if (key == '二' && pin == '123123') {
initData() initData()
// 登录成功进入系统 // 登录成功进入系统
history.push('/teamViewer/paramsSetting') history.push('/teamViewer/paramsSetting')
}else {
message.error('PIN码错误请重新输入')
} }
} }
@ -56,7 +58,7 @@ const CoreSystemEntrance: FC<PageProps> = ({ }) => {
{/* 登录弹窗 */} {/* 登录弹窗 */}
<Modal <Modal
title="用户登录" title="用户登录pin码123123"
open={visibility} open={visibility}
centered centered
width={550} width={550}

@ -1,7 +1,8 @@
import ContentWarp from '@/components/ContentWarp'; import ContentWarp from '@/components/ContentWarp';
import styles from '../../index.less'; import styles from '../../index.less';
import { Form, Input } from 'antd'; import { Form, Input, message } from 'antd';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { setParameter } from '@/services/gql';
export default function Page() { export default function Page() {
const [form] = Form.useForm(); const [form] = Form.useForm();
@ -15,7 +16,15 @@ export default function Page() {
}; };
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log('表单提交:', values); setParameter({
ipAddress: values.ipAddress
}).then((res) => {
if (res.result == 'success') {
message.success('连接成功')
}else {
message.success(res.errorMsg)
}
})
}; };
return ( return (
@ -37,7 +46,7 @@ export default function Page() {
</Form.Item> </Form.Item>
</Form> </Form>
<div className={styles.btn_warp}> <div className={styles.btn_warp}>
<ButtonComp style={{marginRight: 20}} text={'建立连接'} onClick={() => form.submit()} /> <ButtonComp style={{ marginRight: 20 }} text={'建立连接'} onClick={() => form.submit()} />
<ButtonComp type={'cancel'} text={'参数重置'} onClick={() => form.resetFields()} /> <ButtonComp type={'cancel'} text={'参数重置'} onClick={() => form.resetFields()} />
</div> </div>
</div> </div>

@ -1,11 +1,51 @@
import ContentWarp from '@/components/ContentWarp'; import ContentWarp from '@/components/ContentWarp';
import styles from '../../index.less'; import styles from '../../index.less';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { secretInit_sendCommand } from '@/services/gql';
import ClearInfoDialog from '@/components/ClearInfoDialog';
// 网络MMJ管理 --> 密钥销毁 // 网络MMJ管理 --> 密钥销毁
export default function Page() { export default function Page() {
const [htmlText, setHtmlText] = useState('<div>文本内容</div>') const [lines, setLines] = useState<any>([]);
const [currentLineIndex, setCurrentLineIndex] = useState(0);
const [visibility, setVisibility] = useState<boolean>(false);
const outputRef: any = useRef(null);
useEffect(() => {
const timer = setInterval(() => {
if (currentLineIndex < lines.length) {
setCurrentLineIndex((prevIndex) => prevIndex + 1);
} else {
clearInterval(timer);
}
}, 300);
if (outputRef.current.scrollHeight > 330) {
outputRef.current.scrollTop = outputRef.current.scrollHeight;
}
return () => {
clearInterval(timer); // 组件卸载时清除定时器
};
}, [currentLineIndex, lines.length]);
const sending = () => {
secretInit_sendCommand({type: 1}).then((res) => {
if (res?.result == "success") {
setLines([
...lines,
'发送命令成功',
`执行密码销毁`,
`正在密码销毁中...`,
`密码销毁完成`
])
} else {
setLines([`${res?.errorMsg}`])
}
})
}
return ( return (
<div className={styles.params_warp}> <div className={styles.params_warp}>
@ -13,15 +53,31 @@ export default function Page() {
<div className='pd20'></div> <div className='pd20'></div>
<div className='line'></div> <div className='line'></div>
<div className='pd20 pb100'> <div className='pd20 pb100'>
<div className={styles.html_con}> <div ref={outputRef} className={styles.html_con}>
<div style={{ padding: '20px 12px' }} dangerouslySetInnerHTML={{ __html: htmlText }}></div> <div style={{ padding: '0px 12px' }}>
{lines.slice(0, currentLineIndex).map((line: string, index: number) => (
<p key={line} style={{ paddingTop: index == 0 ? 20 : 10 }}>{line}</p>
))}
</div>
</div> </div>
<div className={styles.btn_warp}> <div className={styles.btn_warp}>
<ButtonComp style={{ marginRight: 20 }} text={'发送命令'} onClick={() => { }} /> <ButtonComp style={{ marginRight: 20 }} text={'发送命令'} onClick={() => sending()} />
<ButtonComp type={'cancel'} text={'清空信息'} onClick={() => setHtmlText('')} /> <ButtonComp type={'cancel'} text={'清空信息'} onClick={() => setVisibility(true)} />
</div> </div>
</div> </div>
</ContentWarp> </ContentWarp>
<ClearInfoDialog
visibility={visibility}
onCancel={() => setVisibility(false)}
onOk={() => {
if (lines.length == 0) return;
setLines([]);
setCurrentLineIndex(0);
setVisibility(false);
}}>
<div></div>
</ClearInfoDialog>
</div> </div>
); );
} }

@ -1,11 +1,51 @@
import ContentWarp from '@/components/ContentWarp'; import ContentWarp from '@/components/ContentWarp';
import styles from '../../index.less'; import styles from '../../index.less';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { secretInit_sendCommand } from '@/services/gql';
import ClearInfoDialog from '@/components/ClearInfoDialog';
// 网络MMJ管理 --> 密码遥毙 // 网络MMJ管理 --> 密码遥毙
export default function Page() { export default function Page() {
const [htmlText, setHtmlText] = useState('<div>文本内容</div>') const [lines, setLines] = useState<any>([]);
const [currentLineIndex, setCurrentLineIndex] = useState(0);
const [visibility, setVisibility] = useState<boolean>(false);
const outputRef: any = useRef(null);
useEffect(() => {
const timer = setInterval(() => {
if (currentLineIndex < lines.length) {
setCurrentLineIndex((prevIndex) => prevIndex + 1);
} else {
clearInterval(timer);
}
}, 300);
if (outputRef.current.scrollHeight > 330) {
outputRef.current.scrollTop = outputRef.current.scrollHeight;
}
return () => {
clearInterval(timer); // 组件卸载时清除定时器
};
}, [currentLineIndex, lines.length]);
const sending = () => {
secretInit_sendCommand({type: 2}).then((res) => {
if (res?.result == "success") {
setLines([
...lines,
'发送命令成功',
`执行密码遥毙`,
`正在密码遥毙中...`,
`密码遥毙完成`
])
} else {
setLines([`${res?.errorMsg}`])
}
})
}
return ( return (
<div className={styles.params_warp}> <div className={styles.params_warp}>
@ -13,16 +53,31 @@ export default function Page() {
<div className='pd20'></div> <div className='pd20'></div>
<div className='line'></div> <div className='line'></div>
<div className='pd20 pb100'> <div className='pd20 pb100'>
<div className={styles.html_con}> <div ref={outputRef} className={styles.html_con}>
<div style={{ padding: '20px 12px' }} dangerouslySetInnerHTML={{ __html: htmlText }}></div> <div style={{ padding: '0px 12px' }}>
{lines.slice(0, currentLineIndex).map((line: string, index: number) => (
<p key={line} style={{ paddingTop: index == 0 ? 20 : 10 }}>{line}</p>
))}
</div>
</div> </div>
<div className={styles.btn_warp}> <div className={styles.btn_warp}>
<ButtonComp style={{ marginRight: 20 }} text={'发送命令'} onClick={() => { }} /> <ButtonComp style={{ marginRight: 20 }} text={'发送命令'} onClick={() => sending()} />
<ButtonComp type={'cancel'} text={'清空信息'} onClick={() => setHtmlText('')} /> <ButtonComp type={'cancel'} text={'清空信息'} onClick={() => setVisibility(true)} />
</div> </div>
</div> </div>
</ContentWarp> </ContentWarp>
<ClearInfoDialog
visibility={visibility}
onCancel={() => setVisibility(false)}
onOk={() => {
if (lines.length == 0) return;
setLines([]);
setCurrentLineIndex(0);
setVisibility(false);
}}>
<div></div>
</ClearInfoDialog>
</div> </div>
); );
} }

@ -1,18 +1,70 @@
import ContentWarp from '@/components/ContentWarp'; import ContentWarp from '@/components/ContentWarp';
import styles from '../../index.less'; import styles from '../../index.less';
import styles1 from './index.less'; import styles1 from './index.less';
import { Form, Input } from 'antd'; import { Form, Input, Upload, UploadProps, message } from 'antd';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { secretInit_cleanInfo, secretInit_loadData, secretInit_sendData } from '@/services/gql';
import { useEffect, useState, } from 'react';
import ClearInfoDialog from '@/components/ClearInfoDialog';
// 网络MMJ管理 --> MMJ初装 // 网络MMJ管理 --> MMJ初装
export default function Page() { export default function Page() {
const [dataLoading, setDataLoading] = useState(false);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [visibility, setVisibility] = useState<boolean>(false);
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log('表单提交:', values); console.log('表单提交:', values);
}; };
useEffect(() => {
let layoutInfo: any = localStorage.getItem('MMJInit');
if (layoutInfo) {
form.setFieldsValue({...JSON.parse(layoutInfo)})
}
}, [])
const props: UploadProps = {
maxCount: 1,
beforeUpload: (file: any) => {
secretInit_loadData(file).then((res) => {
if (res?.result == "success" && res?.data.length > 0) {
message.success('加载数据成功');
form.setFieldsValue({...res?.data[0]})
localStorage.setItem('MMJInit', JSON.stringify(res?.data[0]));
setDataLoading(true);
} else {
message.error('加载数据失败');
}
})
}
};
const goData = () => {
if (!dataLoading) {
message.info('请先加载数据');
return
}
secretInit_sendData({}).then((res) => {
if (res?.result == "success") {
message.success('发送数据成功');
} else {
message.error('发送数据失败');
}
})
}
const clearInfo = () => {
secretInit_cleanInfo({}).then((res) => {
if (res?.result == "success") {
message.success('清空信息成功');
form.resetFields()
localStorage.removeItem('MMJInit');
} else {
message.error('清空信息失败');
}
})
}
return ( return (
<div className={`${styles.params_warp} ${styles1.params_warp1}`}> <div className={`${styles.params_warp} ${styles1.params_warp1}`}>
@ -25,40 +77,53 @@ export default function Page() {
onFinish={onFinish} onFinish={onFinish}
> >
<Form.Item <Form.Item
name="a3" name="passwordInit"
label="初装密钥" label="初装密钥"
rules={[ // rules={[
{ required: true, message: '请输入初装密钥' }, // { required: true, message: '请输入初装密钥' },
]} // ]}
> >
<Input style={{ width: '560px' }} /> <Input style={{ width: '560px' }} disabled={true}/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="a2" name="algorithmParam"
label="算法参数" label="算法参数"
rules={[ // rules={[
{ required: true, message: '请输入算法参数' }, // { required: true, message: '请输入算法参数' },
]} // ]}
> >
<Input style={{ width: '560px' }} /> <Input style={{ width: '560px' }} disabled={true}/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="a1" name="paramCode"
label="参数自检码" label="参数自检码"
rules={[ // rules={[
{ required: true, message: '请输入参数自检码' }, // { required: true, message: '请输入参数自检码' },
]} // ]}
> >
<Input style={{ width: '560px' }} /> <Input style={{ width: '560px' }} disabled={true}/>
</Form.Item> </Form.Item>
</Form> </Form>
<div className={styles.btn_warp}> <div className={styles.btn_warp}>
<ButtonComp style={{ marginRight: 20 }} text={'加载数据'} onClick={() => form.submit()} /> <Upload {...props} showUploadList={false}>
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'发送数据'} onClick={() => { }} /> <ButtonComp style={{ marginRight: 20 }} text={'加载数据'} />
<ButtonComp type={'cancel'} text={'清空信息'} onClick={() => form.resetFields()} /> </Upload>
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'发送数据'} onClick={() => {
goData()
}} />
<ButtonComp type={'cancel'} text={'清空信息'} onClick={() => setVisibility(true)} />
</div> </div>
</div> </div>
</ContentWarp> </ContentWarp>
<ClearInfoDialog
visibility={visibility}
onCancel={() => setVisibility(false)}
onOk={() => {
clearInfo()
}}>
<div></div>
</ClearInfoDialog>
</div> </div>
); );
} }

@ -1,11 +1,51 @@
import ContentWarp from '@/components/ContentWarp'; import ContentWarp from '@/components/ContentWarp';
import styles from '../../index.less'; import styles from '../../index.less';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { secretInit_sendCommand } from '@/services/gql';
import ClearInfoDialog from '@/components/ClearInfoDialog';
// 网络MMJ管理 --> MMJ遥毙 // 网络MMJ管理 --> 密码机遥毙
export default function Page() { export default function Page() {
const [htmlText, setHtmlText] = useState('<div>文本内容</div>') const [lines, setLines] = useState<any>([]);
const [currentLineIndex, setCurrentLineIndex] = useState(0);
const [visibility, setVisibility] = useState<boolean>(false);
const outputRef: any = useRef(null);
useEffect(() => {
const timer = setInterval(() => {
if (currentLineIndex < lines.length) {
setCurrentLineIndex((prevIndex) => prevIndex + 1);
} else {
clearInterval(timer);
}
}, 300);
if (outputRef.current.scrollHeight > 330) {
outputRef.current.scrollTop = outputRef.current.scrollHeight;
}
return () => {
clearInterval(timer); // 组件卸载时清除定时器
};
}, [currentLineIndex, lines.length]);
const sending = () => {
secretInit_sendCommand({type: 2}).then((res) => {
if (res?.result == "success") {
setLines([
...lines,
'发送命令成功',
`执行密码机遥毙`,
`正在密码机遥毙中...`,
`密码机遥毙完成`
])
} else {
setLines([`${res?.errorMsg}`])
}
})
}
return ( return (
<div className={styles.params_warp}> <div className={styles.params_warp}>
@ -13,16 +53,32 @@ export default function Page() {
<div className='pd20'></div> <div className='pd20'></div>
<div className='line'></div> <div className='line'></div>
<div className='pd20 pb100'> <div className='pd20 pb100'>
<div className={styles.html_con}> <div ref={outputRef} className={styles.html_con}>
<div style={{ padding: '20px 12px' }} dangerouslySetInnerHTML={{ __html: htmlText }}></div> <div style={{ padding: '0px 12px' }}>
{lines.slice(0, currentLineIndex).map((line: string, index: number) => (
<p key={line} style={{ paddingTop: index == 0 ? 20 : 10 }}>{line}</p>
))}
</div>
</div> </div>
<div className={styles.erroInfo}></div> <div className={styles.erroInfo}></div>
<div className={styles.btn_warp}> <div className={styles.btn_warp}>
<ButtonComp style={{ marginRight: 20 }} text={'发送命令'} onClick={() => { }} /> <ButtonComp style={{ marginRight: 20 }} text={'发送命令'} onClick={() => sending()} />
<ButtonComp type={'cancel'} text={'清空信息'} onClick={() => setHtmlText('')} /> <ButtonComp type={'cancel'} text={'清空信息'} onClick={() => setVisibility(true)} />
</div> </div>
</div> </div>
</ContentWarp> </ContentWarp>
<ClearInfoDialog
visibility={visibility}
onCancel={() => setVisibility(false)}
onOk={() => {
if (lines.length == 0) return;
setLines([]);
setCurrentLineIndex(0);
setVisibility(false);
}}>
<div></div>
</ClearInfoDialog>
</div> </div>
); );
} }

@ -1,11 +1,58 @@
import ContentWarp from '@/components/ContentWarp'; import ContentWarp from '@/components/ContentWarp';
import styles from '../../index.less'; import styles from '../../index.less';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { secretInit_getStatus } from '@/services/gql';
import { message } from 'antd';
import ClearInfoDialog from '@/components/ClearInfoDialog';
// 网络MMJ管理 --> 状态查询 // 网络MMJ管理 --> 状态查询
export default function Page() { export default function Page() {
const [htmlText, setHtmlText] = useState('<div>文本内容</div>') const [lines, setLines] = useState<any>([]);
const [currentLineIndex, setCurrentLineIndex] = useState(0);
const [visibility, setVisibility] = useState<boolean>(false);
const outputRef: any = useRef(null);
useEffect(() => {
const timer = setInterval(() => {
if (currentLineIndex < lines.length) {
setCurrentLineIndex((prevIndex) => prevIndex + 1);
} else {
clearInterval(timer);
}
}, 300);
if (outputRef.current.scrollHeight > 330) {
outputRef.current.scrollTop = outputRef.current.scrollHeight;
}
return () => {
clearInterval(timer); // 组件卸载时清除定时器
};
}, [currentLineIndex, lines.length]);
const statusQuery = () => {
secretInit_getStatus({}).then((res) => {
if (res?.result == "success") {
let data = res?.data[0];
setLines([
...lines,
`算法参数--${data?.algorithmParam}`,
`创建时间--${data?.createTime}`,
`导入文件名--${data?.fileName}`,
`未遥毙--${data?.mmjKill}`,
`参数自检码--${data?.paramCode}`,
`初装秘钥--${data?.passwordInit}`,
`秘钥数据状态--${data?.secretDataStatus}`,
`秘钥机未遥毙--${data?.secretKill}`,
`秘钥未销毁--${data?.secretRain}`,
`更新时间--${data?.updateTime}`,
])
} else {
setLines([`${res?.errorMsg}`])
}
})
}
return ( return (
<div className={styles.params_warp}> <div className={styles.params_warp}>
@ -13,16 +60,34 @@ export default function Page() {
<div className='pd20'></div> <div className='pd20'></div>
<div className='line'></div> <div className='line'></div>
<div className='pd20 pb100'> <div className='pd20 pb100'>
<div className={styles.html_con}> <div ref={outputRef} className={styles.html_con}>
<div style={{ padding: '20px 12px' }} dangerouslySetInnerHTML={{ __html: htmlText }}></div> <div style={{ padding: '0px 12px' }} key={currentLineIndex}>
{lines.slice(0, currentLineIndex).map((line: string, index: number) => (
<p key={index} style={{ paddingTop: index == 0 ? 20 : 10 }}>{line}</p>
))}
</div>
</div> </div>
<div className={styles.btn_warp}> <div className={styles.btn_warp}>
<ButtonComp style={{ marginRight: 20 }} text={'状态查询'} onClick={() => { }} /> <ButtonComp style={{ marginRight: 20 }} text={'状态查询'} onClick={() => { statusQuery() }} />
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'文件另存'} onClick={() => { }} /> <ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'文件另存'} onClick={() => {
<ButtonComp type={'cancel'} text={'清空信息'} onClick={() => setHtmlText('')} /> message.info('该功能还在开发中!');
}} />
<ButtonComp type={'cancel'} disabled={lines.length == 0} text={'清空信息'} onClick={() => setVisibility(true)} />
</div> </div>
</div> </div>
</ContentWarp> </ContentWarp>
<ClearInfoDialog
visibility={visibility}
onCancel={() => setVisibility(false)}
onOk={() => {
if (lines.length == 0) return;
setLines([]);
setCurrentLineIndex(0);
setVisibility(false);
}}>
<div></div>
</ClearInfoDialog>
</div> </div>
); );
} }

@ -28,6 +28,5 @@
border: 1px solid #E3E3E3; border: 1px solid #E3E3E3;
width: 100%; width: 100%;
height: 330px; height: 330px;
overflow: hidden; overflow-y: scroll;
overflow-y: auto;
} }

@ -23,6 +23,13 @@ const DeviceInstall: FC<PageProps> = ({ }) => {
"dataInstalled": null "dataInstalled": null
}); });
useEffect(() => {
let layoutInfo: any = localStorage.getItem('deviceInit');
if (layoutInfo) {
setFileInfo(JSON.parse(layoutInfo))
}
}, [])
const props: UploadProps = { const props: UploadProps = {
maxCount: 1, maxCount: 1,
@ -31,6 +38,7 @@ const DeviceInstall: FC<PageProps> = ({ }) => {
if (res?.result == "success" && res?.data.length > 0) { if (res?.result == "success" && res?.data.length > 0) {
message.success('数据加载成功'); message.success('数据加载成功');
setFileInfo(res?.data[0]); setFileInfo(res?.data[0]);
localStorage.setItem('deviceInit', JSON.stringify(res?.data[0]));
setDataLoading(true); setDataLoading(true);
} else { } else {
message.error('数据加载失败'); message.error('数据加载失败');
@ -63,7 +71,7 @@ const DeviceInstall: FC<PageProps> = ({ }) => {
</Upload> </Upload>
<ButtonComp text={'数据安装'} onClick={() => { <ButtonComp text={'数据安装'} onClick={() => {
if (!dataLoading) { if (!dataLoading) {
message.info('请先完成数据加载'); message.info('请先数据加载');
return return
} }

@ -28,7 +28,11 @@ const PowerOnAuth: FC<PageProps> = ({ }) => {
useEffect(() => { useEffect(() => {
college_table_query({}).then((res) => { college_table_query({}).then((res) => {
if (res?.result == "success" && res?.data.length > 0) { if (res?.result == "success" && res?.data.length > 0) {
setVisibility(false); let layoutInfo: any = localStorage.getItem('powerOn');
if (!JSON.parse(layoutInfo).powerOn) {
setVisibility(true);
localStorage.setItem('powerOn', JSON.stringify({ powerOn: true }));
}
setDeviceInfo(res?.data[0]); setDeviceInfo(res?.data[0]);
} else { } else {
message.error('开机认证失败'); message.error('开机认证失败');

@ -48,9 +48,8 @@
} }
.right_warp { .right_warp {
height: calc(100vh - 58px); height: calc(100% - 58px);
min-height: 600px; min-height: calc(100vh - 58px);
width: calc(100vw - 261px); width: calc(100vw - 261px);
background: #F1F1F1; background: #F1F1F1;
overflow: hidden; overflow: hidden;

@ -0,0 +1,33 @@
import { getRequest, postRequest, uploadFile } from "@/utils/request";
// 参数设置
export async function setParameter(data: any) {
return postRequest(`/xgd/parameterSet/setParameter`, data);
}
// -----------------------------MMJ初装-------------------------
// 清空信息
export async function secretInit_cleanInfo(params: any) {
return getRequest(`/xgd/secretInit/cleanInfo`, params);
}
// 状态查询
export async function secretInit_getStatus(params: any) {
return getRequest(`/xgd/secretInit/getStatus`, params);
}
// 加载数据
export async function secretInit_loadData(params: any) {
return uploadFile(`/xgd/secretInit/loadData`, params);
}
// 发送命令
// @param type 1 密销毁 2 密毙 密机遥毙
export async function secretInit_sendCommand(params: any) {
return getRequest(`/xgd/secretInit/sendCommand`, params);
}
// 发送数据
export async function secretInit_sendData(params: any) {
return postRequest(`/xgd/secretInit/sendData`, params);
}
Loading…
Cancel
Save