Browse Source

[Feature][UI Next] Add navbar username. (#8108)

3.0.0/version-upgrade
songjianet 3 years ago committed by GitHub
parent
commit
5f2aa79c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-ui-next/src/layouts/content/components/user/index.tsx

10
dolphinscheduler-ui-next/src/layouts/content/components/user/index.tsx

@ -17,9 +17,11 @@
import { defineComponent, PropType } from 'vue' import { defineComponent, PropType } from 'vue'
import { NDropdown, NIcon, NButton } from 'naive-ui' import { NDropdown, NIcon, NButton } from 'naive-ui'
import styles from './index.module.scss'
import { DownOutlined, UserOutlined } from '@vicons/antd' import { DownOutlined, UserOutlined } from '@vicons/antd'
import { useDropDown } from './use-dropdown' import { useDropDown } from './use-dropdown'
import { useUserStore } from '@/store/user/user'
import styles from './index.module.scss'
import type { UserInfoRes } from '@/service/modules/users/types'
const User = defineComponent({ const User = defineComponent({
name: 'User', name: 'User',
@ -31,7 +33,9 @@ const User = defineComponent({
}, },
setup() { setup() {
const { handleSelect } = useDropDown() const { handleSelect } = useDropDown()
return { handleSelect } const userStore = useUserStore()
return { handleSelect, userStore }
}, },
render() { render() {
return ( return (
@ -45,7 +49,7 @@ const User = defineComponent({
<NIcon class={styles.icon}> <NIcon class={styles.icon}>
<UserOutlined /> <UserOutlined />
</NIcon> </NIcon>
admin {(this.userStore.getUserInfo as UserInfoRes).userName}
<NIcon class={styles.icon}> <NIcon class={styles.icon}>
<DownOutlined /> <DownOutlined />
</NIcon> </NIcon>

Loading…
Cancel
Save