| | |
| | | import type { Settings as LayoutSettings } from '@ant-design/pro-components'; |
| | | import type { MenuDataItem, Settings as LayoutSettings } from '@ant-design/pro-components'; |
| | | import { SettingDrawer } from '@ant-design/pro-components'; |
| | | import type { RunTimeLayoutConfig } from '@umijs/max'; |
| | | import { history } from '@umijs/max'; |
| | |
| | | loading?: boolean; |
| | | }; |
| | | |
| | | const ensureMenuKeys = (menuData: MenuDataItem[], parentKey = 'menu'): MenuDataItem[] => |
| | | menuData.map((item, index) => { |
| | | const key = item.key || item.path || `${parentKey}-${String(item.name || index)}`; |
| | | |
| | | return { |
| | | ...item, |
| | | key, |
| | | children: item.children ? ensureMenuKeys(item.children, String(key)) : item.children, |
| | | }; |
| | | }); |
| | | |
| | | /** |
| | | * @see https://umijs.org/zh-CN/plugins/plugin-initial-state |
| | |
| | | ); |
| | | }, |
| | | ...initialState?.settings, |
| | | menuDataRender: ensureMenuKeys, |
| | | pageTitleRender: () => '管理后台', |
| | | }; |
| | | }; |