-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
G
committed
Dec 25, 2023
1 parent
d86ca8b
commit 57401c1
Showing
9 changed files
with
137 additions
and
34 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { lazy } from 'react'; | ||
|
||
import { LazyLoad } from '@/components/LazyLoad'; | ||
|
||
import { LayoutGuard } from '../guard'; | ||
|
||
import type { RouteObject } from '../types'; | ||
|
||
// user module page | ||
const UserRoute: RouteObject = { | ||
path: '/user', | ||
element: <LayoutGuard />, | ||
meta: { | ||
title: '用户管理', | ||
icon: 'ic_user', | ||
orderNo: 2, | ||
iconSize: 20, | ||
}, | ||
children: [ | ||
{ | ||
path: 'user-list', | ||
element: LazyLoad(lazy(() => import('@/views/user/list'))), | ||
meta: { | ||
title: '用户列表', | ||
key: 'userList', | ||
}, | ||
}, | ||
{ | ||
path: 'add-user', | ||
element: LazyLoad(lazy(() => import('@/views/user/addUser'))), | ||
meta: { | ||
title: '添加用户', | ||
key: 'addUser', | ||
}, | ||
}, | ||
], | ||
}; | ||
export default UserRoute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { FC } from 'react'; | ||
|
||
interface PAddUser { | ||
onAdd?: (user: any) => void; | ||
} | ||
|
||
const AddUser: FC<PAddUser> = ({ onAdd = () => {} }) => { | ||
console.log(onAdd); | ||
|
||
return ( | ||
<div> | ||
<div>添加用户</div> | ||
</div> | ||
); | ||
}; | ||
export default AddUser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { FC } from 'react'; | ||
|
||
interface PUser { | ||
id: number; | ||
name: string; | ||
email: string; | ||
avatar: string; | ||
} | ||
|
||
const User: FC<PUser> = ({ id, name, email, avatar }) => { | ||
console.log(id, name, email, avatar); | ||
|
||
return ( | ||
<div> | ||
<div>{id}</div> | ||
<div>{name}</div> | ||
<div>{email}</div> | ||
<div>{avatar}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default User; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { FC } from 'react'; | ||
|
||
interface PUSerList { | ||
data?: { | ||
id: number; | ||
name: string; | ||
email: string; | ||
avatar: string; | ||
}; | ||
} | ||
|
||
const UserList: FC<PUSerList> = ({ data = { id: 0, name: '', email: '', avatar: '' } }) => ( | ||
<div> | ||
<div>{data.id}</div> | ||
<div>{data.name}</div> | ||
<div>{data.email}</div> | ||
<div>{data.avatar}</div> | ||
</div> | ||
); | ||
export default UserList; |