提交 57615038 编写于 作者: V vben

chore: update layout

上级 b335e751
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
### ⚡ Performance Improvements ### ⚡ Performance Improvements
- 调整获取用户信息接口返回值为数组格式 - 调整获取用户信息接口返回值为数组格式
- 将 error-log 列表固定为系统路由
### 🐛 Bug Fixes ### 🐛 Bug Fixes
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
--> -->
<template> <template>
<Dropdown <Dropdown
placement="bottomCenter"
:trigger="['click']" :trigger="['click']"
:dropMenuList="localeList" :dropMenuList="localeList"
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
......
<template> <template>
<LayoutLockPage /> <LayoutLockPage />
<BackTop v-if="getUseOpenBackTop" :target="getTarget" /> <BackTop v-if="getUseOpenBackTop" :target="getTarget" />
<SettingDrawer v-if="getShowSettingButton" />
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
...@@ -14,15 +13,13 @@ ...@@ -14,15 +13,13 @@
components: { components: {
BackTop, BackTop,
LayoutLockPage: createAsyncComponent(() => import('/@/views/sys/lock/index.vue')), LayoutLockPage: createAsyncComponent(() => import('/@/views/sys/lock/index.vue')),
SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue')),
}, },
setup() { setup() {
const { getUseOpenBackTop, getShowSettingButton } = useRootSetting(); const { getUseOpenBackTop } = useRootSetting();
return { return {
getTarget: () => document.body, getTarget: () => document.body,
getUseOpenBackTop, getUseOpenBackTop,
getShowSettingButton,
}; };
}, },
}); });
......
@header-trigger-prefix-cls: ~'@{namespace}-layout-header-trigger'; @header-trigger-prefix-cls: ~'@{namespace}-layout-header-trigger';
@header-prefix-cls: ~'@{namespace}-layout-header'; @header-prefix-cls: ~'@{namespace}-layout-header';
@locale-prefix-cls: ~'@{namespace}-app-locale-picker';
@breadcrumb-prefix-cls: ~'@{namespace}-layout-breadcrumb'; @breadcrumb-prefix-cls: ~'@{namespace}-layout-breadcrumb';
@logo-prefix-cls: ~'@{namespace}-app-logo'; @logo-prefix-cls: ~'@{namespace}-app-logo';
...@@ -104,7 +103,7 @@ ...@@ -104,7 +103,7 @@
&-action { &-action {
display: flex; display: flex;
min-width: 180px; min-width: 180px;
padding-right: 12px; // padding-right: 12px;
align-items: center; align-items: center;
&__item { &__item {
...@@ -146,13 +145,15 @@ ...@@ -146,13 +145,15 @@
.@{header-prefix-cls}-action { .@{header-prefix-cls}-action {
&__item { &__item {
&:hover { color: @text-color-base;
background: @header-light-bg-hover-color;
.app-iconify {
padding: 0 10px;
font-size: 16px !important;
} }
.@{locale-prefix-cls} { &:hover {
padding: 0 6px; background: @header-light-bg-hover-color;
color: rgba(0, 0, 0, 0.65);
} }
} }
......
...@@ -41,14 +41,16 @@ ...@@ -41,14 +41,16 @@
<FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" /> <FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" />
<UserDropDown :theme="getHeaderTheme" />
<AppLocalePicker <AppLocalePicker
v-if="getShowLocale" v-if="getShowLocale"
:reload="true" :reload="true"
:showText="false" :showText="false"
:class="`${prefixCls}-action__item`" :class="`${prefixCls}-action__item`"
/> />
<UserDropDown :theme="getHeaderTheme" />
<SettingDrawer v-if="getShowSettingButton" :class="`${prefixCls}-action__item`" />
</div> </div>
</Header> </Header>
</template> </template>
...@@ -76,6 +78,8 @@ ...@@ -76,6 +78,8 @@
import { useAppInject } from '/@/hooks/web/useAppInject'; import { useAppInject } from '/@/hooks/web/useAppInject';
import { useDesign } from '/@/hooks/web/useDesign'; import { useDesign } from '/@/hooks/web/useDesign';
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
export default defineComponent({ export default defineComponent({
name: 'LayoutHeader', name: 'LayoutHeader',
components: { components: {
...@@ -90,6 +94,9 @@ ...@@ -90,6 +94,9 @@
Notify, Notify,
AppSearch, AppSearch,
ErrorAction, ErrorAction,
SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue'), {
loading: true,
}),
}, },
props: { props: {
fixed: propTypes.bool, fixed: propTypes.bool,
...@@ -105,7 +112,7 @@ ...@@ -105,7 +112,7 @@
getIsMixSidebar, getIsMixSidebar,
} = useMenuSetting(); } = useMenuSetting();
const { getShowLocale } = useLocaleSetting(); const { getShowLocale } = useLocaleSetting();
const { getUseErrorHandle } = useRootSetting(); const { getUseErrorHandle, getShowSettingButton } = useRootSetting();
const { const {
getHeaderTheme, getHeaderTheme,
...@@ -167,6 +174,7 @@ ...@@ -167,6 +174,7 @@
getUseErrorHandle, getUseErrorHandle,
getLogoWidth, getLogoWidth,
getIsMixSidebar, getIsMixSidebar,
getShowSettingButton,
}; };
}, },
}); });
......
...@@ -27,26 +27,3 @@ ...@@ -27,26 +27,3 @@
}, },
}); });
</script> </script>
<style lang="less">
@prefix-cls: ~'@{namespace}-setting-button';
.@{prefix-cls} {
position: absolute;
top: 45%;
right: 0;
z-index: 10;
display: flex;
padding: 10px;
color: @white;
cursor: pointer;
background: @primary-color;
border-radius: 6px 0 0 6px;
justify-content: center;
align-items: center;
svg {
width: 1em;
height: 1em;
}
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册