diff --git a/src/components/Nav/index.less b/src/components/Nav/index.less new file mode 100644 index 0000000..cbc0801 --- /dev/null +++ b/src/components/Nav/index.less @@ -0,0 +1,24 @@ +.nav { + display: flex; + justify-content: space-between; + width: 1200px; + margin: auto; + padding-bottom: 20px; + + > div { + width: 280px; + height: 260px; + background: #fff; + cursor: pointer; + + b { + font-size: 18px; + text-align: center; + height: 40px; + line-height: 40px; + background: #d9d9d9; + display: inline-block; + width: 100%; + } + } +} diff --git a/src/components/Nav/index.tsx b/src/components/Nav/index.tsx new file mode 100644 index 0000000..7608ef8 --- /dev/null +++ b/src/components/Nav/index.tsx @@ -0,0 +1,189 @@ +import styles from './index.less'; +import { Fragment, useEffect, FC } from 'react'; +import Fetch from '@/utils/fetch'; +import { connect, ConnectProps, Dispatch, history, useLocation } from 'umi'; +import ReactEcharts from 'echarts-for-react'; + +interface PageProps { + dispatch: Dispatch; +} + +const Nav: FC = ({ dispatch }) => { + useEffect(() => { + getData(); + }, []); + + const location: any = useLocation(); + + const getData = async () => {}; + const option1 = { + grid: { + left: '3%', + right: '4%', + bottom: '3%', + top: 20, + containLabel: true, + }, + xAxis: { + type: 'category', + data: ['15', '20', '64', '91', '128', 'ECC2', 'ECC3'], + axisLabel: { + rotate: 45, + }, + }, + yAxis: { + type: 'value', + axisLabel: { + formatter: '{value}M', + }, + }, + series: [ + { + data: [15, 8, 20, 91, 20, 15, 128], + type: 'bar', + }, + ], + }; + + const option2Data = [ + { + value: 335, + name: '已出库', + }, + { + value: 310, + name: '已注册', + }, + { + value: 234, + name: '已入库', + }, + ]; + + const option2 = { + startAngle: 180, + color: ['#5470c6', '#91cc75', '#fac858', 'transparent'], + series: [ + { + name: '', + type: 'pie', + radius: ['45%', '90%'], + avoidLabelOverlap: false, + startAngle: 180, + center: ['50%', '70%'], + label: { + normal: { + position: 'inner', + textStyle: { + color: '#fff', + fontSize: 12, + }, + }, + }, + labelLine: { + normal: { + show: false, + }, + }, + data: option2Data.concat({ + value: + option2Data[0].value + option2Data[1].value + option2Data[2].value, + name: '', + }), + }, + ], + }; + + const option3 = { + grid: { + left: '3%', + right: '4%', + bottom: '3%', + top: 20, + containLabel: true, + }, + xAxis: { + type: 'category', + data: ['等待执行', '执行成功', '执行失败'], + }, + yAxis: { + type: 'value', + }, + series: [ + { + data: [ + { itemStyle: { color: '#fac858' }, value: 15 }, + { itemStyle: { color: '#5470c6' }, value: 5 }, + { itemStyle: { color: '#ee6666' }, value: 34 }, + ], + type: 'bar', + }, + ], + }; + + return ( +
+
{ + history.push('/manager/passwordManager'); + }} + > + + 原始资源管理 + + +
+
{ + history.push('/manager/basicManager/register'); + }} + > + + 装备信息管理 + + +
+
+ 任务管理 + +
+
+ 系统配置管理 +
+ 用户名称:详情 +
+
+ 单位名称:上海科技 +
+
+ 软件版本:1.0.0.0 +
+
+
+ ); +}; +export default connect(({}: {}) => ({}))(Nav); diff --git a/src/pages/Manager/Header/index.tsx b/src/pages/Manager/Header/index.tsx index 3c10cc7..4fbf35b 100644 --- a/src/pages/Manager/Header/index.tsx +++ b/src/pages/Manager/Header/index.tsx @@ -2,6 +2,7 @@ import styles from './index.less'; import { Fragment, useEffect } from 'react'; import { history } from 'umi'; import Fetch from '@/utils/fetch'; +import Nav from '@/components/Nav'; import { message } from 'antd'; const Header = ({ ...props }) => { useEffect(() => { @@ -22,24 +23,34 @@ const Header = ({ ...props }) => { const pathname = props.location.pathname; const menu = [ + { + id: '1', + name: '首页', + url: '', + }, + { + id: '2', + name: '计划管理', + url: '', + }, { id: '/passwordManager', name: '密码管理', url: '/manager/passwordManager', }, + // { + // id: '/basicManager', + // name: '基础设施管理', + // url: '/manager/basicManager/register', + // }, { - id: '/basicManager', - name: '基础设施管理', - url: '/manager/basicManager/register', - }, - { - id: '11', - name: '任务管理', + id: '3', + name: '证书管理', url: '', }, { - id: '22', - name: '系统配置管理', + id: '4', + name: '运维管理', url: '', }, ]; @@ -52,7 +63,7 @@ const Header = ({ ...props }) => {