From 4b4fd4cb7fa26c67b812fb861f1cd398ae824842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E8=AA=89=E7=A8=8B?= <2659568239@qq.com> Date: Fri, 19 Jan 2024 16:41:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=89=E8=A3=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/InstallExe/exeDialog/GBase.tsx | 26 +++++++++++++++-------- src/pages/InstallExe/exeDialog/index.less | 11 ++++++++++ src/pages/InstallExe/index.tsx | 20 ++++++++++++++++- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/src/pages/InstallExe/exeDialog/GBase.tsx b/src/pages/InstallExe/exeDialog/GBase.tsx index 5b7b3b8..e5a208a 100644 --- a/src/pages/InstallExe/exeDialog/GBase.tsx +++ b/src/pages/InstallExe/exeDialog/GBase.tsx @@ -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 = ({ 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 = ({ } } + 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 = ({ {active == 1 &&
setValue()}>
} {(active > 1 && active != 11) &&
{ - - 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() }}>
} @@ -99,6 +104,9 @@ const GBase: FC = ({ {active == 11 &&
} + + +
onCancel('GBase')}>
} diff --git a/src/pages/InstallExe/exeDialog/index.less b/src/pages/InstallExe/exeDialog/index.less index 301ff5d..b1db45f 100644 --- a/src/pages/InstallExe/exeDialog/index.less +++ b/src/pages/InstallExe/exeDialog/index.less @@ -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; diff --git a/src/pages/InstallExe/index.tsx b/src/pages/InstallExe/index.tsx index 520bbaf..6fc2769 100644 --- a/src/pages/InstallExe/index.tsx +++ b/src/pages/InstallExe/index.tsx @@ -175,6 +175,20 @@ const InstallExe: FC = ({ }) => { } } + // 取消选中 + const uncheck = (name: any) => { + if (name) { + setListData((prevListData) => { + return prevListData.map((e) => { + if (e.name === name) { + return { ...e, select: false }; + } + return e; + }); + }); + } + }; + return (
一体化对称密码管理系统
@@ -205,7 +219,11 @@ const InstallExe: FC = ({ }) => {
{/* 依赖程序安装--弹窗 */} - setOpen1(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} /> + { uncheck(e); setOpen1(false) }} + setInstallExe={(i, t) => { setInstallExe(i, t) }} + /> setOpen2(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} /> setOpen3(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} /> setOpen4(false)} setInstallExe={(i, t) => { setInstallExe(i, t) }} />