From 842a2172345b97b03008b1271f13f8cda1fcdaa6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E5=8D=9A=E6=96=87?= <1179111926@qq.com>
Date: Fri, 12 Aug 2022 18:22:55 +0800
Subject: [PATCH] =?UTF-8?q?3=E4=B8=AA=E5=BC=80=E9=80=9A=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.umirc.ts | 5 +
.../List/Certificate/Step1/index.less | 29 ---
.../List/Certificate/Step1/index.tsx | 182 ---------------
.../List/Certificate/Step2/index.less | 51 -----
.../List/Certificate/Step2/index.tsx | 169 --------------
.../List/Certificate/Step3/index.less | 48 ----
.../List/Certificate/Step3/index.tsx | 141 ------------
.../List/Certificate/Step4/index.less | 71 ------
.../List/Certificate/Step4/index.tsx | 106 ---------
.../Equipment/List/Certificate/index.less | 4 -
.../Equipment/List/Certificate/index.tsx | 18 --
src/pages/Equipment/List/DataCenter/index.tsx | 9 +-
.../Equipment/List/LocalManager/img/bg.png | Bin 0 -> 10391341 bytes
.../Equipment/List/LocalManager/img/c.png | Bin 0 -> 723490 bytes
.../Equipment/List/LocalManager/index.less | 211 ++++++++++++++++++
.../Equipment/List/LocalManager/index.tsx | 172 ++++++++++++++
16 files changed, 395 insertions(+), 821 deletions(-)
delete mode 100644 src/pages/Equipment/List/Certificate/Step1/index.less
delete mode 100644 src/pages/Equipment/List/Certificate/Step1/index.tsx
delete mode 100644 src/pages/Equipment/List/Certificate/Step2/index.less
delete mode 100644 src/pages/Equipment/List/Certificate/Step2/index.tsx
delete mode 100644 src/pages/Equipment/List/Certificate/Step3/index.less
delete mode 100644 src/pages/Equipment/List/Certificate/Step3/index.tsx
delete mode 100644 src/pages/Equipment/List/Certificate/Step4/index.less
delete mode 100644 src/pages/Equipment/List/Certificate/Step4/index.tsx
delete mode 100644 src/pages/Equipment/List/Certificate/index.less
delete mode 100644 src/pages/Equipment/List/Certificate/index.tsx
create mode 100644 src/pages/Equipment/List/LocalManager/img/bg.png
create mode 100644 src/pages/Equipment/List/LocalManager/img/c.png
create mode 100644 src/pages/Equipment/List/LocalManager/index.less
create mode 100644 src/pages/Equipment/List/LocalManager/index.tsx
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 (
-
- );
-};
-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 (
-
- );
-};
-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 = () => {
注入
-