-
Notifications
You must be signed in to change notification settings - Fork 40
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
1 parent
524787f
commit e5e7622
Showing
29 changed files
with
373 additions
and
209 deletions.
There are no files selected for viewing
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
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,62 @@ | ||
import { useModel } from '@umijs/max'; | ||
import type { DescriptionsProps } from 'antd'; | ||
import { Button, Descriptions } from 'antd'; | ||
import CustomModal from '.'; | ||
|
||
export default function MyInfoModal({ | ||
visible, | ||
setVisible, | ||
}: API.CommonModalType) { | ||
const { initialState = {} } = useModel('@@initialState'); | ||
const { accountInfo } = initialState; | ||
|
||
const items: DescriptionsProps['items'] = [ | ||
{ | ||
key: 'nickname', | ||
label: '昵称', | ||
children: `${accountInfo?.nickname || '-'}`, | ||
}, | ||
{ | ||
key: 'username', | ||
label: '用户名', | ||
children: `${accountInfo?.username || '-'}`, | ||
}, | ||
{ | ||
key: 'roles', | ||
label: '角色', | ||
children: `${ | ||
accountInfo?.roles.map((role) => role.name).join(',') || '-' | ||
} `, | ||
}, | ||
{ | ||
key:'description', | ||
label:'描述', | ||
children: `${accountInfo?.description || '-'}`, | ||
}, | ||
{ | ||
key: 'lastLoginAt', | ||
label: '最近一次登录', | ||
children: `${accountInfo?.lastLoginAt || '-'}`, | ||
}, | ||
]; | ||
return ( | ||
<CustomModal | ||
isOpen={visible} | ||
handleCancel={() => { | ||
setVisible(false); | ||
}} | ||
footer={ | ||
<Button | ||
type="primary" | ||
onClick={() => { | ||
setVisible(false); | ||
}} | ||
> | ||
确定 | ||
</Button> | ||
} | ||
> | ||
<Descriptions title="我的信息" items={items} /> | ||
</CustomModal> | ||
); | ||
} |
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
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
Oops, something went wrong.