修改issue

dev
陈博文 3 years ago
parent df7f97406c
commit d331ae58a4

@ -4,7 +4,7 @@ let publicPath = process.env.NODE_ENV === 'development' ? '/' : '/react/build/';
export default defineConfig({
publicPath,
title: '设施管理设备',
title: '管理基础设施',
nodeModulesTransform: {
type: 'none',
},

@ -1,5 +1,5 @@
import styles from './index.less';
import { Fragment } from 'react';
import { Fragment, useEffect } from 'react';
const Header = ({ ...props }) => {
return (

@ -1,5 +1,5 @@
import styles from './index.less';
import { Input, Button, Row, Form } from 'antd';
import { Input, Button, Row, Form, InputNumber } from 'antd';
import { FC } from 'react';
import { connect, Dispatch, BasicInfoModelState } from 'umi';
@ -114,29 +114,35 @@ const Page: FC<PageProps> = ({ basic, dispatch }) => {
<div className={styles.title}>
<b /> <span>CRL</span>
</div>
<Form.Item
label="CRL发布点中的证书数量"
name="certNum"
rules={[
{
required: true,
message: `请输入CRL发布点中的证书数量`,
},
]}
>
<Input />
<Form.Item label="CRL发布点中的证书数量">
<Form.Item
noStyle
name="certNum"
rules={[
{
required: true,
message: `请输入CRL发布点中的证书数量`,
},
]}
>
<InputNumber min={0} precision={0} />
</Form.Item>
<span className="ant-form-text"> 500</span>
</Form.Item>
<Form.Item
label="CRL发布周期"
name="certCycle"
rules={[
{
required: true,
message: `请输入CRL发布周期`,
},
]}
>
<Input />
<Form.Item label="CRL发布周期">
<Form.Item
noStyle
name="certCycle"
rules={[
{
required: true,
message: `请输入CRL发布周期`,
},
]}
>
<InputNumber min={0} precision={0} />
</Form.Item>
<span className="ant-form-text"></span>
</Form.Item>
</Form>
<Row justify="end">

@ -53,12 +53,12 @@ const Page: FC<PageProps> = ({ basic, dispatch }) => {
document.body.appendChild(inputObj);
inputObj.click();
inputObj.onchange = (e: any) => {
console.log(e, 444);
dispatch({
type: 'basic/setActionData',
payload: {
[type]: {
file: e?.target?.files?.[0],
path: inputObj.value,
},
},
});
@ -246,7 +246,7 @@ const Page: FC<PageProps> = ({ basic, dispatch }) => {
<span>64</span>
<Input
readOnly
value={file1?.name}
value={file1?.name || file1?.path}
size="large"
style={{ width: 255, margin: '20px 10px' }}
/>
@ -265,7 +265,7 @@ const Page: FC<PageProps> = ({ basic, dispatch }) => {
<span>32</span>
<Input
readOnly
value={file2?.name}
value={file2?.name || file2?.path}
size="large"
style={{ width: 255, margin: '20px 10px' }}
/>
@ -286,7 +286,7 @@ const Page: FC<PageProps> = ({ basic, dispatch }) => {
<span>20</span>
<Input
readOnly
value={file3?.name}
value={file3?.name || file3?.path}
size="large"
style={{ width: 255, margin: '20px 10px' }}
/>
@ -305,7 +305,7 @@ const Page: FC<PageProps> = ({ basic, dispatch }) => {
<span>16</span>
<Input
readOnly
value={file4?.name}
value={file4?.name || file4?.path}
size="large"
style={{ width: 255, margin: '20px 10px' }}
/>

@ -38,6 +38,7 @@ const Page: FC<PageProps> = ({ basic, dispatch }) => {
const getData = async () => {
const res = await Fetch('/openi/resource/getResourceStatus');
if (res.result === 'success') {
document.title = '设施管理设备';
if (res?.data?.[0]?.resource && res?.data?.[0]?.cert) {
message.warn('当前设备已开通,已为你跳转至管理设备界面!');
history.replace('/equipment');

@ -22,7 +22,7 @@ interface PageProps {}
const Page: FC<PageProps> = () => {
const [type, setType] = useState<string>('1');
const [algorithm, setAlgorithm] = useState<string>('0');
const [length, setLength] = useState<any>(null);
const [length, setLength] = useState<any>('2');
const [file, setFile] = useState<any>([]);
const item: any = [
@ -70,16 +70,13 @@ const Page: FC<PageProps> = () => {
message.warn('请选择导入文件');
return;
}
if (!length) {
message.warn('请输入密钥长度');
return;
}
// if (type !== '2' && !length) {
// message.warn('请输入密钥长度');
// return;
// }
downLoadLink(
`${url}/openi/secretKey/encryption?type=${type}&algorithm=${algorithm}&length=${length}&count=${file.length}`,
);
setTimeout(() => {
history.push('/manager/passwordManager');
}, 500);
};
const renderText = () => {
@ -101,6 +98,8 @@ const Page: FC<PageProps> = () => {
className={type === e.key ? styles.active : ''}
onClick={() => {
setType(e.key);
setLength('2');
setFile([]);
if (e.key === '2') {
setAlgorithm('1');
} else {
@ -147,15 +146,24 @@ const Page: FC<PageProps> = () => {
</Select>
</div>
)}
<div>
<sup>*</sup>
<span></span>
<InputNumber
value={length}
onChange={(k) => setLength(k)}
style={{ width: 400 }}
/>
</div>
{type !== '2' && (
<div>
<sup>*</sup>
<span></span>
<Select
value={length}
onChange={(k) => setLength(k)}
style={{ width: 400 }}
>
<Select.Option key={'2'}>2</Select.Option>
<Select.Option key={'4'}>4</Select.Option>
<Select.Option key={'8'}>8</Select.Option>
<Select.Option key={'16'}>16</Select.Option>
<Select.Option key={'32'}>32</Select.Option>
</Select>
</div>
)}
</aside>
</div>
<div className={styles.annotation}>

@ -27,6 +27,7 @@ const Header = ({ ...props }) => {
//判断否跳转
const res = await Fetch('/openi/resource/getResourceStatus');
if (res.result === 'success') {
document.title = '设施管理设备';
if (!(res?.data?.[0]?.resource && res?.data?.[0]?.cert)) {
message.warn('当前设备未开通,已为你跳转至开通界面!');
history.replace('/basic');

@ -26,6 +26,7 @@ const Page: FC<PageProps> = () => {
const getData = async () => {
const res = await Fetch('/openi/dataCenter/isOpen');
if (res.result === 'success') {
document.title = '数据中心开通';
if (res?.data?.[0]) {
setDisable(true);
return;

@ -26,6 +26,7 @@ const Page: FC<PageProps> = () => {
const getData = async () => {
const res = await Fetch('/openi/localManager/isOpen');
if (res.result === 'success') {
document.title = '管理基础设施';
if (res?.data?.[0]) {
message.warn('当前本地管理终端已开通,已为你跳转至管理基础设施界面!');
history.replace('/manager/passwordManager');
@ -122,7 +123,7 @@ const Page: FC<PageProps> = () => {
<span></span>
<ul>
{items.map((e: any) => (
<li onClick={() => setTerminalType(e.name)}>
<li key={e.name} onClick={() => setTerminalType(e.name)}>
<b className={terminalType === e.name ? styles.a : ''} />
<span>{e.name}</span>
</li>

@ -412,7 +412,10 @@ const Page: FC<PageProps> = () => {
},
]}
>
<Input />
<Select>
<Select.Option key="节点一">{'节点一'}</Select.Option>
<Select.Option key="节点二">{'节点二'}</Select.Option>
</Select>
</Form.Item>
</Col>
<Col span={12}>

@ -11,6 +11,7 @@ const Header = ({ ...props }) => {
const getData = async () => {
const res = await Fetch('/openi/localManager/isOpen');
if (res.result === 'success') {
document.title = '管理基础设施';
if (!res?.data?.[0]) {
message.warn('当前本地管理终端未开通,已为你跳转至终端界面!');
history.replace('/terminal');

@ -23,7 +23,7 @@ interface PageProps {}
const Page: FC<PageProps> = () => {
const [type, setType] = useState<string>('1');
const [algorithm, setAlgorithm] = useState<string>('0');
const [length, setLength] = useState<string>('16');
const [length, setLength] = useState<string>('2');
const [pushNode, setPushNode] = useState<string>('节点一');
const [count, setCount] = useState<number>(1000);
const [data, setData] = useState<any>([]);
@ -82,19 +82,32 @@ const Page: FC<PageProps> = () => {
inputObj.onchange = async (e: any) => {
const data: any = new FormData();
data.append('file', e?.target?.files?.[0]);
const res = await Fetch('/openi/secretKey/resourceImport', {
const res = await Fetch(`/openi/secretKey/resourceImport/${type}`, {
method: 'post',
data,
});
if (res.result === 'success') {
message.success('导入成功');
getData();
} else {
message.error(res.errorMsg);
}
};
};
const title = item.find((e: any) => e.key === type).name;
const items = [
{
key: '1',
name: 'ECC359',
},
{
key: '2',
name: 'ECC281',
},
];
const option = {
tooltip: {
trigger: 'axis',
@ -115,7 +128,12 @@ const Page: FC<PageProps> = () => {
},
yAxis: {
type: 'category',
data: data?.map((e: any) => e.length),
data: data?.map((e: any) => {
if (type !== '2') {
return e.length;
}
return items.find((k: any) => k.key === e.algorithm)?.name;
}),
},
series: [
{
@ -142,6 +160,10 @@ const Page: FC<PageProps> = () => {
algorithm,
},
});
if (res.errorCode === 500) {
message.warn(res.errorMsg);
return;
}
if (res.result === 'success') {
message.success('推出成功');
getData();
@ -204,11 +226,11 @@ const Page: FC<PageProps> = () => {
value={length}
onChange={(k) => setLength(k)}
>
<Select.Option key="16">{'16'}</Select.Option>
<Select.Option key="20">{'20'}</Select.Option>
<Select.Option key="32">{'32'}</Select.Option>
<Select.Option key="64">{'64'}</Select.Option>
<Select.Option key="128">{'128'}</Select.Option>
<Select.Option key={'2'}>2</Select.Option>
<Select.Option key={'4'}>4</Select.Option>
<Select.Option key={'8'}>8</Select.Option>
<Select.Option key={'16'}>16</Select.Option>
<Select.Option key={'32'}>32</Select.Option>
</Select>
</Row>
<Row align="middle" className={mr}>
@ -230,8 +252,9 @@ const Page: FC<PageProps> = () => {
onChange={(k) => setAlgorithm(k)}
style={{ width: 100 }}
>
<Select.Option key="1">{'ECC359'}</Select.Option>
<Select.Option key="2">{'ECC281'}</Select.Option>
{items.map((e: any) => (
<Select.Option key={e.key}>{e.name}</Select.Option>
))}
</Select>
</Row>
)}

@ -141,6 +141,10 @@ const Page = () => {
console.log(data, 'data');
useEffect(() => {
document.title = '初装系统';
}, []);
useEffect(() => {
window.addEventListener('message', getData, false);
return () => {

Loading…
Cancel
Save