瀏覽代碼

perf: 优化页面

曾坤森 3 月之前
父節點
當前提交
e05b1c6bcf

+ 1 - 1
config/vite.config.dev.ts

@@ -14,7 +14,7 @@ export default mergeConfig(
           // 代理路径前缀
           target: 'http://192.168.1.12:8001/', // 目标服务器地址
           changeOrigin: true, // 修改请求头中的 Origin
-          rewrite: path => path.replace(/^\/api/, ''), // 重写路径(可选)
+          // rewrite: path => path.replace(/^\/api/, ''), // 重写路径(可选)
         },
       },
     },

二進制
src/assets/images/logo.png


+ 10 - 16
src/layout/default-layout.vue

@@ -13,25 +13,18 @@
           :collapsed="collapsed"
           :collapsible="true"
           :width="menuWidth"
-          :style="{ paddingTop: navbar ? '10px' : '' }"
+          :style="{ paddingTop: navbar ? '0px' : '' }"
           :hide-trigger="true"
           @collapse="setCollapsed"
         >
-          <div class="left-side">
-            <a-space>
-              <img
-                alt="logo"
-                src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/dfdba5317c0c20ce20e64fac803d52bc.svg~tplv-49unhts6dw-image.image"
-              />
-              <a-typography-title
-                :style="{ margin: 0, fontSize: '18px' }"
-                :heading="5"
-                v-if="!collapsed"
-              >
-                site-web
-              </a-typography-title>
-            </a-space>
+          <div class="left-side" v-if="!collapsed">
+            <img
+              alt="logo"
+              :style="{ width: '140px' }"
+              src="../assets/images/logo.png"
+            />
           </div>
+
           <div class="menu-wrapper">
             <Menu />
           </div>
@@ -166,8 +159,9 @@ onMounted(() => {
 .left-side {
   display: flex;
   align-items: center;
+  justify-content: center;
   width: 180px;
-  height: 30px;
+  height: 44px;
   padding-left: 10px;
   overflow: hidden;
 }

+ 1 - 1
src/locale/index.ts

@@ -6,7 +6,7 @@ export const LOCALE_OPTIONS = [
   { label: '中文', value: 'zh-CN' },
   { label: 'English', value: 'en-US' },
 ];
-const defaultLocale = localStorage.getItem('arco-locale') || 'zh-CN';
+const defaultLocale = localStorage.getItem('arco-locale') || 'zh-US';
 
 const i18n = createI18n({
   locale: defaultLocale,

+ 46 - 46
src/router/routes/modules/exception.ts

@@ -1,48 +1,48 @@
-import { DEFAULT_LAYOUT } from '../base';
-import { AppRouteRecordRaw } from '../types';
+// import { DEFAULT_LAYOUT } from '../base';
+// import { AppRouteRecordRaw } from '../types';
 
-const EXCEPTION: AppRouteRecordRaw = {
-  path: '/exception',
-  name: 'exception',
-  component: DEFAULT_LAYOUT,
-  meta: {
-    locale: 'menu.exception',
-    requiresAuth: true,
-    icon: 'icon-exclamation-circle',
-    order: 6,
-  },
-  children: [
-    {
-      path: '403',
-      name: '403',
-      component: () => import('@/views/exception/403/index.vue'),
-      meta: {
-        locale: 'menu.exception.403',
-        requiresAuth: true,
-        roles: ['admin'],
-      },
-    },
-    {
-      path: '404',
-      name: '404',
-      component: () => import('@/views/exception/404/index.vue'),
-      meta: {
-        locale: 'menu.exception.404',
-        requiresAuth: true,
-        roles: ['*'],
-      },
-    },
-    {
-      path: '500',
-      name: '500',
-      component: () => import('@/views/exception/500/index.vue'),
-      meta: {
-        locale: 'menu.exception.500',
-        requiresAuth: true,
-        roles: ['*'],
-      },
-    },
-  ],
-};
+// const EXCEPTION: AppRouteRecordRaw = {
+//   path: '/exception',
+//   name: 'exception',
+//   component: DEFAULT_LAYOUT,
+//   meta: {
+//     locale: 'menu.exception',
+//     requiresAuth: true,
+//     icon: 'icon-exclamation-circle',
+//     order: 6,
+//   },
+//   children: [
+//     {
+//       path: '403',
+//       name: '403',
+//       component: () => import('@/views/exception/403/index.vue'),
+//       meta: {
+//         locale: 'menu.exception.403',
+//         requiresAuth: true,
+//         roles: ['admin'],
+//       },
+//     },
+//     {
+//       path: '404',
+//       name: '404',
+//       component: () => import('@/views/exception/404/index.vue'),
+//       meta: {
+//         locale: 'menu.exception.404',
+//         requiresAuth: true,
+//         roles: ['*'],
+//       },
+//     },
+//     {
+//       path: '500',
+//       name: '500',
+//       component: () => import('@/views/exception/500/index.vue'),
+//       meta: {
+//         locale: 'menu.exception.500',
+//         requiresAuth: true,
+//         roles: ['*'],
+//       },
+//     },
+//   ],
+// };
 
-export default EXCEPTION;
+// export default EXCEPTION;

+ 4 - 2
src/views/dashboard/record-list/index.vue

@@ -167,7 +167,7 @@ const { pause, resume, isActive } = useIntervalFn(() => {
   /* your function */
   formModel.value.pageIndex = 1;
   fetchData();
-}, 50000);
+}, 5000);
 const onPageChange = (current: number) => {
   formModel.value.pageIndex = current;
   fetchData();
@@ -181,7 +181,9 @@ const downloadExcel = () => {
     .then(res => {
       const contentDisposition = res.headers['content-disposition'];
       const filenameMatch = contentDisposition.match(/filename="?(.+)"?/);
-      const filename = filenameMatch ? filenameMatch[1] : 'default.xlsx';
+      const filename = filenameMatch
+        ? filenameMatch[1].replace(/"+$/, '')
+        : 'default.xlsx';
       const blob = new Blob([res.data], {
         type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
       });