更新安装页面内容

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

@ -1,10 +1,11 @@
import React, { FC, useEffect, useState } from 'react';
import styles from './index.less';
import { Input, Progress, message } from 'antd';
import { useParams } from 'umi';
interface PageProps {
open: boolean;
onCancel: () => void;
onCancel: (name?: string) => void;
setInstallExe: (index: number, text: string) => void;
}
@ -13,6 +14,7 @@ const GBase: FC<PageProps> = ({
onCancel,
setInstallExe
}) => {
const urlParams = useParams();
const [active, setActive] = useState(1);
const [password, setPassword] = 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 <>
{
open &&
@ -72,15 +83,9 @@ const GBase: FC<PageProps> = ({
{active == 1 && <div className={styles.a1} onClick={() => setValue()}></div>}
{(active > 1 && active != 11) && <div className={styles.a2} onClick={() => {
if (active == 8 && verifyPassword()) return
if (active == 8) {
// localStorage.setItem('GBasePassword', '');
}
if (active == 8 && verifyPassword()) return;
if (active == 8) setGBasePassword();
if (active == 12) { installSuccess(); return }
setValue()
}}></div>}
@ -99,6 +104,9 @@ const GBase: FC<PageProps> = ({
{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} />
</div>}
<div className={styles.gbase_close} onClick={() => onCancel('GBase')}></div>
</div>
</div>
}

@ -155,7 +155,18 @@
font-size: 13px;
cursor: pointer;
}
.gbase_close {
position: absolute;
width: 18px;
height: 18px;
top: 3px;
right: 5px;
cursor: pointer;
}
}
.title{
position: absolute;
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 (
<div className={styles.exeInstall}>
<div className={styles.title_con}></div>
@ -205,7 +219,11 @@ const InstallExe: FC<PageProps> = ({ }) => {
</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) }} />
<MSXML open={open3} onCancel={() => setOpen3(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />
<FlashPlayer open={open4} onCancel={() => setOpen4(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />

Loading…
Cancel
Save