Skip to content

Commit b0974e7

Browse files
committed
fix
1 parent 74624ef commit b0974e7

File tree

6 files changed

+15
-176
lines changed

6 files changed

+15
-176
lines changed

src/pages/home/components/siderbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const LeftMenu = (props: ICommonProps) => {
2424
const pathList = pathname.split('/').filter(p => p);
2525
const realMenus = LeftMenuConfig();
2626

27-
console.log(pathList, 'realMenus', realMenus)
27+
// console.log(pathList, 'realMenus', realMenus)
2828
// 路由更新时更新左侧菜单选中和展开项
2929
if (realMenus.length > 0) {
3030
setMenuList(realMenus);
@@ -60,7 +60,7 @@ const LeftMenu = (props: ICommonProps) => {
6060
};
6161

6262
return (
63-
<Sider collapsible width={200}>
63+
<Sider collapsible width={220}>
6464
<div className="logo">
6565
<div>
6666
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-11.5 -10.23174 23 20.46348">
@@ -86,7 +86,7 @@ const LeftMenu = (props: ICommonProps) => {
8686
return (
8787
<SubMenu key={String(item.path)} title={item.title} icon={item.icon}>
8888
{item.subRoute.map(child => (
89-
<Menu.Item key={String(child.path)}>
89+
<Menu.Item key={String(child.path)} icon={child.icon}>
9090
<Link to={String(child.path)}>{child.title}</Link>
9191
</Menu.Item>
9292
))}

src/pages/stocks/history.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { data2PageData, pageData2Params } from '../../utils/tools'
66
import { marketOpts, blockOpts } from '../../types/stock'
77
import { StockHistory } from '../../types/stockHistory'
88

9-
const ShareList: React.FC = () => {
9+
const StockHistoryList: React.FC = () => {
1010

1111
const [form] = Form.useForm<StockQuery>()
1212

@@ -65,4 +65,4 @@ const ShareList: React.FC = () => {
6565
}
6666

6767

68-
export default ShareList
68+
export default StockHistoryList

src/pages/stocks/historyDetail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useEffect } from 'react'
22

3-
const ShareHistories: React.FC = () => {
3+
const StockHistoryPage: React.FC = () => {
44
return <div></div>
55
}
66

7-
export default ShareHistories
7+
export default StockHistoryPage

src/pages/stocks/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { stockPageList, StockQuery } from '../../services/stock'
55
import { data2PageData, pageData2Params } from '../../utils/tools'
66
import { Stock, marketOpts, blockOpts } from '../../types/stock'
77

8-
const ShareList: React.FC = () => {
8+
const StockList: React.FC = () => {
99

1010
const [form] = Form.useForm<StockQuery>()
1111

@@ -69,4 +69,4 @@ const ShareList: React.FC = () => {
6969
}
7070

7171

72-
export default ShareList
72+
export default StockList

src/routes/index.tsx

Lines changed: 2 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,9 @@
11
import * as React from 'react'
2-
import { Route, Switch, Redirect, RouteProps } from 'react-router-dom'
3-
import NotFound from '@components/notFound'
2+
import { Route, Switch, Redirect } from 'react-router-dom'
43
import Loading from '@components/loading'
54
import { routes } from './pageRoutes'
65

7-
const {lazy, Suspense} = React
8-
9-
// const Dashboard = lazy(() => import( /* webpackChunkName:"dashboard" */ '@pages/dashboard/dashboard'))
10-
// const Chart = lazy(() => import( /* webpackChunkName:"charts" */ '@pages/charts'))
11-
// const LogApi = lazy(() => import( /* webpackChunkName:"logApi" */ '@pages/logs/api'))
12-
// const LogErrors = lazy(() => import( /* webpackChunkName:"logErrors" */ '@pages/logs/errors'))
13-
// const ArticleList = lazy(() => import( /* webpackChunkName:"articleList" */ '@pages/article/articleList'))
14-
// const ArticleEdit = lazy(() => import( /* webpackChunkName:"articleEdit" */ '@pages/article/articleEdit'))
15-
// const ArticleCreate = lazy(() => import( /* webpackChunkName:"articleCreate" */ '@pages/article/articleCreate'))
16-
// const ArticleTypeList = lazy(() => import( /* webpackChunkName:"articleTypeList" */ '@pages/articleType/articleTypeList'))
17-
// const ArticleTypeEdit = lazy(() => import( /* webpackChunkName:"articleTypeEdit" */ '@pages/articleType/articleTypeEdit'))
18-
// const ArticleTypeCreate = lazy(() => import( /* webpackChunkName:"articleTypeCreate" */ '@pages/articleType/articleTypeCreate'))
19-
// const TagList = lazy(() => import( /* webpackChunkName:"tagList" */ '@pages/tag/tagList'))
20-
// const TagEdit = lazy(() => import( /* webpackChunkName:"tagEdit" */ '@pages/tag/tagEdit'))
21-
// const TagCreate = lazy(() => import( /* webpackChunkName:"tagCreate" */ '@pages/tag/tagCreate'))
22-
// const CommentList = lazy(() => import( /* webpackChunkName:"commentList" */ '@pages/comment/commentList'))
23-
// const CommentEdit = lazy(() => import( /* webpackChunkName:"commentEdit" */ '@pages/comment/commentEdit'))
24-
// const LeaveMsgList = lazy(() => import( /* webpackChunkName:"leaveMsgList" */ '@pages/leaveMsg/leaveMsgList'))
25-
// const LeaveMsgEdit = lazy(() => import( /* webpackChunkName:"leaveMsgEdit" */ '@pages/leaveMsg/leaveMsgEdit'))
26-
// const UserList = lazy(() => import( /* webpackChunkName:"userList" */ '@pages/user/userList'))
27-
// const UserEdit = lazy(() => import( /* webpackChunkName:"userEdit" */ '@pages/user/userEdit'))
28-
// const UserCreate = lazy(() => import( /* webpackChunkName:"userCreate" */ '@pages/user/userCreate'))
29-
// const BallList = lazy(() => import( /* webpackChunkName:"ballList" */ '@pages/lottery/ballList'))
30-
// const BallCreate = lazy(() => import( /* webpackChunkName:"ballCreate" */ '@pages/lottery/ballCreate'))
31-
// const BallEdit = lazy(() => import( /* webpackChunkName:"ballEdit" */ '@pages/lottery/ballEdit'))
32-
// const BallTrend = lazy(() => import( /* webpackChunkName:"ballTrend" */ '@pages/lottery/ballTrend'))
33-
// const BallChart = lazy(() => import( /* webpackChunkName:"ballChart" */ '@pages/lottery/ballChart'))
34-
// const StockList = lazy(() => import( /* webpackChunkName:"StockList" */ '@pages/stocks'))
35-
// const StockHistories = lazy(() => import( /* webpackChunkName:"StockList" */ '@pages/stocks/history'))
36-
37-
// // demos
38-
// const Demo = lazy(() => import( /* webpackChunkName:"demo" */ '@pages/demo/demo'))
39-
// const DemoMobx = lazy(() => import( /* webpackChunkName:"demo" */ '@pages/demo/demoMobx'))
40-
// const DemoRedux = lazy(() => import( /* webpackChunkName:"demo" */ '@pages/demo/demoRedux'))
41-
42-
43-
// export const routes: RouteProps[] = [
44-
// {
45-
// path: '/home',
46-
// component: Dashboard
47-
// },
48-
// {
49-
// path: '/home/charts',
50-
// component: Chart
51-
// },
52-
// {
53-
// path: '/home/log-api',
54-
// component: LogApi
55-
// },
56-
// {
57-
// path: '/home/log-errors',
58-
// component: LogErrors
59-
// },
60-
// {
61-
// path: '/home/blog-article',
62-
// component: ArticleList
63-
// },
64-
// {
65-
// path: '/home/blog-article/:id',
66-
// component: ArticleEdit
67-
// },
68-
// {
69-
// path: '/home/blog-articleCreate',
70-
// component: ArticleCreate
71-
// },
72-
// {
73-
// path: '/home/blog-type',
74-
// component: ArticleTypeList
75-
// },
76-
// {
77-
// path: '/home/blog-type/:id',
78-
// component: ArticleTypeEdit
79-
// },
80-
// {
81-
// path: '/home/blog-typeCreate',
82-
// component: ArticleTypeCreate
83-
// },
84-
// {
85-
// path: '/home/blog-tag',
86-
// component: TagList
87-
// },
88-
// {
89-
// path: '/home/blog-tagCreate',
90-
// component: TagCreate
91-
// },
92-
// {
93-
// path: '/home/blog-tag/:id',
94-
// component: TagEdit
95-
// },
96-
// {
97-
// path: '/home/blog-comment',
98-
// component: CommentList
99-
// },
100-
// {
101-
// path: '/home/blog-comment/:id',
102-
// component: CommentEdit
103-
// },
104-
// {
105-
// path: '/home/blog-message',
106-
// component: LeaveMsgList
107-
// },
108-
// {
109-
// path: '/home/blog-message/:id',
110-
// component: LeaveMsgEdit
111-
// },
112-
// {
113-
// path: '/home/blog-user',
114-
// component: UserList
115-
// },
116-
// {
117-
// path: '/home/blog-user/:id',
118-
// component: UserEdit
119-
// },
120-
// {
121-
// path: '/home/blog-userCreate',
122-
// component: UserCreate
123-
// },
124-
// {
125-
// path: '/home/lottery-balls',
126-
// component: BallList
127-
// },
128-
// {
129-
// path: '/home/lottery-ball',
130-
// component: BallCreate
131-
// },
132-
// {
133-
// path: '/home/lottery-ball/:id',
134-
// component: BallEdit
135-
// },
136-
// {
137-
// path: '/home/lottery-trend',
138-
// component: BallTrend
139-
// },
140-
// {
141-
// path: '/home/lottery-chart',
142-
// component: BallChart
143-
// },
144-
// {
145-
// path: '/home/demos',
146-
// component: Demo
147-
// },
148-
// {
149-
// path: '/home/demo-mobx',
150-
// component: DemoMobx
151-
// },
152-
// {
153-
// path: '/home/demo-redux',
154-
// component: DemoRedux
155-
// },
156-
// {
157-
// path: '/home/stocks',
158-
// component: StockList
159-
// },
160-
// {
161-
// path: '/home/stocks-history',
162-
// component: StockHistories
163-
// },
164-
// {
165-
// path: '*',
166-
// component: NotFound
167-
// },
168-
// ]
6+
const { Suspense } = React
1697

1708
const Routes = (authorized: boolean) => <Suspense fallback={<Loading/>}>
1719
<Switch>

src/routes/pageRoutes.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { RouteProps } from 'react-router-dom'
33
import NotFound from '@components/notFound'
44
import {
55
AreaChartOutlined, BarChartOutlined, BulbOutlined, DollarOutlined, ExperimentOutlined, FileSearchOutlined,
6-
FormOutlined, FrownOutlined, FundOutlined, HomeOutlined, MehOutlined, SmileOutlined, StockOutlined
6+
BookOutlined, FormOutlined, FrownOutlined, FundOutlined, HomeOutlined, MehOutlined, SmileOutlined, StockOutlined
77
} from '@ant-design/icons'
88

99
const {lazy} = React
@@ -89,7 +89,7 @@ const routesConf: Partial<XRouteProps>[] = [
8989
},
9090
{
9191
title: 'Blog',
92-
icon: <FileSearchOutlined/>,
92+
icon: <BookOutlined/>,
9393
path: '/blog',
9494
subRoute: [
9595
{
@@ -293,8 +293,9 @@ const LeftMenuConfig = () => routesConf
293293
subRoute = route.subRoute
294294
.filter(_route => typeof _route.title === 'string')
295295
.map(_route => ({
296-
path:route.path + String(_route.path),
296+
path: route.path + String(_route.path),
297297
title: _route.title,
298+
icon: _route.icon
298299
}));
299300
}
300301
return {

0 commit comments

Comments
 (0)