Przeglądaj źródła

chore: 修改菜单图标

xyh 2 lat temu
rodzic
commit
4698a777a9

+ 0 - 1
packages/app/public/index.html

@@ -10,7 +10,6 @@
   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
   <meta http-equiv="Pragma" content="no-cache" />
   <meta http-equiv="Cache-Control" content="no-cache" />
-  <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.3.0/css/all.min.css" rel="stylesheet">
 
   <title>
     <%= htmlWebpackPlugin.options.title %>

+ 1 - 1
packages/app/src/components/font-icon/index.tsx

@@ -5,7 +5,7 @@ type Props = {
 };
 
 const FontIcon: FC<Props> = function({name}) {
-  return <i className={`fa-solid fa-${name}`} />;
+  return <i className={`iconfont ${name} ant-menu-item-icon`} />;
 };
 
 export default FontIcon;

+ 1 - 0
packages/app/src/index.tsx

@@ -1,4 +1,5 @@
 import '@styles/index.css';
+import '@styles/iconfont.css';
 
 import {RootRoutes} from '@routes';
 import {createRoot} from 'react-dom/client';

+ 1 - 1
packages/app/src/pages/home/menu/hooks.tsx

@@ -26,7 +26,7 @@ export function useMenu() {
             page: 1,
             limit: 0,
             orderBy: '0',
-            img: 'house',
+            img: 'shouye',
           },
           ...data.data,
         ];

+ 44 - 0
packages/app/src/styles/iconfont.css

@@ -0,0 +1,44 @@
+@font-face {
+  font-family: 'iconfont'; /* Project id 3960504 */
+  src: url('iconfont.ttf?t=1679103707765') format('truetype');
+}
+
+.iconfont {
+  font-family: 'iconfont' !important;
+  font-size: 16px !important;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.yonghu::before {
+  content: '\e8c8';
+}
+
+.cangku::before {
+  content: '\e71f';
+}
+
+.jinchuku::before {
+  content: '\e722';
+}
+
+.shouzhiliushui::before {
+  content: '\e727';
+}
+
+.shouye::before {
+  content: '\e8c6';
+}
+
+.weixiu::before {
+  content: '\e613';
+}
+
+.xitong::before {
+  content: '\e621';
+}
+
+.caigouguanli-caigouxuqiu::before {
+  content: '\e643';
+}

BIN
packages/app/src/styles/iconfont.ttf


+ 2 - 1
packages/app/src/utils/sortMenu/index.tsx

@@ -1,3 +1,4 @@
+import {FontIcon} from '@components';
 import {TreeRoleMenuData} from '@models';
 import {ReactNode} from 'react';
 
@@ -23,7 +24,7 @@ export function sortMenu(menus: TreeRoleMenuData[]) {
       label: name,
       pid: pId,
       url,
-      icon: img && <i className={`fa-solid fa-${img} grey-icon`} />,
+      icon: img && <FontIcon name={img} />,
     };
 
     pId === '0'