diff --git a/src/pages/InitialSystem/index.tsx b/src/pages/InitialSystem/index.tsx index fe5d95d..7249bf2 100644 --- a/src/pages/InitialSystem/index.tsx +++ b/src/pages/InitialSystem/index.tsx @@ -17,8 +17,9 @@ const InitialSystem: FC = ({ }) => { const [visibility, setVisibility] = useState(true); const urlParams = useParams(); - let installExe: any = localStorage.getItem('installExe') - let info = JSON.parse(installExe); + let installExe = localStorage.getItem(`${urlParams?.fileType}`); + let info = installExe ? JSON.parse(installExe) : null; + const MenuList: any = { 'admin': [ { name: '算法加载', dom:
暂无内容
, img: '' }, @@ -60,7 +61,7 @@ const InitialSystem: FC = ({ }) => { return (
- {info[14].select ? <> + {info.installExe[14].select ? <> {/* 头部 */}
专用核心密码机管理软件
@@ -103,7 +104,7 @@ const InitialSystem: FC = ({ }) => { maskClosable={false} >
- 请先安装一体化密码机驱动程序 + 缺少驱动,请先安装所需的驱动程序!
diff --git a/src/pages/InstallExe/exeDialog/CodeDriver.tsx b/src/pages/InstallExe/exeDialog/CodeDriver.tsx index b10e8ef..0f972fb 100644 --- a/src/pages/InstallExe/exeDialog/CodeDriver.tsx +++ b/src/pages/InstallExe/exeDialog/CodeDriver.tsx @@ -16,6 +16,10 @@ const CodeDriver: FC = ({ const [active, setActive] = useState(1); const [percentVal, setPercentVal] = useState(0); + useEffect(() => { + if (open) setActive(1) + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 3) { diff --git a/src/pages/InstallExe/exeDialog/CodeManage.tsx b/src/pages/InstallExe/exeDialog/CodeManage.tsx index 90175f6..6c4220f 100644 --- a/src/pages/InstallExe/exeDialog/CodeManage.tsx +++ b/src/pages/InstallExe/exeDialog/CodeManage.tsx @@ -21,6 +21,10 @@ const CodeManage: FC = ({ const urlParams = useParams(); + useEffect(() => { + if (open) setActive(1) + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 3) { diff --git a/src/pages/InstallExe/exeDialog/CoreArea.tsx b/src/pages/InstallExe/exeDialog/CoreArea.tsx index 24ed932..4fea81a 100644 --- a/src/pages/InstallExe/exeDialog/CoreArea.tsx +++ b/src/pages/InstallExe/exeDialog/CoreArea.tsx @@ -27,6 +27,14 @@ const CoreArea: FC = ({ const urlParams = useParams(); + useEffect(() => { + if (open) { + setActive(1) + setPassword('') + setServerIp('127.0.0.1') + } + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 4) { @@ -86,9 +94,13 @@ const CoreArea: FC = ({ return true; } - if (false) { - message.error('用户名或密码错误!'); - return true; + let sysName = localStorage.getItem(`${urlParams?.fileType}`); + if (sysName) { + let info = JSON.parse(sysName) + if (password !== info.GBasePassword) { + message.error('密码错误!'); + return true; + } } } @@ -99,35 +111,35 @@ const CoreArea: FC = ({
-
{ +
{ onCancel('核心区安装程序') - }}>
+ }}>
{[1, 2, 3].includes(active) &&
核心区客户端 安装程序
} {![1, 2, 3].includes(active) &&
核心区客户端 安装程序
} {active == 1 &&
核心区客户端安装程序
} {active == 2 && <> -
填写GBase账号信息
-
用户名
-
密码
- { setUserName(e.target.value) }} className={styles.input1} style={{top: 121, left: 59, width: 325}}/> - { setPassword(e.target.value) }} className={styles.input2} style={{top: 171, left: 59, width: 325}}/> +
填写GBase账号信息
+
用户名
+
密码
+ { setUserName(e.target.value) }} className={styles.input1} style={{ top: 121, left: 59, width: 325 }} /> + { setPassword(e.target.value) }} className={styles.input2} style={{ top: 171, left: 59, width: 325 }} /> } {active == 3 &&
核心区客户端
} {active == 5 &&
核心区客户端
} {active == 6 && <> -
填写GBase账号信息
-
服务器的ip地址
-
服务器端口
-
本地端口
- { setServerIp(e.target.value) }} className={styles.input1} style={{top: 121, left: 109, width: 325}}/> - { setServerPort(e.target.value) }} className={styles.input2} style={{top: 171, left: 109, width: 325}}/> - { setLocalPort(e.target.value) }} className={styles.input2} style={{top: 221, left: 109, width: 325}}/> -
确定
-
取消
-
应用
+
填写GBase账号信息
+
服务器的ip地址
+
服务器端口
+
本地端口
+ { setServerIp(e.target.value) }} className={styles.input1} style={{ top: 121, left: 109, width: 325 }} /> + { setServerPort(e.target.value) }} className={styles.input2} style={{ top: 171, left: 109, width: 325 }} /> + { setLocalPort(e.target.value) }} className={styles.input2} style={{ top: 221, left: 109, width: 325 }} /> +
确定
+
取消
+
应用
} {[1, 2, 3].includes(active) &&
= ({ {[5, 6].includes(active) &&
{ active == 5 ? setValue() : installSuccess() }}> diff --git a/src/pages/InstallExe/exeDialog/DeviceDriver.tsx b/src/pages/InstallExe/exeDialog/DeviceDriver.tsx index 83ec7df..e6c56ea 100644 --- a/src/pages/InstallExe/exeDialog/DeviceDriver.tsx +++ b/src/pages/InstallExe/exeDialog/DeviceDriver.tsx @@ -17,6 +17,10 @@ const CodeDriver: FC = ({ const [active, setActive] = useState(1); const [percentVal, setPercentVal] = useState(0); + useEffect(() => { + if (open) setActive(1) + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 3) { diff --git a/src/pages/InstallExe/exeDialog/DutyArea.tsx b/src/pages/InstallExe/exeDialog/DutyArea.tsx index d33dc23..51ffac8 100644 --- a/src/pages/InstallExe/exeDialog/DutyArea.tsx +++ b/src/pages/InstallExe/exeDialog/DutyArea.tsx @@ -27,6 +27,14 @@ const DutyArea: FC = ({ const urlParams = useParams(); + useEffect(() => { + if (open) { + setActive(1) + setPassword('') + setServerIp('127.0.0.1') + } + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 4) { diff --git a/src/pages/InstallExe/exeDialog/FlashPlayer.tsx b/src/pages/InstallExe/exeDialog/FlashPlayer.tsx index 5594ec4..d0e7584 100644 --- a/src/pages/InstallExe/exeDialog/FlashPlayer.tsx +++ b/src/pages/InstallExe/exeDialog/FlashPlayer.tsx @@ -16,6 +16,10 @@ const FlashPlayer: FC = ({ const [active, setActive] = useState(1); const [percentVal, setPercentVal] = useState(0); + useEffect(() => { + if (open) setActive(1) + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 2) { diff --git a/src/pages/InstallExe/exeDialog/GBase.tsx b/src/pages/InstallExe/exeDialog/GBase.tsx index e5a208a..41123a8 100644 --- a/src/pages/InstallExe/exeDialog/GBase.tsx +++ b/src/pages/InstallExe/exeDialog/GBase.tsx @@ -20,6 +20,14 @@ const GBase: FC = ({ const [confirmPassword, setConfirmPassword] = useState(''); const [percentVal, setPercentVal] = useState(0); + useEffect(() => { + if (open) { + setActive(1) + setPassword('') + setConfirmPassword('') + } + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 11) { diff --git a/src/pages/InstallExe/exeDialog/HGoogleEarth.tsx b/src/pages/InstallExe/exeDialog/HGoogleEarth.tsx index 855c88b..623b242 100644 --- a/src/pages/InstallExe/exeDialog/HGoogleEarth.tsx +++ b/src/pages/InstallExe/exeDialog/HGoogleEarth.tsx @@ -17,6 +17,10 @@ const HGoogleEarth: FC = ({ const [percentVal, setPercentVal] = useState(0); const [showOk, setShowOk] = useState(false); + useEffect(() => { + if (open) setActive(1) + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 2) { diff --git a/src/pages/InstallExe/exeDialog/MSXML.tsx b/src/pages/InstallExe/exeDialog/MSXML.tsx index 723565d..40746ef 100644 --- a/src/pages/InstallExe/exeDialog/MSXML.tsx +++ b/src/pages/InstallExe/exeDialog/MSXML.tsx @@ -16,6 +16,10 @@ const MSXML: FC = ({ const [active, setActive] = useState(1); const [percentVal, setPercentVal] = useState(0); + useEffect(() => { + if (open) setActive(1) + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 6) { diff --git a/src/pages/InstallExe/exeDialog/Net.tsx b/src/pages/InstallExe/exeDialog/Net.tsx index bad1251..7dbbdb2 100644 --- a/src/pages/InstallExe/exeDialog/Net.tsx +++ b/src/pages/InstallExe/exeDialog/Net.tsx @@ -16,6 +16,10 @@ const Net: FC = ({ const [active, setActive] = useState(1); const [percentVal, setPercentVal] = useState(0); + useEffect(() => { + if (open) setActive(1) + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 3) { diff --git a/src/pages/InstallExe/exeDialog/NetSP1.tsx b/src/pages/InstallExe/exeDialog/NetSP1.tsx index d3c7ad2..69207a7 100644 --- a/src/pages/InstallExe/exeDialog/NetSP1.tsx +++ b/src/pages/InstallExe/exeDialog/NetSP1.tsx @@ -16,6 +16,10 @@ const NetSP1: FC = ({ const [active, setActive] = useState(1); const [percentVal, setPercentVal] = useState(0); + useEffect(() => { + if (open) setActive(1) + }, [open]) + // 监听是否到安装进度条步骤 useEffect(() => { if (active == 3) {