feat(web): 全局中文 locale;管理面固定外壳、内容区独立滚动

This commit is contained in:
2026-10-07 20:56:55 +08:00
parent 7ff87888a3
commit bd5a9bf99f
2 changed files with 27 additions and 6 deletions
+8 -1
View File
@@ -1,7 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
// 路由出口——逻辑骨架阶段无装饰 // 路由出口 + 全局中文(DatePicker 等默认 en-US,须用 ConfigProvider)
import zhCN from "antdv-next/locale/zh_CN";
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
dayjs.locale("zh-cn");
</script> </script>
<template> <template>
<a-config-provider :locale="zhCN">
<router-view /> <router-view />
</a-config-provider>
</template> </template>
+18 -4
View File
@@ -114,7 +114,7 @@ async function onUserMenuClick({ key }: MenuInfo) {
@click="onMenuClick" @click="onMenuClick"
/> />
</a-layout-sider> </a-layout-sider>
<a-layout> <a-layout class="admin-layout__main">
<a-layout-header class="admin-layout__header"> <a-layout-header class="admin-layout__header">
<a-dropdown <a-dropdown
:menu="{ items: userMenuItems }" :menu="{ items: userMenuItems }"
@@ -148,8 +148,18 @@ async function onUserMenuClick({ key }: MenuInfo) {
</template> </template>
<style scoped> <style scoped>
/* 固定外壳:侧栏 + 顶栏不动,仅内容区滚动 */
.admin-layout { .admin-layout {
min-height: 100vh; height: 100vh;
overflow: hidden;
}
.admin-layout__main {
height: 100vh;
min-width: 0;
display: flex;
flex-direction: column;
overflow: hidden;
} }
/* /*
@@ -218,6 +228,7 @@ async function onUserMenuClick({ key }: MenuInfo) {
} }
.admin-layout__header { .admin-layout__header {
flex: 0 0 64px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
@@ -267,13 +278,16 @@ async function onUserMenuClick({ key }: MenuInfo) {
} }
.admin-layout__content { .admin-layout__content {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
overflow-x: hidden;
background: #f5f5f5; background: #f5f5f5;
padding: 24px; padding: 24px;
min-height: calc(100vh - 64px);
} }
.admin-layout__surface { .admin-layout__surface {
padding: 24px; padding: 24px;
min-height: calc(100vh - 64px - 48px); min-height: 100%;
} }
</style> </style>