From e9a2c574fcd2ba8195d175f250564a26e44ec61f Mon Sep 17 00:00:00 2001 From: Yanko <747575620@qq.com> Date: Tue, 10 Dec 2024 10:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/config/routes.ts | 14 +++--- frontend/src/app.tsx | 72 +++++++++++++-------------- frontend/src/pages/welcome/index.less | 17 +++++++ frontend/src/pages/welcome/index.tsx | 4 ++ 4 files changed, 64 insertions(+), 43 deletions(-) create mode 100644 frontend/src/pages/welcome/index.less diff --git a/frontend/config/routes.ts b/frontend/config/routes.ts index 5557a39..9b997a3 100644 --- a/frontend/config/routes.ts +++ b/frontend/config/routes.ts @@ -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' }, ]; diff --git a/frontend/src/app.tsx b/frontend/src/app.tsx index 447314f..9272e3a 100644 --- a/frontend/src/app.tsx +++ b/frontend/src/app.tsx @@ -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: () => , onPageChange: () => { diff --git a/frontend/src/pages/welcome/index.less b/frontend/src/pages/welcome/index.less new file mode 100644 index 0000000..627fe4f --- /dev/null +++ b/frontend/src/pages/welcome/index.less @@ -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%); } + } \ No newline at end of file diff --git a/frontend/src/pages/welcome/index.tsx b/frontend/src/pages/welcome/index.tsx index a925d86..6820d6b 100644 --- a/frontend/src/pages/welcome/index.tsx +++ b/frontend/src/pages/welcome/index.tsx @@ -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()} +
- - - - - - - - -
+