更新安装页面内容

master
鲁誉程 10 months ago
parent c94ff285b8
commit 56933ebf90

@ -1,14 +1,17 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const CodeDriver: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -39,12 +42,9 @@ const CodeDriver: FC<PageProps> = ({
const setValue = () => {
setActive((e) => { return e + 1 })
}
const installSuccess = () => {
let installExe: any = localStorage.getItem('installExe')
let data = JSON.parse(installExe);
data[14].select = true;
localStorage.setItem('installExe', JSON.stringify(data));
message.success('一体化密码机驱动安装成功!')
setInstallExe(14,'一体化密码机驱动安装成功!')
onCancel()
}
@ -59,8 +59,8 @@ const CodeDriver: FC<PageProps> = ({
{![1, 2].includes(active) && <div className={styles.title1}> </div>}
{active == 1 && <div className={styles.pic1}></div>}
{active == 2 && <div className={styles.pic1} style={{ top: 166, left: 85}}></div>}
{active == 4 && <div className={styles.pic1} style={{ top: 123, left: 85}}></div>}
{active == 2 && <div className={styles.pic1} style={{ top: 166, left: 85 }}></div>}
{active == 4 && <div className={styles.pic1} style={{ top: 123, left: 85 }}></div>}
{[1, 2].includes(active) && <div
className={styles.net}

@ -1,18 +1,20 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
import { countType } from '@/utils';
import { countType, setInstallExe } from '@/utils';
import { useParams } from 'umi';
import DEV from '@/utils/env/dev';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const CodeManage: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -60,13 +62,7 @@ const CodeManage: FC<PageProps> = ({
}),
});
const data = await response.text();
message.success(data)
// 储存信息
let installExe: any = localStorage.getItem('installExe')
let obj = JSON.parse(installExe);
obj[13].select = true;
localStorage.setItem('installExe', JSON.stringify(obj));
setInstallExe(13, data)
onCancel()
} catch (error) {

@ -1,18 +1,20 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
import { countType, sysType } from '@/utils';
import { countType, setInstallExe, sysType } from '@/utils';
import { useParams } from 'umi';
import DEV from '@/utils/env/dev';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const CoreArea: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -66,14 +68,7 @@ const CoreArea: FC<PageProps> = ({
}),
});
const data = await response.text();
message.success(data)
// 储存信息
let installExe: any = localStorage.getItem('installExe')
let obj = JSON.parse(installExe);
obj[10].select = true;
localStorage.setItem('installExe', JSON.stringify(obj));
setInstallExe(10, data)
onCancel()
} catch (error) {
message.error(error); // 处理请求错误

@ -2,14 +2,17 @@ import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const CodeDriver: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -41,11 +44,7 @@ const CodeDriver: FC<PageProps> = ({
setActive((e) => { return e + 1 })
}
const installSuccess = () => {
let installExe: any = localStorage.getItem('installExe')
let data = JSON.parse(installExe);
data[12].select = true;
localStorage.setItem('installExe', JSON.stringify(data));
message.success('密码资源输入输出设备驱动安装成功!')
setInstallExe(12, '密码资源输入输出设备驱动安装成功!')
onCancel()
}

@ -1,18 +1,20 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
import { countType, sysType } from '@/utils';
import { countType, setInstallExe, sysType } from '@/utils';
import { useParams } from 'umi';
import DEV from '@/utils/env/dev';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const DutyArea: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -66,14 +68,7 @@ const DutyArea: FC<PageProps> = ({
}),
});
const data = await response.text();
message.success(data)
// 储存信息
let installExe: any = localStorage.getItem('installExe')
let obj = JSON.parse(installExe);
obj[10].select = true;
localStorage.setItem('installExe', JSON.stringify(obj));
setInstallExe(10, data)
onCancel()
} catch (error) {
message.error(error); // 处理请求错误

@ -1,14 +1,17 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const FlashPlayer: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -42,11 +45,7 @@ const FlashPlayer: FC<PageProps> = ({
// 安装完成后 记录安装的信息
const installSuccess = () => {
let installExe: any = localStorage.getItem('installExe')
let data = JSON.parse(installExe);
data[2].select = true;
localStorage.setItem('installExe', JSON.stringify(data));
message.success('FlashPlayer安装成功')
setInstallExe(2, 'FlashPlayer安装成功')
onCancel()
}

@ -1,14 +1,17 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const GBase: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [password, setPassword] = useState('');
@ -44,11 +47,7 @@ const GBase: FC<PageProps> = ({
// 安装完成后 记录安装的信息
const installSuccess = () => {
let installExe: any = localStorage.getItem('installExe')
let data = JSON.parse(installExe);
data[0].select = true;
localStorage.setItem('installExe', JSON.stringify(data));
message.success('Gbase安装成功')
setInstallExe(0, 'Gbase安装成功')
onCancel()
}
@ -76,6 +75,10 @@ const GBase: FC<PageProps> = ({
if (active == 8 && verifyPassword()) return
if (active == 8) {
// localStorage.setItem('GBasePassword', '');
}
if (active == 12) { installSuccess(); return }
setValue()

@ -1,14 +1,17 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const HGoogleEarth: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -39,11 +42,7 @@ const HGoogleEarth: FC<PageProps> = ({
// 安装完成后 记录安装的信息
const installSuccess = () => {
let installExe: any = localStorage.getItem('installExe')
let data = JSON.parse(installExe);
data[6].select = true;
localStorage.setItem('installExe', JSON.stringify(data));
message.success('HGoogleEarth安装成功')
setInstallExe(6, 'HGoogleEarth安装成功')
onCancel()
}

@ -1,14 +1,17 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const MSXML: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -42,11 +45,7 @@ const MSXML: FC<PageProps> = ({
// 安装完成后 记录安装的信息
const installSuccess = () => {
let installExe: any = localStorage.getItem('installExe')
let data = JSON.parse(installExe);
data[3].select = true;
localStorage.setItem('installExe', JSON.stringify(data));
message.success('MSXML安装成功')
setInstallExe(3, 'MSXML安装成功')
onCancel()
}

@ -1,14 +1,17 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const Net: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -42,11 +45,7 @@ const Net: FC<PageProps> = ({
// 安装完成后 记录安装的信息
const installSuccess = () => {
let installExe: any = localStorage.getItem('installExe')
let data = JSON.parse(installExe);
data[4].select = true;
localStorage.setItem('installExe', JSON.stringify(data));
message.success('Net安装成功')
setInstallExe(4, 'Net安装成功')
onCancel()
}

@ -1,14 +1,17 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
interface PageProps {
open: boolean;
onCancel: () => void;
setInstallExe: (index: number, text: string) => void;
}
const NetSP1: FC<PageProps> = ({
open = false,
onCancel
onCancel,
setInstallExe
}) => {
const [active, setActive] = useState(1);
const [percentVal, setPercentVal] = useState(0);
@ -42,11 +45,7 @@ const NetSP1: FC<PageProps> = ({
// 安装完成后 记录安装的信息
const installSuccess = () => {
let installExe: any = localStorage.getItem('installExe')
let data = JSON.parse(installExe);
data[5].select = true;
localStorage.setItem('installExe', JSON.stringify(data));
message.success('Net安装成功')
setInstallExe(5, 'Net SP1安装成功')
onCancel()
}

@ -43,6 +43,8 @@ const typeData = [
interface PageProps { }
const InstallExe: FC<PageProps> = ({ }) => {
const urlParams = useParams();
const [listData, setListData] = useState<any[]>([]);
const [open1, setOpen1] = useState(false); // Gbase
const [open2, setOpen2] = useState(false); // HGoogleEarth
@ -59,12 +61,18 @@ const InstallExe: FC<PageProps> = ({ }) => {
const [open12, setOpen12] = useState(false); // 一体化密码机驱动安装程序
useEffect(() => {
let data = localStorage.getItem('installExe');
if (data) {
setListData(JSON.parse(data));
let sysName = localStorage.getItem(`${urlParams?.fileType}`);
if (sysName) {
let info = JSON.parse(sysName)
if (info?.installExe) {
setListData(info.installExe);
} else {
info.installExe = typeData
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify(info));
setListData(typeData);
}
} else {
localStorage.setItem('installExe', JSON.stringify(typeData));
setListData(typeData);
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify({}));
}
}, [])
@ -116,11 +124,13 @@ const InstallExe: FC<PageProps> = ({ }) => {
setOpen1(true)
break;
case 'GBase升级程序':
let installExe: any = localStorage.getItem('installExe')
let info = JSON.parse(installExe);
info[1].select = true;
localStorage.setItem('installExe', JSON.stringify(info));
message.success('GBase升级成功')
let sysName = localStorage.getItem(`${urlParams?.fileType}`);
if (sysName) {
let info = JSON.parse(sysName);
info.installExe[1].select = true;
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify(info));
message.success('GBase升级成功')
}
break;
case 'HGoogleEarth':
setOpen2(true)
@ -155,6 +165,16 @@ const InstallExe: FC<PageProps> = ({ }) => {
}
}
const setInstallExe = (index: number, text: string) => {
let sysName = localStorage.getItem(`${urlParams?.fileType}`);
if (sysName) {
let info = JSON.parse(sysName);
info.installExe[index].select = true;
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify(info));
message.success(text)
}
}
return (
<div className={styles.exeInstall}>
<div className={styles.title_con}></div>
@ -181,25 +201,25 @@ const InstallExe: FC<PageProps> = ({ }) => {
</div>
</div>
<div className='flex_jE' style={{ marginTop: '3vh', paddingRight: '4.5vh' }}>
<ButtonComp text={'退出'} onClick={() =>{}} />
<ButtonComp text={'退出'} onClick={() => { }} />
</div>
{/* 依赖程序安装--弹窗 */}
<GBase open={open1} onCancel={() => setOpen1(false)} />
<HGoogleEarth open={open2} onCancel={() => setOpen2(false)} />
<MSXML open={open3} onCancel={() => setOpen3(false)} />
<FlashPlayer open={open4} onCancel={() => setOpen4(false)} />
<Net open={open5} onCancel={() => setOpen5(false)} />
<NetSP1 open={open6} onCancel={() => setOpen6(false)} />
<GBase open={open1} onCancel={() => setOpen1(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<HGoogleEarth open={open2} onCancel={() => setOpen2(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<MSXML open={open3} onCancel={() => setOpen3(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<FlashPlayer open={open4} onCancel={() => setOpen4(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<Net open={open5} onCancel={() => setOpen5(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<NetSP1 open={open6} onCancel={() => setOpen6(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
{/* 专用核心密码管理分系统--弹窗 */}
<CoreArea open={open7} onCancel={() => setOpen7(false)} />
<DutyArea open={open8} onCancel={() => setOpen8(false)} />
<DeviceDriver open={open9} onCancel={() => setOpen9(false)} />
<CoreArea open={open7} onCancel={() => setOpen7(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<DutyArea open={open8} onCancel={() => setOpen8(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<DeviceDriver open={open9} onCancel={() => setOpen9(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
{/* 一体化密码机--弹窗 */}
<CodeManage open={open11} onCancel={() => setOpen11(false)} />
<CodeDriver open={open12} onCancel={() => setOpen12(false)} />
<CodeManage open={open11} onCancel={() => setOpen11(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<CodeDriver open={open12} onCancel={() => setOpen12(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
</div>
)
}

@ -12,6 +12,6 @@ export const sysType = {
'zq2': '下级'
}
export const rowClassName = (record:any, index: any) => {
export const rowClassName = (record:any, index: any) => {
return index % 2 === 0 ? 'even-row' : 'odd-row';
};
Loading…
Cancel
Save