diff --git a/.umirc.ts b/.umirc.ts index 5798e14..0ff304d 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -40,6 +40,11 @@ export default defineConfig({ component: '@/pages/Equipment/List/DataCenter', exact: true, }, + { + path: '/equipment/localManager', + component: '@/pages/Equipment/List/LocalManager', + exact: true, + }, { path: '/equipment', component: '@/pages/Equipment/Header', diff --git a/src/pages/Equipment/List/Certificate/Step1/index.less b/src/pages/Equipment/List/Certificate/Step1/index.less deleted file mode 100644 index d4d9165..0000000 --- a/src/pages/Equipment/List/Certificate/Step1/index.less +++ /dev/null @@ -1,29 +0,0 @@ -.page { - background-color: #fff; - width: 1200px; - margin: 0 auto; - min-height: 600px; - overflow: hidden; - padding-bottom: 20px; - .name { - display: flex; - align-items: center; - margin-bottom: 50px; - margin-top: 30px; - - b { - width: 6px; - height: 20px; - background: #464f66; - border-radius: 4px; - display: inline-block; - margin-right: 4px; - } - - span { - font-size: 24px; - font-weight: 500; - color: #232b40; - } - } -} diff --git a/src/pages/Equipment/List/Certificate/Step1/index.tsx b/src/pages/Equipment/List/Certificate/Step1/index.tsx deleted file mode 100644 index d7ed3ef..0000000 --- a/src/pages/Equipment/List/Certificate/Step1/index.tsx +++ /dev/null @@ -1,182 +0,0 @@ -import styles from './index.less'; -import { Input, Button, Row, Form, Select, message } from 'antd'; -import { FC } from 'react'; -import { connect, Dispatch, BasicInfoModelState } from 'umi'; -import Fetch from '@/utils/fetch'; - -interface PageProps { - basic: BasicInfoModelState; - dispatch: Dispatch; -} - -const Page: FC = ({ basic, dispatch }) => { - const [form] = Form.useForm(); - const { certificateInfo } = basic; - const { step } = certificateInfo; - - console.log(certificateInfo, 'certificateInfo'); - - const handleValuesChange = (v: any) => { - dispatch({ - type: 'basic/setCertificateInfo', - payload: v, - }); - }; - - const testLink = async () => { - const res = await Fetch('/openi/resource/dbTestConnection', { - method: 'post', - data: { - dbType: certificateInfo.dbType, - dbDrive: certificateInfo.dbDrive, - dbIp: certificateInfo.dbIp, - dbPort: certificateInfo.dbPort, - dbName: certificateInfo.dbName, - dbUser: certificateInfo.dbUser, - dbPasswd: certificateInfo.dbPasswd, - }, - }); - if (res.result === 'success') { - const data = res?.data?.[0]; - dispatch({ - type: 'basic/setCertificateInfo', - payload: { - dbIsConn: data?.isConn, - }, - }); - } else { - message.error(res.errorMsg); - } - }; - - return ( -
-
- 数据库配置 -
-
{ - dispatch({ - type: 'basic/setCertificateInfo', - payload: { step: 2 }, - }); - }} - > - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- ); -}; -export default connect(({ basic }: { basic: BasicInfoModelState }) => ({ - basic, -}))(Page); diff --git a/src/pages/Equipment/List/Certificate/Step2/index.less b/src/pages/Equipment/List/Certificate/Step2/index.less deleted file mode 100644 index a6cae1b..0000000 --- a/src/pages/Equipment/List/Certificate/Step2/index.less +++ /dev/null @@ -1,51 +0,0 @@ -.page { - background-color: #fff; - width: 1200px; - margin: 0 auto; - min-height: 600px; - overflow: hidden; - padding-bottom: 20px; - .name { - display: flex; - align-items: center; - margin-bottom: 50px; - margin-top: 30px; - - b { - width: 6px; - height: 20px; - background: #464f66; - border-radius: 4px; - display: inline-block; - margin-right: 4px; - } - - span { - font-size: 24px; - font-weight: 500; - color: #232b40; - } - } - - .title { - display: flex; - align-items: center; - margin-left: 60px; - margin-bottom: 30px; - - b { - width: 4px; - height: 14px; - background: #464f66; - border-radius: 4px; - display: inline-block; - margin-right: 4px; - } - - span { - font-size: 18px; - font-weight: 500; - color: #464f66; - } - } -} diff --git a/src/pages/Equipment/List/Certificate/Step2/index.tsx b/src/pages/Equipment/List/Certificate/Step2/index.tsx deleted file mode 100644 index 6cad8cb..0000000 --- a/src/pages/Equipment/List/Certificate/Step2/index.tsx +++ /dev/null @@ -1,169 +0,0 @@ -import styles from './index.less'; -import { Input, Button, Row, Form } from 'antd'; -import { FC } from 'react'; -import { connect, Dispatch, BasicInfoModelState } from 'umi'; - -interface PageProps { - basic: BasicInfoModelState; - dispatch: Dispatch; -} - -const Page: FC = ({ basic, dispatch }) => { - const [form] = Form.useForm(); - const { certificateInfo } = basic; - const { step } = certificateInfo; - - console.log(certificateInfo, 'certificateInfo'); - - const handleValuesChange = (v: any) => { - dispatch({ - type: 'basic/setCertificateInfo', - payload: v, - }); - }; - - return ( -
-
- 发布配置 -
-
{ - dispatch({ - type: 'basic/setCertificateInfo', - payload: { step: 3 }, - }); - }} - > -
- 数据库配置 -
- - - - - - - - - - - - -
- 用户证书发布配置 -
- - - -
- CRL发布配置 -
- - - - - - - - - - - -
- ); -}; -export default connect(({ basic }: { basic: BasicInfoModelState }) => ({ - basic, -}))(Page); diff --git a/src/pages/Equipment/List/Certificate/Step3/index.less b/src/pages/Equipment/List/Certificate/Step3/index.less deleted file mode 100644 index 3e372ef..0000000 --- a/src/pages/Equipment/List/Certificate/Step3/index.less +++ /dev/null @@ -1,48 +0,0 @@ -.page { - background-color: #fff; - width: 1200px; - margin: 0 auto; - min-height: 600px; - overflow: hidden; - padding-bottom: 20px; - - .name { - display: flex; - align-items: center; - margin-bottom: 50px; - margin-top: 30px; - - b { - width: 6px; - height: 20px; - background: #464f66; - border-radius: 4px; - display: inline-block; - margin-right: 4px; - } - - span { - font-size: 24px; - font-weight: 500; - color: #232b40; - } - } - - .row { - display: flex; - align-items: center; - justify-content: center; - padding: 30px 0; - - sup { - color: red; - margin-top: 13px; - margin-right: 4px; - font-size: 14px; - } - button { - margin-left: 30px; - margin-right: 10px; - } - } -} diff --git a/src/pages/Equipment/List/Certificate/Step3/index.tsx b/src/pages/Equipment/List/Certificate/Step3/index.tsx deleted file mode 100644 index 66d2d32..0000000 --- a/src/pages/Equipment/List/Certificate/Step3/index.tsx +++ /dev/null @@ -1,141 +0,0 @@ -import styles from './index.less'; -import { message, Button, Row, Form } from 'antd'; -import Fetch from '@/utils/fetch'; -import { useState, FC } from 'react'; -import { connect, Dispatch, BasicInfoModelState } from 'umi'; - -interface PageProps { - basic: BasicInfoModelState; - dispatch: Dispatch; -} - -const Page: FC = ({ basic, dispatch }) => { - const { certificateInfo } = basic; - const { step, importCertFile1, importCertFile2 } = certificateInfo; - const [file1, setFile1] = useState(null); - const [file2, setFile2] = useState(null); - const [upload, setUpload] = useState(true); - - console.log(certificateInfo, 'certificateInfo'); - - const handleFile = (type: string) => { - var inputObj = document.createElement('input'); - inputObj.setAttribute('id', '_ef'); - inputObj.setAttribute('type', 'file'); - inputObj.setAttribute('style', 'visibility:hidden'); - document.body.appendChild(inputObj); - inputObj.click(); - inputObj.onchange = (e: any) => { - if (type === 'file1') { - setFile1(e?.target?.files?.[0]); - } else { - setFile2(e?.target?.files?.[0]); - } - }; - }; - - const uploadFile = async () => { - const data: any = new FormData(); - data.append('files', file1); - data.append('files', file2); - const res = await Fetch('/openi/resource/importFiles', { - method: 'post', - data, - }); - if (res.result === 'success') { - message.success('上传成功'); - const data = res?.data?.[0]; - dispatch({ - type: 'basic/setCertificateInfo', - payload: { - importCertFile1: data[0], - importCertFile2: data[1], - }, - }); - setUpload(false); - } - }; - - const skip = async () => { - const res = await Fetch('/openi/resource/getCertInfomation'); - if (res.errorCode === 500) { - message.error(res?.errorMsg); - return; - } - if (res.result === 'success') { - const data = res?.data?.[0]; - dispatch({ - type: 'basic/setCertificateInfo', - payload: { - result: data, - }, - }); - dispatch({ - type: 'basic/setCertificateInfo', - payload: { step: 4 }, - }); - } - }; - - return ( -
-
- 导入颁发机构证书 -
-
- * -
请选择ECCDSA359算法颁发机构证书链文件(*.p7b)
- - {importCertFile1} -
-
- * -
请选择ECCDSA279算法颁发机构证书链文件(*.p7b)
- - {importCertFile2} -
-
- -
- - - - -
- ); -}; -export default connect(({ basic }: { basic: BasicInfoModelState }) => ({ - basic, -}))(Page); diff --git a/src/pages/Equipment/List/Certificate/Step4/index.less b/src/pages/Equipment/List/Certificate/Step4/index.less deleted file mode 100644 index f64b986..0000000 --- a/src/pages/Equipment/List/Certificate/Step4/index.less +++ /dev/null @@ -1,71 +0,0 @@ -.page { - background-color: #fff; - width: 1200px; - margin: 0 auto; - min-height: 600px; - overflow: hidden; - padding-bottom: 20px; - - .name { - display: flex; - align-items: center; - margin-bottom: 50px; - margin-top: 30px; - - b { - width: 6px; - height: 20px; - background: #464f66; - border-radius: 4px; - display: inline-block; - margin-right: 4px; - } - - span { - font-size: 24px; - font-weight: 500; - color: #232b40; - } - } - - .title { - display: flex; - align-items: center; - margin-left: 60px; - margin-bottom: 10px; - - b { - width: 4px; - height: 14px; - background: #464f66; - border-radius: 4px; - display: inline-block; - margin-right: 4px; - } - - span { - font-size: 18px; - font-weight: 500; - color: #464f66; - } - } - - .row { - display: flex; - align-items: center; - justify-content: center; - padding: 15px 0; - - span { - margin: 0 10px; - width: 50%; - font-size: 14px; - color: #333; - } - - span:first-child { - text-align: right; - color: #464f66; - } - } -} diff --git a/src/pages/Equipment/List/Certificate/Step4/index.tsx b/src/pages/Equipment/List/Certificate/Step4/index.tsx deleted file mode 100644 index b39b7e4..0000000 --- a/src/pages/Equipment/List/Certificate/Step4/index.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import styles from './index.less'; -import { Button, Row, message } from 'antd'; -import { FC } from 'react'; -import Fetch from '@/utils/fetch'; -import { connect, Dispatch, BasicInfoModelState, history } from 'umi'; - -interface PageProps { - basic: BasicInfoModelState; - dispatch: Dispatch; -} - -const Page: FC = ({ basic, dispatch }) => { - const { certificateInfo } = basic; - const { step, result } = certificateInfo; - - const handleClick = async () => { - const res = await Fetch('/openi/resource/openCertNow', { - method: 'post', - data: certificateInfo, - }); - if (res.result === 'success') { - message.success('开通证书系统成功'); - history.replace('/basic/login'); - } - }; - - return ( -
-
- 发布配置 -
- -
- ECCDSA359颁发机构信息 -
-
- 颁发证书主题 - {result?.[0]} -
-
- 证书序列号 - {result?.[1]} -
-
- 证书主题 - {result?.[2]} -
-
- 起始时间 - {result?.[3]} -
-
- 结束时间 - {result?.[4]} -
- -
- ECCDSA281颁发机构信息 -
-
- 颁发证书主题 - {result?.[5]} -
-
- 证书序列号 - {result?.[6]} -
-
- 证书主题 - {result?.[7]} -
-
- 起始时间 - {result?.[8]} -
-
- 结束时间 - {result?.[9]} -
- - - - - -
- ); -}; -export default connect(({ basic }: { basic: BasicInfoModelState }) => ({ - basic, -}))(Page); diff --git a/src/pages/Equipment/List/Certificate/index.less b/src/pages/Equipment/List/Certificate/index.less deleted file mode 100644 index d492926..0000000 --- a/src/pages/Equipment/List/Certificate/index.less +++ /dev/null @@ -1,4 +0,0 @@ -.page { - background-color: #fff; - margin-top: 20px; -} diff --git a/src/pages/Equipment/List/Certificate/index.tsx b/src/pages/Equipment/List/Certificate/index.tsx deleted file mode 100644 index e810ade..0000000 --- a/src/pages/Equipment/List/Certificate/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import styles from './index.less'; -import { FC } from 'react'; -import Step1 from './Step1'; -import Step2 from './Step2'; -import Step3 from './Step3'; -import Step4 from './Step4'; - -const Page: FC<{}> = () => { - return ( -
- - - - -
- ); -}; -export default Page; diff --git a/src/pages/Equipment/List/DataCenter/index.tsx b/src/pages/Equipment/List/DataCenter/index.tsx index 32b8920..9a523d5 100644 --- a/src/pages/Equipment/List/DataCenter/index.tsx +++ b/src/pages/Equipment/List/DataCenter/index.tsx @@ -28,6 +28,7 @@ const Page: FC = () => { const twoClick = async () => { if (!value) { message.warn('物理标识不能为空'); + return; } const res = await Fetch('/openi/dataCenter/setHostFlag', { method: 'post', @@ -41,6 +42,10 @@ const Page: FC = () => { }; const threeClick = async () => { + if (!file?.name) { + message.warn('初装资源不能为空'); + return; + } const data: any = new FormData(); data.append('file', file); const res = await Fetch('/openi/dataCenter/resourceImport', { @@ -111,8 +116,8 @@ const Page: FC = () => { 注入

- {/*
开通过程共 6 步,当前第 3 步
*/} diff --git a/src/pages/Equipment/List/LocalManager/img/bg.png b/src/pages/Equipment/List/LocalManager/img/bg.png new file mode 100644 index 0000000..d9a00b2 Binary files /dev/null and b/src/pages/Equipment/List/LocalManager/img/bg.png differ diff --git a/src/pages/Equipment/List/LocalManager/img/c.png b/src/pages/Equipment/List/LocalManager/img/c.png new file mode 100644 index 0000000..60f51f7 Binary files /dev/null and b/src/pages/Equipment/List/LocalManager/img/c.png differ diff --git a/src/pages/Equipment/List/LocalManager/index.less b/src/pages/Equipment/List/LocalManager/index.less new file mode 100644 index 0000000..d2775a8 --- /dev/null +++ b/src/pages/Equipment/List/LocalManager/index.less @@ -0,0 +1,211 @@ +.page { + height: 100vh; + background: url('./img/bg.png') no-repeat center center; + background-size: cover; + overflow: hidden; + display: flex; + align-items: center; + justify-content: center; + + .red { + color: #ff3f41; + } + + .box { + width: 902px; + height: 611px; + background: #ffffff; + border-radius: 20px; + display: flex; + background: url('./img/c.png') no-repeat center center; + background-size: cover; + + .one { + width: 100%; + height: 470px; + margin-top: 130px; + display: flex; + flex-direction: column; + align-items: center; + + > div { + font-size: 16px; + font-weight: bold; + color: #ffffff; + margin-top: 50px; + padding-right: 110px; + } + + aside { + display: flex; + margin-top: 50px; + font-size: 16px; + font-weight: bold; + color: #ffffff; + + ul { + padding-left: 15px; + + li { + list-style: none; + display: flex; + align-items: center; + margin-bottom: 20px; + cursor: pointer; + + b { + display: inline-block; + width: 18px; + height: 18px; + background: #376042; + border: 2px solid #2fffdb; + border-radius: 50%; + margin-right: 10px; + } + + .a { + position: relative; + + &::after { + content: ''; + width: 10px; + height: 10px; + position: absolute; + background-color: #2fffdb; + border-radius: 50%; + right: 2px; + top: 2px; + } + } + } + } + } + + button { + width: 208px; + height: 42px; + background: rgba(22, 93, 255, 0.5); + border-radius: 4px; + } + + > b { + color: #fff; + margin-top: 76px; + } + } + + .two { + width: 100%; + height: 470px; + margin-top: 130px; + display: flex; + flex-direction: column; + align-items: center; + + > span { + font-size: 22px; + font-weight: bold; + color: #ffffff; + margin-top: 38px; + } + + > div { + font-size: 16px; + font-weight: bold; + color: #ffffff; + margin-top: 52px; + } + + input { + width: 208px; + height: 40px; + border-radius: 4px; + border: 2px solid #2fffdb; + margin-top: 30px; + background-color: transparent; + color: #2fffdb; + } + + button { + width: 208px; + height: 42px; + border-radius: 4px; + margin-top: 70px; + background: rgba(22, 93, 255, 0.5); + } + + aside { + font-size: 16px; + font-weight: bold; + color: #ffffff; + margin-top: 66px; + } + } + + .three { + width: 100%; + height: 470px; + margin-top: 130px; + display: flex; + flex-direction: column; + align-items: center; + + > span { + font-size: 22px; + font-weight: bold; + color: #ffffff; + margin-top: 38px; + } + + > div { + font-size: 16px; + font-weight: bold; + color: #ffffff; + margin-top: 52px; + } + + p { + display: flex; + align-items: center; + margin-top: 10px; + + input { + width: 160px; + height: 40px; + border-radius: 4px; + border: 2px solid #2fffdb; + background-color: transparent; + color: #2fffdb; + } + + .btn { + width: 40px; + height: 40px; + background: #2fffdb; + border-radius: 4px; + border: 2px solid #2fffdb; + color: #10291d; + margin-left: 10px; + line-height: 38px; + text-align: center; + cursor: pointer; + } + } + + > button { + width: 208px; + height: 42px; + border-radius: 4px; + margin-top: 70px; + background: rgba(22, 93, 255, 0.5); + } + + aside { + font-size: 16px; + font-weight: bold; + color: #ffffff; + margin-top: 66px; + } + } + } +} diff --git a/src/pages/Equipment/List/LocalManager/index.tsx b/src/pages/Equipment/List/LocalManager/index.tsx new file mode 100644 index 0000000..3d49fbe --- /dev/null +++ b/src/pages/Equipment/List/LocalManager/index.tsx @@ -0,0 +1,172 @@ +import styles from './index.less'; +import { message, Input, Button, Row, Modal, Form, Tabs } from 'antd'; +import Fetch from '@/utils/fetch'; +import { useEffect, useState, FC, Fragment } from 'react'; +import { + connect, + ConnectProps, + Dispatch, + BasicInfoModelState, + history, +} from 'umi'; +import { cloneDeep } from 'lodash'; + +interface PageProps {} + +const Page: FC = () => { + const [active, setActive] = useState(1); + const [value, setValue] = useState(''); + const [file, setFile] = useState(null); + const [terminalType, setTerminalType] = useState(''); + + const oneClick = async () => { + if (!terminalType) { + message.warn('请选择终端类型'); + return; + } + const res = await Fetch('/openi/localManager/startOpen', { + method: 'post', + data: { + terminalType, + }, + }); + if (res.result === 'success') { + setActive(2); + } + }; + + const twoClick = async () => { + if (!value) { + message.warn('物理标识不能为空'); + return; + } + const res = await Fetch('/openi/localManager/setHostFlag', { + method: 'post', + data: { + hostFlag: value, + }, + }); + if (res.result === 'success') { + setActive(3); + } + }; + + const threeClick = async () => { + if (!file?.name) { + message.warn('初装资源不能为空'); + return; + } + const data: any = new FormData(); + data.append('file', file); + const res = await Fetch('/openi/dataCenter/resourceImport', { + method: 'post', + data, + }); + if (res.result === 'success') { + message.success('操作成功'); + history.replace('/equipment/index'); + } + }; + + const handleFile = () => { + var inputObj = document.createElement('input'); + inputObj.setAttribute('id', '_ef'); + inputObj.setAttribute('type', 'file'); + inputObj.setAttribute('style', 'visibility:hidden'); + document.body.appendChild(inputObj); + inputObj.click(); + inputObj.onchange = (e: any) => { + setFile(e?.target?.files?.[0]); + }; + }; + + const items = [ + { + name: '远程管理终端', + }, + { + name: '本地管理终端', + }, + { + name: '初装设备', + }, + ]; + + const renderOne = () => { + return ( +
+
+ 系统当前状态: + 未开通 +
+ + + + 请选择远程管理终端/ + 本地管理终端/ + 初装设备进行开通操作 + +
+ ); + }; + + const renderTwo = () => { + return ( +
+ 设置宿主机物理标识 +
宿主机标识
+ setValue(e.target.value)} /> + + +
+ ); + }; + + const renderThree = () => { + return ( +
+ 注入初装资源 +
请注入设施密码卡的初装资源
+

+ setValue(e.target.value)} + /> +

+ 注入 +
+

+ + +
+ ); + }; + + return ( +
+
+ {active === 1 && renderOne()} + {active === 2 && renderTwo()} + {active === 3 && renderThree()} +
+
+ ); +}; +export default Page;