@yyp92-cli/template-react-pc 1.5.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/package.json +4 -1
  2. package/CHANGELOG.md +0 -43
  3. package/template/.env.development +0 -5
  4. package/template/.env.production +0 -4
  5. package/template/.env.test +0 -4
  6. package/template/.eslintrc.cjs +0 -18
  7. package/template/README.md +0 -9
  8. package/template/index.html +0 -13
  9. package/template/package.json +0 -43
  10. package/template/pnpm-lock.yaml +0 -3583
  11. package/template/public/vite.svg +0 -1
  12. package/template/src/antdTheme/darkTheme.ts +0 -1
  13. package/template/src/antdTheme/lightTheme.ts +0 -68
  14. package/template/src/app.scss +0 -29
  15. package/template/src/app.tsx +0 -14
  16. package/template/src/assets/iconfont/demo.css +0 -539
  17. package/template/src/assets/iconfont/demo_index.html +0 -211
  18. package/template/src/assets/iconfont/iconfont.css +0 -19
  19. package/template/src/assets/iconfont/iconfont.js +0 -1
  20. package/template/src/assets/iconfont/iconfont.json +0 -16
  21. package/template/src/assets/iconfont/iconfont.ttf +0 -0
  22. package/template/src/assets/iconfont/iconfont.woff +0 -0
  23. package/template/src/assets/iconfont/iconfont.woff2 +0 -0
  24. package/template/src/assets/react.svg +0 -1
  25. package/template/src/components/403/index.tsx +0 -22
  26. package/template/src/components/404/index.tsx +0 -24
  27. package/template/src/components/index.ts +0 -3
  28. package/template/src/components/layout/content/index.module.scss +0 -22
  29. package/template/src/components/layout/content/index.tsx +0 -109
  30. package/template/src/components/layout/footer/index.module.scss +0 -12
  31. package/template/src/components/layout/footer/index.tsx +0 -15
  32. package/template/src/components/layout/header/index.module.scss +0 -21
  33. package/template/src/components/layout/header/index.tsx +0 -112
  34. package/template/src/components/layout/index.module.scss +0 -8
  35. package/template/src/components/layout/index.tsx +0 -59
  36. package/template/src/components/layout/side/index.module.scss +0 -31
  37. package/template/src/components/layout/side/index.tsx +0 -109
  38. package/template/src/components/layout-horizontal/content/index.module.scss +0 -22
  39. package/template/src/components/layout-horizontal/content/index.tsx +0 -105
  40. package/template/src/components/layout-horizontal/footer/index.module.scss +0 -12
  41. package/template/src/components/layout-horizontal/footer/index.tsx +0 -15
  42. package/template/src/components/layout-horizontal/header/index.module.scss +0 -23
  43. package/template/src/components/layout-horizontal/header/index.tsx +0 -112
  44. package/template/src/components/layout-horizontal/index.module.scss +0 -8
  45. package/template/src/components/layout-horizontal/index.tsx +0 -59
  46. package/template/src/components/layout-horizontal/side/index.module.scss +0 -32
  47. package/template/src/components/layout-horizontal/side/index.tsx +0 -104
  48. package/template/src/components/login/index.module.scss +0 -23
  49. package/template/src/components/login/index.tsx +0 -133
  50. package/template/src/global/constants.ts +0 -4
  51. package/template/src/pages/home/index.module.scss +0 -0
  52. package/template/src/pages/home/index.tsx +0 -90
  53. package/template/src/router/router.tsx +0 -190
  54. package/template/src/service/api.ts +0 -9
  55. package/template/src/service/config.ts +0 -9
  56. package/template/src/service/index.ts +0 -1
  57. package/template/src/service/request/index.ts +0 -267
  58. package/template/src/service/request/type.ts +0 -5
  59. package/template/src/service/service.ts +0 -27
  60. package/template/src/store/login.ts +0 -38
  61. package/template/src/store/menus.ts +0 -30
  62. package/template/src/store/permission.ts +0 -30
  63. package/template/src/store/token.ts +0 -30
  64. package/template/src/theme/darkTheme.scss +0 -47
  65. package/template/src/theme/lightTheme.scss +0 -49
  66. package/template/src/utils/base64ToBlob.ts +0 -41
  67. package/template/src/utils/cache.ts +0 -44
  68. package/template/src/utils/changeTheme.ts +0 -14
  69. package/template/src/utils/download.ts +0 -45
  70. package/template/src/utils/filterMenu.ts +0 -34
  71. package/template/src/utils/index.ts +0 -5
  72. package/template/src/vite-env.d.ts +0 -5
  73. package/template/tsconfig.json +0 -45
  74. package/template/tsconfig.node.json +0 -10
  75. package/template/vite.config.ts +0 -49
@@ -1,59 +0,0 @@
1
- import React, { useEffect } from 'react'
2
- import { ConfigProvider } from 'antd'
3
- import dayjs from 'dayjs';
4
- import 'dayjs/locale/zh-cn';
5
- import zhCN from 'antd/locale/zh_CN';
6
- import { lightToken } from '@/antdTheme/lightTheme'
7
- import Content from './content'
8
-
9
- import styles from './index.module.scss'
10
-
11
- interface LayoutProps {
12
- [key: string]: any
13
- }
14
-
15
- const Layout: React.FC<LayoutProps> = ({ }) => {
16
- useEffect(() => {
17
- getDarkTheme(0)
18
- dayjs.locale('zh-cn')
19
- }, [])
20
-
21
-
22
- // ********** 操作 **********
23
- // 主题切换
24
- const getDarkTheme = (theme: number) => {
25
- // 获取根元素
26
- const root = document.documentElement;
27
-
28
- if (theme != 1) {
29
- // 修改 data-theme 属性的值为 "light"
30
- root.setAttribute('data-theme', 'light');
31
- return
32
- }
33
-
34
- // 修改 data-theme 属性的值为 "dark"
35
- root.setAttribute('data-theme', 'dark');
36
- }
37
-
38
-
39
- // ********** 渲染 **********
40
-
41
- return (
42
- <div className={styles.layout}>
43
- <ConfigProvider
44
- // 主题
45
- theme={lightToken}
46
- locale={zhCN}
47
-
48
- button={{
49
- // 设置为 false 时,移除按钮中 2 个汉字之间的空格
50
- autoInsertSpace: false,
51
- }}
52
- >
53
- <Content />
54
- </ConfigProvider>
55
- </div>
56
- )
57
- }
58
-
59
- export default Layout
@@ -1,31 +0,0 @@
1
- .side {
2
- flex-shrink: 0;
3
- width: 200px;
4
- height: 100%;
5
- display: flex;
6
- flex-direction: column;
7
-
8
- .logo {
9
- height: 50px;
10
- box-sizing: border-box;
11
- flex-shrink: 0;
12
- display: flex;
13
- align-items: center;
14
- justify-content: center;
15
- border-bottom: 1px solid var(--border-color-base);
16
- border-right: 1px solid var(--border-color-base);
17
-
18
- img {
19
- width: 32px;
20
- height: 32px;
21
- margin-right: 12px;
22
- }
23
- }
24
-
25
-
26
- .menu {
27
- flex: 1;
28
- overflow-y: auto;
29
- border-right: 1px solid var(--border-color-base) !important;
30
- }
31
- }
@@ -1,109 +0,0 @@
1
- import React, {useEffect, useLayoutEffect} from 'react'
2
- import {Menu} from 'antd'
3
- import type { MenuProps } from 'antd';
4
- import {useNavigate, useLocation} from 'react-router-dom'
5
- import {ComponentMap} from '@/router/router'
6
- import { menusStore } from '@/store/menus'
7
- import { tokenStore } from '@/store/token'
8
-
9
- import styles from './index.module.scss'
10
-
11
-
12
- type MenuItem = Required<MenuProps>['items'][number];
13
-
14
-
15
- interface SideProps {
16
- [key: string]: any
17
- }
18
-
19
- export const Side: React.FC<SideProps> = () => {
20
- const location = useLocation()
21
- const navigate = useNavigate()
22
- const {menus} = menusStore()
23
- const {token} = tokenStore()
24
-
25
- // 激活的父菜单
26
- const [openKeys, setOpenKeys] = React.useState<string[]>([])
27
- // 激活的菜单项
28
- const [selectedKeys, setSelectedKeys] = React.useState<string[]>([])
29
- // 菜单
30
- const [newMenuList, setNewMenuList] = React.useState<MenuItem[]>([])
31
-
32
- useLayoutEffect(() => {
33
- const newMenuList = menus.map((item: any) => {
34
- const Icon = ComponentMap[item.icon]
35
-
36
- return {
37
- ...item,
38
- icon: <Icon />
39
- }
40
- })
41
- setNewMenuList(newMenuList)
42
- }, [menus])
43
-
44
- useEffect(() => {
45
- const {pathname} = location ?? {}
46
- const newPathname = pathname.slice(1)
47
-
48
-
49
- const pathnameList = newPathname.split('/')
50
-
51
- if (pathnameList.length === 1) {
52
- setOpenKeys([])
53
- setSelectedKeys([pathnameList[0]])
54
- }
55
- else if (pathnameList.length === 2 || pathnameList.length === 3) {
56
- setOpenKeys([pathnameList[0]])
57
- setSelectedKeys([pathnameList[1]])
58
- }
59
- }, [])
60
-
61
-
62
- // ********* 操作 ********
63
- const onMenuItemOpenChange: MenuProps['onOpenChange'] = (openKeys: string[]) => {
64
- const currentKey = openKeys.slice(-1)
65
- setOpenKeys(currentKey)
66
- }
67
-
68
- const onMenuItemClick: MenuProps['onClick'] = (e: any) => {
69
- const {keyPath} = e ?? {}
70
-
71
- if (keyPath.length === 1) {
72
- setSelectedKeys(keyPath[0])
73
- navigate(`/${keyPath[0]}`)
74
- }
75
- else if (keyPath.length === 2) {
76
- setSelectedKeys(keyPath[0])
77
- navigate(`/${keyPath[1]}/${keyPath[0]}`)
78
- }
79
- }
80
-
81
-
82
- // ********* 渲染 ********
83
- return (
84
- <div className={styles.side}>
85
- <div className={styles.logo}>
86
- <img
87
- src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
88
- alt="logo"
89
- />
90
-
91
- <span>财务系统</span>
92
- </div>
93
-
94
- <Menu
95
- className={styles.menu}
96
- style={{
97
- width: 200,
98
- height: '100%'
99
- }}
100
- mode={'inline'}
101
- items={newMenuList}
102
- openKeys={openKeys}
103
- selectedKeys={selectedKeys}
104
- onOpenChange={onMenuItemOpenChange}
105
- onClick={onMenuItemClick}
106
- />
107
- </div>
108
- )
109
- }
@@ -1,22 +0,0 @@
1
- .layoutContent {
2
- flex: 1;
3
- width: 100%;
4
- height: 100%;
5
- display: flex;
6
- }
7
-
8
- .wraper {
9
- flex: 1;
10
- width: 100%;
11
- height: 100%;
12
- display: flex;
13
- flex-direction: column;
14
- }
15
-
16
- .contentInner {
17
- flex: 1;
18
- display: flex;
19
- flex-direction: column;
20
- box-sizing: border-box;
21
- padding: 16px 20px;
22
- }
@@ -1,105 +0,0 @@
1
- import React, {useState, useEffect} from 'react'
2
- import { Outlet, useLocation, useNavigate } from 'react-router-dom'
3
-
4
- import { Header } from '../header'
5
- import { Footer } from '../footer'
6
- import { routerConfig } from '@/router/router'
7
- import type { RouterConfigItemProps } from '@/router/router'
8
- import { permissionStore } from '@/store/permission'
9
- import { tokenStore } from '@/store/token'
10
- import { menusStore } from '@/store/menus'
11
-
12
- import styles from './index.module.scss'
13
-
14
- interface ContentProps {
15
- [key: string]: any
16
- }
17
-
18
-
19
- const Content: React.FC<ContentProps> = ({ }) => {
20
- const location = useLocation()
21
- const navigate = useNavigate()
22
- const {token} = tokenStore()
23
- const {menus} = menusStore()
24
- const {
25
- permissions
26
- } = permissionStore()
27
-
28
- const [currentRouter, setCurrentRouter] = useState<RouterConfigItemProps>()
29
-
30
- useEffect(() => {
31
- const { pathname } = location ?? {}
32
- const newPathname = pathname.slice(1)
33
-
34
- if (!token) {
35
- navigate('/login')
36
- }
37
- else if (newPathname !== '') {
38
- const pathnameList = newPathname.split('/')
39
- const getCcondition = () => {
40
- if (pathnameList.length === 1) {
41
- return permissions.includes(pathnameList[0])
42
- }
43
-
44
- if (pathnameList.length === 2) {
45
- return permissions.includes(pathnameList[1])
46
- }
47
-
48
- if (pathnameList.length === 3) {
49
- return permissions.includes(`${pathnameList[1]}/${pathnameList[2]}`)
50
- }
51
-
52
- return false
53
- }
54
-
55
- if (getCcondition()) {
56
- let newCurrentRouter: any = {}
57
-
58
- if (pathnameList.length === 1) {
59
- newCurrentRouter = routerConfig[0]?.children?.find((group: any) => group.key === pathnameList[0]) ?? {}
60
- }
61
- else if (pathnameList.length === 2) {
62
- const parent = routerConfig[0]?.children?.find((group: any) => group.key === pathnameList[0]) ?? {}
63
- newCurrentRouter = parent?.children?.find((item: any) => item.key === pathnameList[1])
64
- }
65
- else if (pathnameList.length === 3) {
66
- const parent = routerConfig[0]?.children?.find((group: any) => group.key === pathnameList[0]) ?? {}
67
- newCurrentRouter = parent?.children?.find((item: any) => item.key === `${pathnameList[1]}/${pathnameList[2]}`)
68
- }
69
-
70
- setCurrentRouter(newCurrentRouter)
71
- }
72
- else {
73
- navigate('/403')
74
- }
75
- }
76
- else {
77
- navigate(`/${menus[0]?.key}/${menus[0]?.children?.[0]?.key}`)
78
- }
79
- }, [location])
80
-
81
- // ********** 渲染 **********
82
- const renderContent = () => {
83
- if (!currentRouter) {
84
- return null
85
- }
86
-
87
- return (
88
- <div className={styles.layoutContent}>
89
- <div className={styles.wraper}>
90
- {!currentRouter?.showFullScreen && <Header />}
91
-
92
- <div className={styles.contentInner}>
93
- <Outlet />
94
- </div>
95
-
96
- {!currentRouter?.showFullScreen && <Footer />}
97
- </div>
98
- </div>
99
- )
100
- }
101
-
102
- return renderContent()
103
- }
104
-
105
- export default Content
@@ -1,12 +0,0 @@
1
- .footer {
2
- flex-shrink: 0;
3
- width: 100%;
4
- height: 50px;
5
- box-sizing: border-box;
6
- border-top: 1px solid var(--border-color-base);
7
- display: flex;
8
- justify-content: center;
9
- align-items: center;
10
- font-size: 12px;
11
- background: var(--bg-grey-color);
12
- }
@@ -1,15 +0,0 @@
1
- import React from 'react'
2
-
3
- import styles from './index.module.scss'
4
-
5
- interface FooterProps {
6
- [key: string]: any
7
- }
8
-
9
- export const Footer: React.FC<FooterProps> = ({}) => {
10
- return (
11
- <div className={styles.footer}>
12
- <div>财务系统注意事项</div>
13
- </div>
14
- )
15
- }
@@ -1,23 +0,0 @@
1
- .header {
2
- box-sizing: border-box;
3
- flex-shrink: 0;
4
- width: 100%;
5
- height: 50px;
6
- padding: 0 20px;
7
- display: flex;
8
- justify-content: space-between;
9
- align-items: center;
10
- border-bottom: 1px solid var(--border-color-base);
11
-
12
- .avatar {
13
- flex-shrink: 0;
14
- margin-left: 20px;
15
- display: flex;
16
- align-items: center;
17
-
18
- & > div {
19
- margin-left: 10px;
20
- font-size: 12px;
21
- }
22
- }
23
- }
@@ -1,112 +0,0 @@
1
- import React, { useState } from 'react'
2
- import {useNavigate} from 'react-router-dom'
3
- import { Avatar, Button, Dropdown, Switch, Tooltip } from 'antd'
4
- import type { MenuProps } from 'antd'
5
- import { FullscreenExitOutlined, FullscreenOutlined, UserOutlined } from '@ant-design/icons'
6
- import { getDarkTheme } from '@/utils'
7
- import { userInfoStore } from '@/store/login'
8
- import { tokenStore } from '@/store/token'
9
- import { menusStore } from '@/store/menus'
10
- import { permissionStore } from '@/store/permission'
11
- import {Side} from '../side'
12
-
13
- import styles from './index.module.scss'
14
-
15
- interface HeaderProps {
16
- [key: string]: any
17
- }
18
-
19
- export const Header: React.FC<HeaderProps> = ({}) => {
20
- const navigate = useNavigate()
21
- const {clearUserInfo} = userInfoStore()
22
- const {clearToken} = tokenStore()
23
- const {clearMenus} = menusStore()
24
- const {clearPermissions} = permissionStore()
25
- const [isFullScreen, setIsFullScreen] = useState<boolean>(false)
26
-
27
-
28
- // ********* 操作 *********
29
- const handleLogout = () => {
30
- clearToken()
31
- clearUserInfo()
32
- clearMenus()
33
- clearPermissions()
34
-
35
- navigate('/login')
36
- }
37
-
38
- const handleFullScreen = () => {
39
- // dom对象的一个属性:可以用来判断当前是不是全屏模式
40
- // 全屏:true, 不是全屏:false
41
- const full = document.fullscreenElement
42
-
43
- if (!full) {
44
- setIsFullScreen(true)
45
- document.documentElement.requestFullscreen()
46
- }
47
- else {
48
- setIsFullScreen(false)
49
- document.exitFullscreen()
50
- }
51
- }
52
-
53
- const handleChangeTheme = (checked: boolean) => {
54
- getDarkTheme(checked)
55
- }
56
-
57
-
58
- // ********* 渲染 *********
59
- const items: MenuProps['items'] = [
60
- {
61
- label: (
62
- <div
63
- onClick={handleLogout}
64
- >退出登录</div>
65
- ),
66
- key: '0',
67
- },
68
- ]
69
-
70
- return (
71
- <div className={styles.header}>
72
- <Side />
73
-
74
- <div className={styles.avatar}>
75
- <Tooltip title="切换主题">
76
- <Switch
77
- checkedChildren="暗黑"
78
- unCheckedChildren="明亮"
79
- defaultChecked={false}
80
- onChange={handleChangeTheme}
81
- />
82
- </Tooltip>
83
-
84
- <Tooltip title="全屏">
85
- <Button
86
- style={{
87
- margin: '0 10px'
88
- }}
89
- shape="circle"
90
- icon={
91
- !isFullScreen
92
- ? <FullscreenOutlined />
93
- : <FullscreenExitOutlined />
94
- }
95
- onClick={handleFullScreen}
96
- />
97
- </Tooltip>
98
-
99
- <Avatar
100
- style={{ backgroundColor: '#87d068' }}
101
- icon={<UserOutlined />}
102
- />
103
-
104
- <Dropdown
105
- menu={{ items }}
106
- >
107
- <div>{'xxx 已登录'}</div>
108
- </Dropdown>
109
- </div>
110
- </div>
111
- )
112
- }
@@ -1,8 +0,0 @@
1
- .layout {
2
- width: 100%;
3
- height: 100%;
4
- min-width: 1000px;
5
- display: flex;
6
- background: var(--bg-white-color);
7
- color: var(--text-color);
8
- }
@@ -1,59 +0,0 @@
1
- import React, { useEffect } from 'react'
2
- import { ConfigProvider } from 'antd'
3
- import dayjs from 'dayjs';
4
- import 'dayjs/locale/zh-cn';
5
- import zhCN from 'antd/locale/zh_CN';
6
- import { lightToken } from '@/antdTheme/lightTheme'
7
- import Content from './content'
8
-
9
- import styles from './index.module.scss'
10
-
11
- interface LayoutProps {
12
- [key: string]: any
13
- }
14
-
15
- const Layout: React.FC<LayoutProps> = ({ }) => {
16
- useEffect(() => {
17
- getDarkTheme(0)
18
- dayjs.locale('zh-cn')
19
- }, [])
20
-
21
-
22
- // ********** 操作 **********
23
- // 主题切换
24
- const getDarkTheme = (theme: number) => {
25
- // 获取根元素
26
- const root = document.documentElement;
27
-
28
- if (theme != 1) {
29
- // 修改 data-theme 属性的值为 "light"
30
- root.setAttribute('data-theme', 'light');
31
- return
32
- }
33
-
34
- // 修改 data-theme 属性的值为 "dark"
35
- root.setAttribute('data-theme', 'dark');
36
- }
37
-
38
-
39
- // ********** 渲染 **********
40
-
41
- return (
42
- <div className={styles.layout}>
43
- <ConfigProvider
44
- // 主题
45
- theme={lightToken}
46
- locale={zhCN}
47
-
48
- button={{
49
- // 设置为 false 时,移除按钮中 2 个汉字之间的空格
50
- autoInsertSpace: false,
51
- }}
52
- >
53
- <Content />
54
- </ConfigProvider>
55
- </div>
56
- )
57
- }
58
-
59
- export default Layout
@@ -1,32 +0,0 @@
1
- .side {
2
- flex: 1;
3
- width: 100%;
4
- height: 100%;
5
- display: flex;
6
- overflow: hidden;
7
-
8
- .logo {
9
- width: 169px;
10
- height: 50px;
11
- box-sizing: border-box;
12
- flex-shrink: 0;
13
- display: flex;
14
- align-items: center;
15
- justify-content: center;
16
- border-right: 1px solid var(--border-color-base);
17
- border-bottom: none;
18
-
19
- img {
20
- width: 32px;
21
- height: 32px;
22
- margin-right: 12px;
23
- }
24
- }
25
-
26
-
27
- .menu {
28
- flex: 1;
29
- overflow-x: auto;
30
- overflow-y: hidden;
31
- }
32
- }
@@ -1,104 +0,0 @@
1
- import React, {useEffect, useLayoutEffect} from 'react'
2
- import {Menu} from 'antd'
3
- import type { MenuProps } from 'antd';
4
- import {useNavigate, useLocation} from 'react-router-dom'
5
- import {ComponentMap} from '@/router/router'
6
- import { menusStore } from '@/store/menus'
7
-
8
- import styles from './index.module.scss'
9
-
10
-
11
- type MenuItem = Required<MenuProps>['items'][number];
12
-
13
-
14
- interface SideProps {
15
- [key: string]: any
16
- }
17
-
18
- export const Side: React.FC<SideProps> = ({}) => {
19
- const navigate = useNavigate();
20
- const location = useLocation()
21
- const {menus} = menusStore()
22
-
23
- // 激活的父菜单
24
- const [openKeys, setOpenKeys] = React.useState<string[]>([])
25
- // 激活的菜单项
26
- const [selectedKeys, setSelectedKeys] = React.useState<string[]>([])
27
- // 菜单
28
- const [menuList, setMenuList] = React.useState<MenuItem[]>([])
29
-
30
- useLayoutEffect(() => {
31
- const newMenuList = menus.map((item: any) => {
32
- const Icon = ComponentMap[item.icon]
33
-
34
- return {
35
- ...item,
36
- icon: <Icon />
37
- }
38
- })
39
- setMenuList(newMenuList)
40
- }, [menus])
41
-
42
- useEffect(() => {
43
- const {pathname} = location ?? {}
44
- const newPathname = pathname.slice(1)
45
- const pathnameList = newPathname.split('/')
46
-
47
- if (pathnameList.length === 1) {
48
- setOpenKeys([])
49
- setSelectedKeys([pathnameList[0]])
50
- }
51
- else if (pathnameList.length === 2 || pathnameList.length === 3) {
52
- // setOpenKeys([pathnameList[0]])
53
- setSelectedKeys([pathnameList[1]])
54
- }
55
- }, [])
56
-
57
-
58
- // ********* 操作 ********
59
- const onMenuItemOpenChange: MenuProps['onOpenChange'] = (openKeys: string[]) => {
60
- const currentKey = openKeys.slice(-1)
61
- setOpenKeys(currentKey)
62
- }
63
-
64
- const onMenuItemClick: MenuProps['onClick'] = (e: any) => {
65
- const {keyPath} = e ?? {}
66
-
67
- if (keyPath.length === 1) {
68
- setSelectedKeys(keyPath[0])
69
- navigate(`/${keyPath[0]}`)
70
- }
71
- else if (keyPath.length === 2) {
72
- setSelectedKeys(keyPath[0])
73
- navigate(`/${keyPath[1]}/${keyPath[0]}`)
74
- }
75
- }
76
-
77
-
78
- // ********* 渲染 ********
79
- return (
80
- <div className={styles.side}>
81
- <div className={styles.logo}>
82
- <img
83
- src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
84
- alt="logo"
85
- />
86
-
87
- <span>财务系统</span>
88
- </div>
89
-
90
- <Menu
91
- className={styles.menu}
92
- style={{
93
- borderBottom: 'none'
94
- }}
95
- mode={'horizontal'}
96
- items={menuList}
97
- openKeys={openKeys}
98
- selectedKeys={selectedKeys}
99
- onOpenChange={onMenuItemOpenChange}
100
- onClick={onMenuItemClick}
101
- />
102
- </div>
103
- )
104
- }