李富豪 11 ヶ月 前
コミット
432681a5a2

+ 1 - 1
index.html

@@ -6,7 +6,7 @@
   <meta name="renderer" content="webkit" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <link rel="icon" href="/src/assets/public/logo.png" />
-  <title>建科•小智</title>
+  <title>建科•小智后台管理系统</title>
 </head>
 
 <body>

BIN
src/assets/public/notFound.png


+ 2 - 4
src/pages/layout/components/Header.tsx

@@ -39,11 +39,9 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
             <div className='header-logo' onClick={() => {
                 router.navigate({ pathname: '/' });
             }}>
-                <div className='header-logo-picture'>
-                    <img src={logoSrc} />
-                </div>
+                <img className='header-logo-picture' src={logoSrc} />
                 <div className='header-logo-text'>
-                    建科•小智管理后台
+                    建科•小智后台管理系统
                 </div>
             </div>
             <Dropdown menu={{ items }}>

+ 8 - 2
src/pages/layout/index.tsx

@@ -1,5 +1,5 @@
 import * as React from 'react';
-import { useMatches, Outlet } from 'react-router-dom';
+import { useMatches, Outlet, useLocation } from 'react-router-dom';
 import { observer } from 'mobx-react';
 import { Layout } from 'antd';
 import Header from './components/Header';
@@ -29,6 +29,7 @@ const LayoutApp: React.FC = () => {
     } = state;
 
     const matches = useMatches();
+    const location = useLocation();
 
     React.useEffect(() => {
         const list = matches.filter((item: any) => item.handle?.menuLevel && item.handle?.breadcrumbName).map((item: any) => {
@@ -61,7 +62,12 @@ const LayoutApp: React.FC = () => {
                     onClickCollapsed={onClickCollapsed}
                 />
                 <Layout>
-                    <Breadcrumb routerMatchList={routerMatchList} />
+                    {
+                        location.pathname === '/404' ?
+                            <div style={{ width: '100%', height: 20 }}></div>
+                            :
+                            <Breadcrumb routerMatchList={routerMatchList} />
+                    }
                     <Content className='content'>
                         <Outlet></Outlet>
                     </Content>

+ 1 - 11
src/pages/layout/style.less

@@ -15,21 +15,11 @@
         &-picture {
             width: 30px;
             height: 30px;
-            background: #FFFFFF;
-            border-radius: @border-radius-base;
-            overflow: hidden;
             margin-right: 10px;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-
-            img {
-                width: 30px;
-                height: 30px;
-            }
         }
 
         &-text {
+            font-size: 16px;
             font-weight: 500;
         }
     }

+ 1 - 32
src/style/global.less

@@ -1,8 +1,7 @@
-@primary-color: #0052D9;
+@primary-color: #2152d1;
 @success-color: #52C41A;
 @warning-color: #FAAD14;
 @error-color: #FF4D4F;
-@gray-color: #B2B8C0;
 @text-color: #303133;
 @border-color: #DCDFE6;
 @background-color: #F7F8FA;
@@ -52,32 +51,6 @@ ul li {
     list-style-type: none;
 }
 
-.text-primary,
-.text-primary:hover {
-    color: @primary-color;
-}
-
-.text-success,
-.text-success:hover {
-    color: @success-color;
-}
-
-.text-warning,
-.text-warning:hover {
-    color: @warning-color;
-}
-
-.text-error,
-.text-error:hover {
-    color: @error-color;
-}
-
-.text-gray,
-.text-gray:hover {
-    color: @gray-color;
-    cursor: not-allowed;
-}
-
 .router-lazyLoad {
     position: absolute;
     top: 50%;
@@ -96,8 +69,4 @@ ul li {
 
 .ant-form-item {
     margin-bottom: 16px !important;
-}
-
-.ant-image-img {
-    object-fit: cover;
 }

+ 7 - 28
src/utils/index.ts

@@ -1,37 +1,16 @@
 // 正则表达式
 export const regex = {
-    phoneNumber: /^1[13456789]\d{9}$/,// 手机号码
     password: /^[a-zA-Z0-9]{6,16}$/,// 密码
-    email: /^([a-zA-Z0-9_\.\-])+@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,// 电子邮箱
-}
+};
 
-// 函数防抖
-export const debounce = (func: Function, interval?: number) => {
-    let timer: any;
-    const time = interval || 200;// 间隔时间默认0.2秒
-    return function (this: object, ...args: any[]) {
-        clearTimeout(timer);
-        timer = setTimeout(() => {
-            func.call(this, args);
-        }, time);
-    };
-}
-
-// 下载Excel
-export const downloadExcel = (url: string) => {
+// 下载文件
+export const downloadFile = (blob: Blob, fileName: string) => {
+    const downUrl = window.URL.createObjectURL(new Blob([blob]));
     const elementA = document.createElement('a');
-    elementA.setAttribute('href', url);
+    elementA.href = downUrl;
+    elementA.download = fileName;
     elementA.style.display = 'none';
     document.body.appendChild(elementA);
     elementA.click();
     document.body.removeChild(elementA);
-}
-
-// 模拟异步
-export const promise = (response: any, time: number): Promise<any> => {
-    return new Promise((resolve, reject) => {
-        setTimeout(() => {
-            resolve(response);
-        }, time * 1000);
-    });
-}
+};