修改密码管理页面

dev
陈博文 3 years ago
parent a0130b493d
commit 520eb0750b

@ -65,6 +65,16 @@ export default defineConfig({
},
],
},
{
path: '/passwordManager',
component: '@/pages/PasswordManager/Header',
routes: [
{
path: '/passwordManager/index',
component: '@/pages/PasswordManager/List/Index',
},
],
},
],
},
],

@ -13,7 +13,7 @@ import {
} from 'antd';
import Fetch from '@/utils/fetch';
import { useEffect, useState, FC, useRef } from 'react';
import { Link } from 'umi';
import { Link, history } from 'umi';
import { downLoadLink } from '@/utils/download';
import url from '@/utils/url';
@ -77,6 +77,9 @@ const Page: FC<PageProps> = () => {
downLoadLink(
`${url}/openi/secretKey/encryption?type=${type}&algorithm=${algorithm}&length=${length}&count=${file.length}`,
);
setTimeout(() => {
history.push('/passwordManager/index');
}, 500);
};
console.log(file, 222);

@ -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,45 @@
import styles from './index.less';
import { Fragment, useEffect } from 'react';
import { history } from 'umi';
const Header = ({ ...props }) => {
console.log(props, 'props');
const pathname = props.location.pathname;
const menu = [
{
id: '/passwordManager',
name: '密码管理',
url: '/passwordManager/index',
},
{
id: '/basicManager',
name: '基础设施管理',
url: '/basicManager/index',
},
];
return (
<Fragment>
<div className={styles.head}>
<section>
<i className="iconfont icon-a-dashujushujujiegouguanxiguanxifenxigongtonglianxirenzuzhi1 mr10 font26" />
<span></span>
<ul>
{menu.map((e: any) => (
<li
className={pathname?.includes(e.id) ? styles.active : ''}
key={e.id}
onClick={() => history.push(e.url)}
>
<span>{e.name}</span>
<b />
</li>
))}
</ul>
<div className="font14">V0.4.0.0</div>
</section>
</div>
<div className={styles.content}>{props.children}</div>
</Fragment>
);
};
export default Header;

@ -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;

@ -54,6 +54,12 @@
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe716;</span>
<div class="name">导入数据</div>
<div class="code-name">&amp;#xe716;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe66c;</span>
<div class="name">未通过</div>
@ -180,12 +186,6 @@
<div class="code-name">&amp;#xe714;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6ff;</span>
<div class="name">导入资源文件</div>
<div class="code-name">&amp;#xe6ff;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe700;</span>
<div class="name">收起</div>
@ -342,12 +342,12 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.eot?t=1660292237437'); /* IE9 */
src: url('iconfont.eot?t=1660292237437#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660292237437') format('woff2'),
url('iconfont.woff?t=1660292237437') format('woff'),
url('iconfont.ttf?t=1660292237437') format('truetype'),
url('iconfont.svg?t=1660292237437#iconfont') format('svg');
src: url('iconfont.eot?t=1660555520778'); /* IE9 */
src: url('iconfont.eot?t=1660555520778#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660555520778') format('woff2'),
url('iconfont.woff?t=1660555520778') format('woff'),
url('iconfont.ttf?t=1660555520778') format('truetype'),
url('iconfont.svg?t=1660555520778#iconfont') format('svg');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -373,6 +373,15 @@
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-daorushuju2"></span>
<div class="name">
导入数据
</div>
<div class="code-name">.icon-daorushuju2
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-weitongguo"></span>
<div class="name">
@ -562,15 +571,6 @@
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-daoruziyuanwenjian"></span>
<div class="name">
导入资源文件
</div>
<div class="code-name">.icon-daoruziyuanwenjian
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-shouqi"></span>
<div class="name">
@ -805,6 +805,14 @@
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-daorushuju2"></use>
</svg>
<div class="name">导入数据</div>
<div class="code-name">#icon-daorushuju2</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-weitongguo"></use>
@ -973,14 +981,6 @@
<div class="code-name">#icon-suanfaluojiziyuan</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-daoruziyuanwenjian"></use>
</svg>
<div class="name">导入资源文件</div>
<div class="code-name">#icon-daoruziyuanwenjian</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-shouqi"></use>

@ -1,11 +1,11 @@
@font-face {
font-family: "iconfont"; /* Project id 3579477 */
src: url('iconfont.eot?t=1660292237437'); /* IE9 */
src: url('iconfont.eot?t=1660292237437#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660292237437') format('woff2'),
url('iconfont.woff?t=1660292237437') format('woff'),
url('iconfont.ttf?t=1660292237437') format('truetype'),
url('iconfont.svg?t=1660292237437#iconfont') format('svg');
src: url('iconfont.eot?t=1660555520778'); /* IE9 */
src: url('iconfont.eot?t=1660555520778#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660555520778') format('woff2'),
url('iconfont.woff?t=1660555520778') format('woff'),
url('iconfont.ttf?t=1660555520778') format('truetype'),
url('iconfont.svg?t=1660555520778#iconfont') format('svg');
}
.iconfont {
@ -16,6 +16,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-daorushuju2:before {
content: "\e716";
}
.icon-weitongguo:before {
content: "\e66c";
}
@ -100,10 +104,6 @@
content: "\e714";
}
.icon-daoruziyuanwenjian:before {
content: "\e6ff";
}
.icon-shouqi:before {
content: "\e700";
}

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "31258224",
"name": "导入数据",
"font_class": "daorushuju2",
"unicode": "e716",
"unicode_decimal": 59158
},
{
"icon_id": "31225732",
"name": "未通过",
@ -152,13 +159,6 @@
"unicode": "e714",
"unicode_decimal": 59156
},
{
"icon_id": "31169140",
"name": "导入资源文件",
"font_class": "daoruziyuanwenjian",
"unicode": "e6ff",
"unicode_decimal": 59135
},
{
"icon_id": "31169141",
"name": "收起",

@ -14,6 +14,8 @@
/>
<missing-glyph />
<glyph glyph-name="daorushuju2" unicode="&#59158;" d="M526.848-54.784H102.4c-14.848 0-29.184 14.848-29.184 36.352V808.448c0 22.016 14.848 36.352 29.184 36.352h834.048c14.848 0 29.184-14.848 29.184-36.352v-467.968c0-14.848-14.848-29.184-29.184-29.184s-29.184 14.848-29.184 36.352V778.752H131.584v-768h394.752c14.848 0 29.184-14.848 29.184-36.352 0.512-14.848-7.168-29.184-28.672-29.184zM680.448-47.616c-7.168 0-14.848 7.168-22.016 7.168l-131.584 153.6c-14.848 14.848-14.848 36.352 0 51.2l131.584 153.6c14.848 14.848 29.184 14.848 44.032 0 14.848-14.848 14.848-36.352 0-51.2l-109.568-124.416 109.568-124.416c14.848-14.848 14.848-36.352 0-51.2-0.512-7.168-7.68-14.336-22.016-14.336zM936.448 105.984h-256c-14.848 0-29.184 14.848-29.184 36.352 0 22.016 14.848 36.352 29.184 36.352h256c14.848 0 29.184-14.848 29.184-36.352 0-21.504-14.848-36.352-29.184-36.352zM745.984 588.8H300.032c-22.016 0-36.352 14.848-36.352 29.184s14.848 29.184 29.184 29.184h445.952c14.848 0 29.184-14.848 29.184-29.184s-7.168-29.184-22.016-29.184z m0-189.952H300.032c-14.848 0-22.016 7.168-29.184 14.848-7.168 7.168-7.168 22.016 0 29.184 7.168 14.848 14.848 14.848 29.184 14.848h445.952c14.848 0 29.184-14.848 29.184-29.184 0-15.36-14.336-29.696-29.184-29.696z" horiz-adv-x="1024" />
<glyph glyph-name="weitongguo" unicode="&#58988;" d="M721.92 552.96l-153.6-153.6 153.6-153.6-56.32-56.32-153.6 153.6-153.6-153.6-56.32 56.32 153.6 153.6-153.6 153.6 56.32 51.2 153.6-153.6 153.6 153.6 56.32-51.2zM512-128C230.4-128 0 102.4 0 384S230.4 896 512 896s512-230.4 512-512-230.4-512-512-512z m0 947.2c-240.64 0-435.2-194.56-435.2-435.2s194.56-435.2 435.2-435.2 435.2 194.56 435.2 435.2-194.56 435.2-435.2 435.2z" horiz-adv-x="1024" />
<glyph glyph-name="jingxiang" unicode="&#59879;" d="M544-57.6L57.6 172.8V384h76.8v-160l409.6-198.4 409.6 198.4V384h76.8v-211.2zM544 537.6L140.8 710.4 544 864l403.2-153.6-403.2-172.8zM307.2 704l236.8-96L780.8 704 544 793.6 307.2 704zM524.8 76.8L160 249.6V665.6l364.8-147.2v-441.6zM224 288l236.8-108.8V473.6L224 569.6v-281.6zM288 486.4m-64 0a64 64 0 1 1 128 0 64 64 0 1 1-128 0ZM288 307.2m-64 0a64 64 0 1 1 128 0 64 64 0 1 1-128 0ZM181.056 398.208l24.704 59.072 289.28-121.024-24.704-59.072zM569.6 307.2V518.4l352 147.2v-204.8L569.6 307.2z m64 166.4v-70.4l224 102.4v64L633.6 473.6zM569.6 83.2v192l352 153.6v-185.6l-352-160z m64 147.2v-51.2l224 108.8v44.8l-224-102.4z" horiz-adv-x="1088" />
@ -56,8 +58,6 @@
<glyph glyph-name="suanfaluojiziyuan" unicode="&#59156;" d="M665.6 684.8c-6.4 0-12.8-6.4-12.8-12.8V640H448c-19.2 0-38.4-19.2-38.4-38.4v-179.2H339.2c-12.8 25.6-38.4 38.4-70.4 38.4C230.4 460.8 192 428.8 192 384s38.4-76.8 76.8-76.8c32 0 57.6 19.2 70.4 38.4h70.4v-179.2c0-19.2 19.2-38.4 38.4-38.4h204.8v-44.8c6.4-6.4 12.8-6.4 19.2-6.4l121.6 76.8s6.4 0 6.4 6.4c6.4 6.4 0 12.8-6.4 19.2L672 256h-6.4c-6.4 0-12.8-6.4-12.8-12.8v-32H486.4V563.2h166.4v-44.8c6.4-6.4 12.8-6.4 19.2-6.4l121.6 76.8s6.4 0 6.4 6.4c6.4 6.4 0 12.8-6.4 19.2l-121.6 76.8c0-6.4 0-6.4-6.4-6.4zM761.6 896H0v-1024h1024V684.8L761.6 896z m166.4-928h-832v832h633.6L928 640v-672z" horiz-adv-x="1024" />
<glyph glyph-name="daoruziyuanwenjian" unicode="&#59135;" d="M5.626374 896h1024v-1024H5.626374zM532.254945-54.857143H108.026374c-14.628571 0-29.257143 14.628571-29.257143 36.571429V808.228571C78.769231 830.171429 93.397802 844.8 108.026374 844.8h833.828571c14.628571 0 29.257143-14.628571 29.257143-36.571429v-468.114285c0-14.628571-14.628571-29.257143-29.257143-29.257143s-29.257143 14.628571-29.257143 36.571428V778.971429H137.283516v-768h394.971429c14.628571 0 29.257143-14.628571 29.257143-36.571429 0-14.628571-7.314286-29.257143-29.257143-29.257143zM685.854945-47.542857c-7.314286 0-14.628571 7.314286-21.942857 7.314286l-131.657143 153.6c-14.628571 14.628571-14.628571 36.571429 0 51.2L663.912088 318.171429c14.628571 14.628571 29.257143 14.628571 43.885714 0 14.628571-14.628571 14.628571-36.571429 0-51.2l-109.714286-124.342858L707.797802 18.285714c14.628571-14.628571 14.628571-36.571429 0-51.2 0-7.314286-7.314286-14.628571-21.942857-14.628571zM941.854945 106.057143H685.854945c-14.628571 0-29.257143 14.628571-29.257143 36.571428s14.628571 36.571429 29.257143 36.571429h256c14.628571 0 29.257143-14.628571 29.257143-36.571429s-14.628571-36.571429-29.257143-36.571428zM751.683516 588.8H305.512088c-21.942857 0-36.571429 14.628571-36.571429 29.257143s14.628571 29.257143 29.257143 29.257143h446.171429c14.628571 0 29.257143-14.628571 29.257143-29.257143s-7.314286-29.257143-21.942858-29.257143z m0-190.171429H305.512088c-14.628571 0-21.942857 7.314286-29.257143 14.628572-7.314286 7.314286-7.314286 21.942857 0 29.257143 7.314286 14.628571 14.628571 14.628571 29.257143 14.628571h446.171428c14.628571 0 29.257143-14.628571 29.257143-29.257143s-14.628571-29.257143-29.257143-29.257143z" horiz-adv-x="1102" />
<glyph glyph-name="shouqi" unicode="&#59136;" d="M34.129408-89.316022A119.45293 119.45293 0 0 1 127.473341-127.882254l1276.439876 9.726882a119.45293 119.45293 0 0 1 93.514579 38.566231 153.582338 153.582338 0 0 1 0 202.899334L859.378505 847.706887c-8.532352 9.726881-25.597056 19.283116-34.129409 29.009997l-8.532352 9.556235a121.330047 121.330047 0 0 1-136.005692-29.009998L42.491114 123.48084A167.234101 167.234101 0 0 1 34.129408-89.316022z" horiz-adv-x="1535" />
<glyph glyph-name="guanbi" unicode="&#59139;" d="M59.026286-122.002286a58.075429 58.075429 0 0 0-40.96 99.035429L919.698286 878.665143a58.075429 58.075429 0 0 0 81.92-81.993143L100.059429-104.96a57.782857 57.782857 0 0 0-40.96-17.042286zM960.731429-122.002286a57.782857 57.782857 0 0 0-40.96 17.042286L17.993143 796.745143A58.075429 58.075429 0 0 0 99.986286 878.665143l901.778285-901.705143a58.075429 58.075429 0 0 0-40.96-98.962286z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save