From 0d1542ef17d8db1baaf18266c8d9a915d405e7dc Mon Sep 17 00:00:00 2001 From: eternallycyf Date: Thu, 9 Mar 2023 10:39:17 +0800 Subject: [PATCH] chore: use antd-V5.30 --- package.json | 2 +- scripts/biz-stage-config.ts.ejs | 5 ++-- src/core/base/CustomMenu/index.less | 10 ++++---- src/core/layouts/BasicLayout.tsx | 40 ++++++++++++++++++----------- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 4622ca4..a164649 100755 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@antv/data-set": "^0.11.4", "@umijs/max": "^4.0.40", "ahooks": "^3.7.4", - "antd": "^5.1.1", + "antd": "^5.3.0", "braft-editor": "^2.3.9", "braft-extensions": "^0.1.1", "braft-utils": "^3.0.12", diff --git a/scripts/biz-stage-config.ts.ejs b/scripts/biz-stage-config.ts.ejs index 305a354..1e7b6db 100644 --- a/scripts/biz-stage-config.ts.ejs +++ b/scripts/biz-stage-config.ts.ejs @@ -1,8 +1,7 @@ //本文件是自动生成,请勿修改 -<% plugins.forEach(function(plugin) { %>import <%= plugin.name %> from '../pages/<%= plugin.name %>/routes'; +<% plugins.forEach(function(plugin) { %>import <%= plugin.name %> from '../pages/<%= plugin.name %>/routes'; <% }); %> export default [ <% plugins.forEach(function(plugin){ %> <%= plugin.name %>, <% }); -%>] - +%>]; diff --git a/src/core/base/CustomMenu/index.less b/src/core/base/CustomMenu/index.less index 807938b..72b1a6d 100644 --- a/src/core/base/CustomMenu/index.less +++ b/src/core/base/CustomMenu/index.less @@ -16,7 +16,7 @@ align-items: center; justify-content: flex-start; margin-bottom: 8px; - padding-left: 8px; + padding-left: 25px !important; height: 40px; background: rgba(255, 255, 255, 0); color: #fff; @@ -114,7 +114,7 @@ font-size: 16px; } - > .ant-menu-item { + >.ant-menu-item { margin: 0 0 8px; font-size: 16px; @@ -248,13 +248,13 @@ } .selected:not(.menuItem) { - > a { + >a { color: rgba(0, 0, 0, 0.88) !important; font-weight: 400; } &:hover { - > a { + >a { color: @primary-color !important; } } @@ -287,4 +287,4 @@ color: #fff; } } -} +} \ No newline at end of file diff --git a/src/core/layouts/BasicLayout.tsx b/src/core/layouts/BasicLayout.tsx index 03e95d6..49340d7 100644 --- a/src/core/layouts/BasicLayout.tsx +++ b/src/core/layouts/BasicLayout.tsx @@ -1,19 +1,24 @@ +import { WaterMark } from '@/components'; +import config from '@/config/projectConfig'; +import SiderMenu from '@/core/base/CustomMenu'; +import GlobalHeader from '@/core/base/GlobalHeader'; import TagsNav from '@/core/base/TagsNav'; -import { connect, withRouter } from '@umijs/max'; +import { ConnectState } from '@/typings/connect'; +import { + connect, + Dispatch, + getDvaApp, + Helmet, + History, + Outlet, + withRouter, +} from '@umijs/max'; import { RouteComponentProps } from '@umijs/renderer-react'; -import { useEffect, Fragment, FC, useState } from 'react'; -import SiderMenu from '@/core/base/CustomMenu'; -import { Layout, Spin, ConfigProvider, theme as antdTheme } from 'antd'; -import { Helmet, History } from '@umijs/max'; -import { Dispatch, Outlet } from '@umijs/max'; +import { ConfigProvider, Layout, Spin, theme as antdTheme } from 'antd'; import _ from 'lodash'; -import { ConnectState } from '@/typings/connect'; -import styles from './index.less'; -import config from '@/config/projectConfig'; -import { WaterMark } from '@/components'; -import { menuList as routes } from 'mock/user'; -import GlobalHeader from '@/core/base/GlobalHeader'; +import { FC, Fragment, useEffect, useState } from 'react'; import ColorPicker from '../base/GlobalHeader/ColorPicker'; +import styles from './index.less'; const { Sider, Content, Header } = Layout; const { title } = config; @@ -69,9 +74,14 @@ const BasicLayout: FC = (props) => { handleRouterChange(); }, [dispatch]); + const { + breadcrumbNameMap: localBreadcrumbNameMap = {}, + menuList: localMenuList = [], + } = getDvaApp()._store.getState().global; + const siderMenuProps = { theme, - menuList, + menuList: menuList || localMenuList, location, collapsed, sliderMenuState, @@ -79,8 +89,8 @@ const BasicLayout: FC = (props) => { }; const TagsNavProps = { - breadcrumbNameMap, - menuList, + breadcrumbNameMap: breadcrumbNameMap || localBreadcrumbNameMap, + menuList: menuList || localMenuList, location, };