更新安装页面内容

master
鲁誉程 10 months ago
parent 56933ebf90
commit 4b4fd4cb7f

@ -1,10 +1,11 @@
import React, { FC, useEffect, useState } from 'react'; import React, { FC, useEffect, useState } from 'react';
import styles from './index.less'; import styles from './index.less';
import { Input, Progress, message } from 'antd'; import { Input, Progress, message } from 'antd';
import { useParams } from 'umi';
interface PageProps { interface PageProps {
open: boolean; open: boolean;
onCancel: () => void; onCancel: (name?: string) => void;
setInstallExe: (index: number, text: string) => void; setInstallExe: (index: number, text: string) => void;
} }
@ -13,6 +14,7 @@ const GBase: FC<PageProps> = ({
onCancel, onCancel,
setInstallExe setInstallExe
}) => { }) => {
const urlParams = useParams();
const [active, setActive] = useState(1); const [active, setActive] = useState(1);
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState(''); const [confirmPassword, setConfirmPassword] = useState('');
@ -63,6 +65,15 @@ const GBase: FC<PageProps> = ({
} }
} }
const setGBasePassword = () => {
let sysName = localStorage.getItem(`${urlParams?.fileType}`);
if (sysName) {
let info = JSON.parse(sysName);
info.GBasePassword = password;
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify(info));
}
}
return <> return <>
{ {
open && open &&
@ -72,15 +83,9 @@ const GBase: FC<PageProps> = ({
{active == 1 && <div className={styles.a1} onClick={() => setValue()}></div>} {active == 1 && <div className={styles.a1} onClick={() => setValue()}></div>}
{(active > 1 && active != 11) && <div className={styles.a2} onClick={() => { {(active > 1 && active != 11) && <div className={styles.a2} onClick={() => {
if (active == 8 && verifyPassword()) return;
if (active == 8 && verifyPassword()) return if (active == 8) setGBasePassword();
if (active == 8) {
// localStorage.setItem('GBasePassword', '');
}
if (active == 12) { installSuccess(); return } if (active == 12) { installSuccess(); return }
setValue() setValue()
}}></div>} }}></div>}
@ -99,6 +104,9 @@ const GBase: FC<PageProps> = ({
{active == 11 && <div className={styles.progress}> {active == 11 && <div className={styles.progress}>
<Progress percent={percentVal} steps={41} size={[9, 19]} strokeColor={'rgb(56, 158, 13)'} trailColor={'rgba(0,0,0,0)'} showInfo={false} /> <Progress percent={percentVal} steps={41} size={[9, 19]} strokeColor={'rgb(56, 158, 13)'} trailColor={'rgba(0,0,0,0)'} showInfo={false} />
</div>} </div>}
<div className={styles.gbase_close} onClick={() => onCancel('GBase')}></div>
</div> </div>
</div> </div>
} }

@ -155,7 +155,18 @@
font-size: 13px; font-size: 13px;
cursor: pointer; cursor: pointer;
} }
.gbase_close {
position: absolute;
width: 18px;
height: 18px;
top: 3px;
right: 5px;
cursor: pointer;
} }
}
.title{ .title{
position: absolute; position: absolute;
top: 8px; top: 8px;

@ -175,6 +175,20 @@ const InstallExe: FC<PageProps> = ({ }) => {
} }
} }
// 取消选中
const uncheck = (name: any) => {
if (name) {
setListData((prevListData) => {
return prevListData.map((e) => {
if (e.name === name) {
return { ...e, select: false };
}
return e;
});
});
}
};
return ( return (
<div className={styles.exeInstall}> <div className={styles.exeInstall}>
<div className={styles.title_con}></div> <div className={styles.title_con}></div>
@ -205,7 +219,11 @@ const InstallExe: FC<PageProps> = ({ }) => {
</div> </div>
{/* 依赖程序安装--弹窗 */} {/* 依赖程序安装--弹窗 */}
<GBase open={open1} onCancel={() => setOpen1(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} /> <GBase
open={open1}
onCancel={(e) => { uncheck(e); setOpen1(false) }}
setInstallExe={(i, t) => { setInstallExe(i, t) }}
/>
<HGoogleEarth open={open2} onCancel={() => setOpen2(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) }} /> <MSXML open={open3} onCancel={() => setOpen3(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<FlashPlayer open={open4} onCancel={() => setOpen4(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} /> <FlashPlayer open={open4} onCancel={() => setOpen4(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />

Loading…
Cancel
Save