基础设施管理完成

dev
陈博文 3 years ago
parent 214f93d0ad
commit 201ad07cd0

@ -66,12 +66,22 @@ export default defineConfig({
],
},
{
path: '/passwordManager',
component: '@/pages/PasswordManager/Header',
path: '/manager',
component: '@/pages/Manager/Header',
routes: [
{
path: '/passwordManager/index',
component: '@/pages/PasswordManager/List/Index',
path: '/manager/passwordManager',
component: '@/pages/Manager/PasswordManager',
},
{
path: '/manager/basicManager',
component: '@/pages/Manager/BasicManager',
routes: [
{
path: '/manager/basicManager/manufacturer',
component: '@/pages/Manager/BasicManager/List/Manufacturer',
},
],
},
],
},

@ -78,7 +78,7 @@ const Page: FC<PageProps> = () => {
`${url}/openi/secretKey/encryption?type=${type}&algorithm=${algorithm}&length=${length}&count=${file.length}`,
);
setTimeout(() => {
history.push('/passwordManager/index');
history.push('/manager/passwordManager');
}, 500);
};

@ -0,0 +1,29 @@
.page {
.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;
margin-top: 20px;
}
.btn {
border-top: 1px solid #ebf3ff;
height: 58px;
display: flex;
align-items: center;
padding: 0 20px;
}
}

@ -0,0 +1,49 @@
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';
import ReactEcharts from 'echarts-for-react';
interface PageProps {}
const Page: FC<PageProps> = () => {
const [data, setData] = useState<any>([]);
useEffect(() => {
getData();
}, []);
const getData = async () => {
const res = await Fetch('/openi/secretKey/statistics', {
method: 'get',
params: {},
});
if (res.result === 'success') {
setData(res?.data?.[0]);
}
};
return (
<div className={styles.page}>
<div className={styles.title}>
<span> </span>
<i onClick={() => getData()} className="iconfont icon-a-shuaxin2" />
</div>
</div>
);
};
export default Page;

@ -0,0 +1,61 @@
.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;
}
}

@ -0,0 +1,49 @@
import styles from './index.less';
import { history } from 'umi';
const Page = ({ ...props }) => {
const pathname = props.location.pathname;
const item: any = [
{
icon: 'iconfont icon-zhucedengji',
name: '注册登记',
key: '/register',
},
{
icon: 'iconfont icon-peifaguanli',
name: '型号管理',
key: '/model',
},
{
icon: 'iconfont icon-suanfacanshuziyuan',
name: '配发管理',
key: '/allotment',
},
{
icon: 'iconfont icon-changshangxinxiguanli',
name: '厂商信息管理',
key: '/manufacturer',
},
];
return (
<div className={styles.page}>
<div className={styles.left}>
{item.map((e: any) => (
<div
key={e.key}
className={pathname?.includes(e.key) ? styles.active : ''}
onClick={() => history.push(e.key)}
>
<b />
<i className={e.icon} />
{e.name}
</div>
))}
</div>
<div className={styles.right}>{props.children}</div>
</div>
);
};
export default Page;

@ -41,7 +41,7 @@
font-weight: 600;
color: #fff;
position: relative;
cursor: default;
cursor: pointer;
}
b {

@ -3,18 +3,17 @@ 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',
url: '/manager/passwordManager',
},
{
id: '/basicManager',
name: '基础设施管理',
url: '/basicManager/index',
url: '/manager/basicManager/manufacturer',
},
];
return (

@ -174,8 +174,8 @@ const Page: FC<PageProps> = () => {
</div>
<div className={styles.right}>
<div className={styles.title}>
<span>{title} </span>
<i className="iconfont icon-a-shuaxin2" />
<span>{title} </span>
<i onClick={() => getData()} className="iconfont icon-a-shuaxin2" />
</div>
<div className={styles.box}>
<ReactEcharts
Loading…
Cancel
Save