diff --git a/mock/excel.ts b/mock/excel.ts index b4631a7..c5ca37b 100644 --- a/mock/excel.ts +++ b/mock/excel.ts @@ -44,7 +44,7 @@ export default [ { order_no: '@guid()', timestamp: +Mock.Random.date('T'), - username: '@name()', + userName: '@name()', price: '@float(1000, 15000, 0, 2)', 'status|1': ['success', 'pending'] } diff --git a/src/layout/default/app-main/NavBarAppTools.ts b/src/layout/default/app-main/NavBarAppTools.ts new file mode 100644 index 0000000..87f8f0e --- /dev/null +++ b/src/layout/default/app-main/NavBarAppTools.ts @@ -0,0 +1,29 @@ +import { Fragment } from '@vue/runtime-core' +import type { Prop, VNode } from 'vue' +import { Comment, defineComponent } from 'vue' + +export default defineComponent({ + name: 'NavBarAppTools', + props: { + position: { + type: String, + require: true + } as Prop<'left' | 'right' | 'center'> + }, + render() { + const navbar = useBasicStore().navbar + const sorts = navbar[this.position!] as Map VNode[]> + if (!sorts) return h(Comment, 'nav bar app tools') + + let out = [] as VNode[] + for (const value of sorts.values()) { + try { + out.push(...value()) + } catch (e) { + console.error(e) + } + } + if (this.$props.position === 'right') out = out.reverse() + return h(Fragment, out) + } +}) diff --git a/src/layout/default/app-main/Navbar.vue b/src/layout/default/app-main/Navbar.vue index 066673c..2db1dca 100644 --- a/src/layout/default/app-main/Navbar.vue +++ b/src/layout/default/app-main/Navbar.vue @@ -12,131 +12,39 @@ - + diff --git a/src/layout/default/app-main/component/AvatarFrame.vue b/src/layout/default/app-main/component/AvatarFrame.vue new file mode 100644 index 0000000..f9c1e97 --- /dev/null +++ b/src/layout/default/app-main/component/AvatarFrame.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/store/basic.ts b/src/store/basic.ts index 556e0d6..fc0df6c 100644 --- a/src/store/basic.ts +++ b/src/store/basic.ts @@ -13,7 +13,7 @@ export const useBasicStore = defineStore('basic', { getUserInfo: false, online: true, userInfo: { - username: '', + userName: '', realName: '', avatar: '', phone: '', @@ -75,7 +75,7 @@ export const useBasicStore = defineStore('basic', { state.filterAsyncRoutes = [] //reset userInfo state.userInfo = { - username: '', + userName: '', realName: '', avatar: '', phone: '', diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 468a8e2..40e63d0 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -7,11 +7,11 @@

{{ settings.title }}

- + - + @@ -40,117 +40,116 @@