Browse Source

优化代码

master
Yanko 2 weeks ago
parent
commit
e9a2c574fc
4 changed files with 64 additions and 43 deletions
  1. +7
    -7
      frontend/config/routes.ts
  2. +36
    -36
      frontend/src/app.tsx
  3. +17
    -0
      frontend/src/pages/welcome/index.less
  4. +4
    -0
      frontend/src/pages/welcome/index.tsx

+ 7
- 7
frontend/config/routes.ts View File

@@ -1,8 +1,8 @@
export default [
{ path: '/user', layout: false, routes: [{ path: '/user/login', component: './user/login' }] },
{ path: '/', icon: 'SmileOutlined', component: './welcome', name: '欢迎页', routes: []},
{ path: '/', component: './welcome', name: '首页', routes: []},
{
icon: 'SettingOutlined',
path: '/system',
name: '系统管理',
routes: [
@@ -13,7 +13,7 @@
],
},
{
path: '/deviceModal', icon: 'SettingOutlined', name: '设备模型管理',
path: '/deviceModal', name: '设备模型管理',
routes: [{
name: '设备建模',
path: '/deviceModal/deviceProduct',
@@ -23,7 +23,7 @@
]
},
{
path: '/factory', icon: 'SettingOutlined', name: '工厂数据管理',
path: '/factory', name: '工厂数据管理',
routes: [
{ path: '/factory/process', name: '工序流程', component: './plantModel/process' },
@@ -31,14 +31,14 @@
]
},
{
path: '/production', icon: 'SettingOutlined', name: '生产资料管理', hideInBreadcrumb:false,
path: '/production', name: '生产资料管理', hideInBreadcrumb:false,
routes: [
{ path: '/production/materials', name: '物料管理', component: './materials/index' },
{ path: '/production/godown', name: '料仓管理', component: './stock/index' },
{ path: '/production/final', name: '成品管理', component: './final/index' },
]
},
{ path: '/work',icon: 'SmileOutlined', name: '生产计划管理',
{ path: '/work', name: '生产计划管理',
routes: [
{ path: '/work/workPlan', name: '生产计划', component: './workInfo/plan', },
{ path: '/work/workInfo', name: '工单管理', component: './workInfo/index', },
@@ -68,7 +68,7 @@
// { path: '/report/material', name: '原料统计', component: './report/material' },
// ]
// },
{ path: '/dataV',icon: 'SmileOutlined', name: '自定义报表', target: '_blank',},
{ path: '/dataV', name: '自定义报表', target: '_blank',},
{ path: '*', layout: false, component: './404' },

];


+ 36
- 36
frontend/src/app.tsx View File

@@ -18,7 +18,7 @@ const loopMenuItem = (menus: MenuDataItem[]): MenuDataItem[] => {
return menus?.map(({ icon, routes, ...item }) => (
{
...item,
icon: (icon as string) !='' ? React.createElement((Icon as any)[icon as string]):React.createElement((Icon as any)['SettingOutlined']),
icon: '',
routes: routes && loopMenuItem(routes),
}));
};
@@ -94,44 +94,44 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
content: '黑菠萝科技研发部',
},
token: {
layout: {
bgLayout: '#001529'
},
// colorBgAppListIconHover: '#fff',
// colorTextAppListIconHover: 'rgba(255,255,255,0.95)',
// colorTextAppListIcon: 'rgba(255,255,255,0.85)',
sider: {
// colorBgCollapsedButton: '#0960bd',
// colorTextCollapsedButtonHover: '#fff',
// colorTextCollapsedButton: '#fff',
colorMenuBackground: '#001529',//菜单背景色
//colorBgMenuItemCollapsedHover: '#fff',
colorBgMenuItemCollapsedElevated: '#001529',
colorBgMenuItemCollapsedSelected: '#0960bd',
colorMenuItemDivider: 'rgba(255,255,255,0.15)',
colorBgMenuItemHover: '#0960bd',
colorBgMenuItemSelected: '#0960bd',
colorTextMenuSelected: '#ffffff',
colorTextMenuItemHover: '#fff',
colorTextMenu: '#fff',
colorTextMenuSecondary: '#fff',
colorTextMenuTitle: '#fff',//系统名称
// colorTextMenuActive: '#fff',
colorTextSubMenuSelected: '#fff',
// },
header: {
colorBgHeader: '#ffffff',
colorMenuBackground: '#000',
colorHeaderTitle: '#ffffff',
},
// layout: {
// bgLayout: '#001529'
// },
// // colorBgAppListIconHover: '#fff',
// // colorTextAppListIconHover: 'rgba(255,255,255,0.95)',
// // colorTextAppListIcon: 'rgba(255,255,255,0.85)',
// sider: {
// // colorBgCollapsedButton: '#0960bd',
// // colorTextCollapsedButtonHover: '#fff',
// // colorTextCollapsedButton: '#fff',
// colorMenuBackground: '#001529',//菜单背景色
// //colorBgMenuItemCollapsedHover: '#fff',
// colorBgMenuItemCollapsedElevated: '#001529',
// colorBgMenuItemCollapsedSelected: '#0960bd',
// colorMenuItemDivider: 'rgba(255,255,255,0.15)',
// colorBgMenuItemHover: '#0960bd',
// colorBgMenuItemSelected: '#0960bd',
// colorTextMenuSelected: '#ffffff',
// colorTextMenuItemHover: '#fff',
// colorTextMenu: '#fff',
// colorTextMenuSecondary: '#fff',
// colorTextMenuTitle: '#fff',//系统名称
// // colorTextMenuActive: '#fff',
// colorTextSubMenuSelected: '#fff',
// // },
// header: {
// colorBgHeader: '#ffffff',
// colorMenuBackground: '#000',
// colorHeaderTitle: '#ffffff',
// },
// pageContainer:{
// paddingInlinePageContainerContent: 20,
// paddingBlockPageContainerContent:10
},
pageContainer: {
colorBgPageContainer: '#f5f5f5',
colorBgPageContainerFixed: '#0960bd'
},
// },
// pageContainer: {
// colorBgPageContainer: '#f5f5f5',
// colorBgPageContainerFixed: '#0960bd'
// },
},
footerRender: () => <Footer />,
onPageChange: () => {


+ 17
- 0
frontend/src/pages/welcome/index.less View File

@@ -0,0 +1,17 @@
.marquee {
width:50px;
overflow: hidden;
white-space: nowrap;
box-sizing: border-box;
}
.marquee p {
display: inline-block;
padding-left: 100%;
animation: marquee 10s linear infinite;
}
@keyframes marquee {
0% { transform: translateX(0); }
100% { transform: translateX(-80%); }
}

+ 4
- 0
frontend/src/pages/welcome/index.tsx View File

@@ -1,6 +1,7 @@
import { Card } from 'antd';
import React from 'react';
import dayjs from 'dayjs'
import styles from './index.less';
import { PageContainer } from '@ant-design/pro-components';


@@ -13,6 +14,9 @@ const Welcome: React.FC = () => {
}}
>
你好, 欢迎使用中控管理系统,今天是星期{dayjs().day()}
<div className={styles.marquee}>
<p>- - - - - - - - - </p>
</div>
</Card>
);
};


Loading…
Cancel
Save