master_055
张瑞宁 1 year ago
parent 1fa1cfafe6
commit bd7e716842

@ -1,6 +1,10 @@
const routes = [ const routes = [
{ path: '/', redirect: '/index', }, // 本地跑时为了方便先使用这个 // { path: '/', redirect: '/index', }, // 本地跑时为了方便先使用这个
// { path: '/', redirect: '/404', }, // 后续上线时开放 { path: '/', redirect: '/404', }, // 后续上线时开放
// 桌面
{ path: '/index', name: '桌面', component: '@/pages/index', layout: false },
// 节点初始化工具 // 节点初始化工具
{ path: '/nodeInit/:fileType', name: '节点初始化工具', component: '@/pages/NodeInitTool', layout: false }, { path: '/nodeInit/:fileType', name: '节点初始化工具', component: '@/pages/NodeInitTool', layout: false },
@ -28,9 +32,6 @@ const routes = [
{ path: '/secretmanage/offline/export/:fileType', name: '离线管理导出', component: '@/pages/SecretManage/OffLineManage/ExportStep' }, { path: '/secretmanage/offline/export/:fileType', name: '离线管理导出', component: '@/pages/SecretManage/OffLineManage/ExportStep' },
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// 桌面
{ path: '/index', name: '桌面', component: '@/pages/index', layout: false },
// 建设中页面 // 建设中页面
{ {

@ -1,7 +1,7 @@
import { FC, useEffect, useState } from 'react'; import { FC, useEffect, useState } from 'react';
import { history, useLocation, useParams } from 'umi'; import { history, useLocation, useParams } from 'umi';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { Table } from 'antd'; import { Table, message } from 'antd';
import styles from './index.less'; import styles from './index.less';
import CheckSelect from '@/components/CheckSelect'; import CheckSelect from '@/components/CheckSelect';
import CheckInput from '@/components/CheckInput'; import CheckInput from '@/components/CheckInput';
@ -25,6 +25,7 @@ const MachineRegister: FC<PageProps> = ({ }) => {
midentifer: null,// 密码实体标识 midentifer: null,// 密码实体标识
mnumber: null,//上级设备编号 mnumber: null,//上级设备编号
}); });
const [accessPermissions, setAccessPermissions] = useState<boolean>(false);
const [clearAll, setclearAll] = useState(false) // 点击复位按钮时所有的chebox都变为false const [clearAll, setclearAll] = useState(false) // 点击复位按钮时所有的chebox都变为false
const [result, setResult] = useState({}) const [result, setResult] = useState({})
const [addModalVisible, setAddModalVisible] = useState<boolean>(false) //控制新增弹窗显隐 const [addModalVisible, setAddModalVisible] = useState<boolean>(false) //控制新增弹窗显隐
@ -35,6 +36,17 @@ const MachineRegister: FC<PageProps> = ({ }) => {
useEffect(() => { useEffect(() => {
installSuccess() installSuccess()
}, [])
useEffect(() => {
if (info?.nodeInitStatus) {
setAccessPermissions(true)
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify({ ...info, accessPermissions: true }))
} else {
setAccessPermissions(false)
}
}, []) }, [])

@ -38,9 +38,11 @@ const NodeInitTool: FC<PageProps> = ({ }) => {
const [pin, setPin] = useState<any>(''); const [pin, setPin] = useState<any>('');
const [radioValue, setRadioValue] = useState(1) const [radioValue, setRadioValue] = useState(1)
const [configRadio, setConfigRadio] = useState(1) const [configRadio, setConfigRadio] = useState(1) // 第三步:装配操作类型
const [form] = Form.useForm(); const [form] = Form.useForm();
const [dbIp,setdpIp] = useState('127.0.0.1') //数据库服务器IP地址
const [fileInfo, setFileInfo] = useState({ const [fileInfo, setFileInfo] = useState({
"secret": "", "secret": "",
"algorithm": "", "algorithm": "",
@ -82,9 +84,8 @@ const NodeInitTool: FC<PageProps> = ({ }) => {
formData.append('file', file); formData.append('file', file);
formData.append('sysType ', sysTypeStr[str]); formData.append('sysType ', sysTypeStr[str]);
nodeInit_step2(formData).then((res) => { nodeInit_step2(formData).then((res) => {
if (res?.result == "success" && res?.data.length > 0) { if (res?.result == "success" && res?.data.length >= 0) {
message.success('数据加载成功') message.success('数据加载成功')
console.log("res--", res)
setFileInfo(res?.data[0]); setFileInfo(res?.data[0]);
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify({ ...info, deviceInit: { data: res?.data[0], install: false } })); localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify({ ...info, deviceInit: { data: res?.data[0], install: false } }));
// setDataLoading(true); // setDataLoading(true);
@ -122,6 +123,7 @@ const NodeInitTool: FC<PageProps> = ({ }) => {
}).then((res) => { }).then((res) => {
if (res?.result == "success") { if (res?.result == "success") {
message.success('初始化成功'); message.success('初始化成功');
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify({ ...info, nodeInitStatus: true }))
form.resetFields(); form.resetFields();
} else { } else {
message.error(res?.errorMsg); message.error(res?.errorMsg);
@ -191,7 +193,7 @@ const NodeInitTool: FC<PageProps> = ({ }) => {
<div style={{ height: '200px', border: '1px solid #69C0E9' }}></div> <div style={{ height: '200px', border: '1px solid #69C0E9' }}></div>
<div style={{ marginTop: '50px', display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }}> <div style={{ marginTop: '50px', display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }}>
<div style={{ marginRight: '10px' }}>IP</div> <div style={{ marginRight: '10px' }}>IP</div>
<div style={{ flex: 1 }}><Input /></div> <div style={{ flex: 1 }}><Input value={dbIp} /></div>
<ButtonComp type={'confirm'} text={'确定'} style={{ marginLeft: '30px' }} onClick={() => { }} /> <ButtonComp type={'confirm'} text={'确定'} style={{ marginLeft: '30px' }} onClick={() => { }} />
</div> </div>
</div> </div>

@ -18,11 +18,10 @@ export default function IndexPage() {
const [tishiDialog, setTishiDialog] = useState(false); const [tishiDialog, setTishiDialog] = useState(false);
const list = [ const list = [
{ name: '01MMD049安装.exe', img: '', url: '/installExe' }, { name: '节点初始化工具', img: '', url: '/nodeInit' },
{ name: '初装系统', img: '', url: '/initialSystem' }, { name: '设备管理', img: '', url: '/machineManage/register' },
{ name: '核心管理系统', img: '', url: '/coreSystemEntrance/hx1' }, { name: '密钥管理', img: '', url: '/secretmanage/receive' },
{ name: '需要导出的文件', img: '', url: null }, { name: '063', img: '', url: null },
{ name: '生成导出的文件', img: '', url: null },
] ]
useEffect(() => { useEffect(() => {
@ -61,7 +60,6 @@ export default function IndexPage() {
return ( return (
<ConfigProvider theme={theme}> <ConfigProvider theme={theme}>
<div className={styles.index_con}> <div className={styles.index_con}>
<ButtonComp type='special' text='管理员身份认证' onClick={()=>{setVisibility(true)}} />
{ {
isAuth ? isAuth ?
list.map((item, index) => { list.map((item, index) => {
@ -69,7 +67,7 @@ export default function IndexPage() {
<div className={styles.item_warp} key={index} onClick={() => { <div className={styles.item_warp} key={index} onClick={() => {
if (item.url) { if (item.url) {
history.push(item.url) history.push(item.url)
} else if (item.name == '需要导出的文件') { } else if (item.name == '063') {
} else if (item.name == '生成导出的文件') { } else if (item.name == '生成导出的文件') {

@ -3,7 +3,7 @@ import { getRequest, postRequest, uploadFile } from '@/utils/request';
// 节点初始化第二步 // 节点初始化第二步
export async function nodeInit_step2(data: any) { export async function nodeInit_step2(data: any) {
console.log("data--",data) console.log("data--",data)
return postRequest(`/055/nodeInit/step2`, data); return uploadFile(`/055/nodeInit/step2`, data);
} }
// 节点初始化第四步 // 节点初始化第四步
export async function nodeInit_step4(data: any) { export async function nodeInit_step4(data: any) {

@ -1,7 +1,7 @@
export const DEV = { export const DEV = {
PROXY_SERVER: 'http://localhost:8088', PROXY_SERVER: 'http://localhost:8088',
// PROXY_SERVER: 'http://127.0.0.1:8088', // PROXY_SERVER: 'http://127.0.0.1:8088',
LOCAL_URL: 'http://localhost:8001', LOCAL_URL: 'http://localhost:8000',
FILE_URL: 'C:/Users/灯台百合/Desktop', // 快捷方式储存的路径 FILE_URL: 'C:/Users/灯台百合/Desktop', // 快捷方式储存的路径
HARD_CODE: false HARD_CODE: false
}; };

Loading…
Cancel
Save