parent
a0130b493d
commit
520eb0750b
@ -0,0 +1,66 @@
|
|||||||
|
.head {
|
||||||
|
height: 60px;
|
||||||
|
background: #001628;
|
||||||
|
|
||||||
|
> section {
|
||||||
|
margin: 0 auto;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 18px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #fff;
|
||||||
|
width: 1200px;
|
||||||
|
|
||||||
|
> span {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #ffffff;
|
||||||
|
line-height: 18px;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
> ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: #28b1ff;
|
||||||
|
|
||||||
|
b {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
list-style: none;
|
||||||
|
margin-left: 100px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
position: relative;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
b {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
bottom: -9px;
|
||||||
|
width: 40px;
|
||||||
|
height: 2px;
|
||||||
|
background: #28b1ff;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
height: calc(100vh - 60px);
|
||||||
|
background-color: #fafafa;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
.page {
|
||||||
|
width: 1200px;
|
||||||
|
margin: 22px auto;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 146px;
|
||||||
|
height: 334px;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding-top: 18px;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
height: 44px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #464f66;
|
||||||
|
padding: 20px 0;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
b {
|
||||||
|
display: inline-block;
|
||||||
|
width: 3px;
|
||||||
|
height: 16px;
|
||||||
|
background: @primary-color;
|
||||||
|
margin-right: 17px;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
padding-right: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: @primary-color;
|
||||||
|
|
||||||
|
b {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
width: 1034px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
height: 36px;
|
||||||
|
background: #e3effc;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #464f66;
|
||||||
|
|
||||||
|
i {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
height: 500px;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
height: 58px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,173 @@
|
|||||||
|
import styles from './index.less';
|
||||||
|
import {
|
||||||
|
InputNumber,
|
||||||
|
Input,
|
||||||
|
Button,
|
||||||
|
Select,
|
||||||
|
Row,
|
||||||
|
Modal,
|
||||||
|
Form,
|
||||||
|
message,
|
||||||
|
Empty,
|
||||||
|
Spin,
|
||||||
|
} from 'antd';
|
||||||
|
import Fetch from '@/utils/fetch';
|
||||||
|
import { useEffect, useState, FC, useRef } from 'react';
|
||||||
|
import { Link } from 'umi';
|
||||||
|
import { downLoadLink } from '@/utils/download';
|
||||||
|
import url from '@/utils/url';
|
||||||
|
|
||||||
|
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 [pushNode, setPushNode] = useState<string>('节点一');
|
||||||
|
const [count, setCount] = useState<number>(1000);
|
||||||
|
const [data, setData] = useState<any>([]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, [type]);
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const res = await Fetch('/openi/secretKey/statistics', {
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
type,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (res.result === 'success') {
|
||||||
|
setData(res?.data?.[0]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const item: any = [
|
||||||
|
{
|
||||||
|
icon: 'iconfont icon-yuzhimiyuejiami',
|
||||||
|
name: '预制资源',
|
||||||
|
key: '1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'iconfont icon-gongsiyueduiziyuan',
|
||||||
|
name: '公私钥对资源',
|
||||||
|
key: '2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'iconfont icon-suanfacanshuziyuan',
|
||||||
|
name: '算法参数资源',
|
||||||
|
key: '3',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'iconfont icon-suanfaluojiziyuan',
|
||||||
|
name: '算法逻辑资源',
|
||||||
|
key: '4',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'iconfont icon-ruanjianziyuan',
|
||||||
|
name: '软件资源',
|
||||||
|
key: '5',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
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 = async (e: any) => {
|
||||||
|
const data: any = new FormData();
|
||||||
|
data.append('file', e?.target?.files?.[0]);
|
||||||
|
const res = await Fetch('/openi/secretKey/resourceImport', {
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
if (res.result === 'success') {
|
||||||
|
message.success('导入成功');
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const title = item.find((e: any) => e.key === type).name;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.page}>
|
||||||
|
<div className={styles.left}>
|
||||||
|
{item.map((e: any) => (
|
||||||
|
<div
|
||||||
|
key={e.key}
|
||||||
|
className={type === e.key ? styles.active : ''}
|
||||||
|
onClick={() => {
|
||||||
|
setType(e.key);
|
||||||
|
if (e.key === '2') {
|
||||||
|
setAlgorithm('1');
|
||||||
|
} else {
|
||||||
|
setAlgorithm('0');
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<b />
|
||||||
|
<i className={e.icon} />
|
||||||
|
{e.name}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className={styles.right}>
|
||||||
|
<div className={styles.title}>
|
||||||
|
<span>{title}资源列表 </span>
|
||||||
|
<i className="iconfont icon-a-shuaxin2" />
|
||||||
|
</div>
|
||||||
|
<div className={styles.box}></div>
|
||||||
|
<div className={styles.btn}>
|
||||||
|
<Button
|
||||||
|
onClick={handleFile}
|
||||||
|
className="mr30"
|
||||||
|
icon={<i className="iconfont icon-daorushuju2 mr5" />}
|
||||||
|
>
|
||||||
|
导入资源文件
|
||||||
|
</Button>
|
||||||
|
<Row align="middle" className="mr30">
|
||||||
|
<span className="mr10">密码长度</span>
|
||||||
|
<Select
|
||||||
|
style={{ width: 96 }}
|
||||||
|
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>
|
||||||
|
</Row>
|
||||||
|
<Row align="middle" className="mr30">
|
||||||
|
<span className="mr10">推送节点</span>
|
||||||
|
<Select
|
||||||
|
style={{ width: 160 }}
|
||||||
|
value={pushNode}
|
||||||
|
onChange={(k) => setPushNode(k)}
|
||||||
|
>
|
||||||
|
<Select.Option key="节点一">{'节点一'}</Select.Option>
|
||||||
|
<Select.Option key="节点二">{'节点二'}</Select.Option>
|
||||||
|
</Select>
|
||||||
|
</Row>
|
||||||
|
<Row align="middle" className="mr30">
|
||||||
|
<span className="mr10">推送组数</span>
|
||||||
|
<InputNumber
|
||||||
|
precision={0}
|
||||||
|
value={count}
|
||||||
|
style={{ width: 218 }}
|
||||||
|
onChange={(k) => setCount(k)}
|
||||||
|
/>
|
||||||
|
</Row>
|
||||||
|
<Button type="primary">推送</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default Page;
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 36 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue