修复维护通知自适应布局与导航重复焦点
This commit is contained in:
1 parent
a6b2bfd4dc
commit
b4915d0ae5
12 files changed
+438
-49
No files matched your search
@@ -2,7 +2,7 @@
|
||||
/* 导入方:app/components/OperationToasts.vue、nuxt.config.ts。 */
|
||||
.operation-toasts.p-toast {
|
||||
width: min(380px, 100% - 24px);
|
||||
top: 76px !important;
|
||||
top: calc(var(--console-top-offset, 56px) + 20px) !important;
|
||||
right: 20px !important;
|
||||
}
|
||||
.operation-toasts .p-toast-message {
|
||||
@@ -64,7 +64,7 @@
|
||||
/* 视口条件 (width<=600px) 下的响应式覆盖;保留相对基础规则的层叠顺序。 */
|
||||
@media (width<=600px) {
|
||||
.operation-toasts.p-toast {
|
||||
top: 68px !important;
|
||||
top: calc(var(--console-top-offset, 56px) + 12px) !important;
|
||||
right: 12px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
gap: 18px;
|
||||
display: flex;
|
||||
position: sticky;
|
||||
top: 76px;
|
||||
top: calc(var(--console-top-offset, 56px) + 20px);
|
||||
}
|
||||
.cart-foot h3[data-v-11d8a39a] {
|
||||
margin: 0;
|
||||
|
||||
@@ -326,7 +326,7 @@ summary[data-v-e16eb167]:focus-visible {
|
||||
@media (width>=1024px) {
|
||||
.catalog-lines[data-v-e16eb167] {
|
||||
position: sticky;
|
||||
top: 76px;
|
||||
top: calc(var(--console-top-offset, 56px) + 20px);
|
||||
}
|
||||
}
|
||||
/* 视口条件 (width<=1199px) 下的响应式覆盖;保留相对基础规则的层叠顺序。 */
|
||||
|
||||
@@ -4,23 +4,30 @@
|
||||
background: var(--console-page-bg);
|
||||
min-height: 100dvh;
|
||||
color: var(--p-text-color, #334155);
|
||||
padding-top: 56px;
|
||||
}
|
||||
.console-layout.has-banner[data-v-1a9c3b51] {
|
||||
padding-top: 94px;
|
||||
padding-top: var(--console-top-offset, 56px);
|
||||
}
|
||||
.maintenance-banner[data-v-1a9c3b51] {
|
||||
z-index: 150;
|
||||
color: #92400e;
|
||||
background: #fef3c7;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
height: 38px;
|
||||
padding: 0 14px;
|
||||
min-height: 38px;
|
||||
max-height: 40dvh;
|
||||
padding: 8px 14px;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
inset: 0 0 auto;
|
||||
}
|
||||
.maintenance-banner > span[data-v-1a9c3b51] {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.maintenance-banner > i[data-v-1a9c3b51] {
|
||||
flex-shrink: 0;
|
||||
margin-top: 3px;
|
||||
}
|
||||
/* 桌面侧栏与移动端导航共享的外壳;断点覆盖会改变其宽度/可见性。 */
|
||||
.sidebar[data-v-1a9c3b51] {
|
||||
z-index: 30;
|
||||
@@ -28,7 +35,7 @@
|
||||
border-right: 1px solid var(--console-panel-border);
|
||||
width: 210px;
|
||||
position: fixed;
|
||||
top: 56px;
|
||||
top: var(--console-top-offset, 56px);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
@@ -146,22 +153,20 @@
|
||||
.main[data-v-1a9c3b51] {
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
min-height: calc(100dvh - 56px);
|
||||
min-height: calc(100dvh - var(--console-top-offset, 56px));
|
||||
margin-left: 210px;
|
||||
display: flex;
|
||||
}
|
||||
.has-banner .main[data-v-1a9c3b51] {
|
||||
min-height: calc(100dvh - 94px);
|
||||
}
|
||||
/* 顶栏与维护提示、主内容定位配合,避免固定元素遮挡可操作内容。 */
|
||||
.topbar[data-v-1a9c3b51] {
|
||||
z-index: 35;
|
||||
background: var(--console-panel-bg);
|
||||
border-bottom: 1px solid var(--console-panel-border);
|
||||
gap: 0;
|
||||
height: 56px;
|
||||
height: var(--console-header-height, 56px);
|
||||
position: fixed;
|
||||
inset: 0 0 auto;
|
||||
top: var(--console-banner-height, 0px);
|
||||
}
|
||||
.brand-group[data-v-1a9c3b51],
|
||||
.topbar[data-v-1a9c3b51] {
|
||||
@@ -435,12 +440,6 @@
|
||||
.skip-link[data-v-1a9c3b51]:focus {
|
||||
transform: translateY(0);
|
||||
}
|
||||
.has-banner .topbar[data-v-1a9c3b51] {
|
||||
top: 38px;
|
||||
}
|
||||
.has-banner .sidebar[data-v-1a9c3b51] {
|
||||
top: 94px;
|
||||
}
|
||||
/* 视口条件 (width<=1535px) 下的响应式覆盖;保留相对基础规则的层叠顺序。 */
|
||||
@media (width<=1535px) {
|
||||
.main[data-v-1a9c3b51] {
|
||||
@@ -451,7 +450,7 @@
|
||||
border-right: 0;
|
||||
width: 280px;
|
||||
transition: transform 0.2s;
|
||||
top: 0;
|
||||
top: var(--console-banner-height, 0px);
|
||||
transform: translate(-100%);
|
||||
}
|
||||
.sidebar.open[data-v-1a9c3b51] {
|
||||
@@ -466,9 +465,6 @@
|
||||
.brand-group[data-v-1a9c3b51] {
|
||||
flex: none;
|
||||
}
|
||||
.has-banner .sidebar[data-v-1a9c3b51] {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
/* 视口条件 (width<=767px) 下的响应式覆盖;保留相对基础规则的层叠顺序。 */
|
||||
@media (width<=767px) {
|
||||
|
||||
@@ -1472,7 +1472,7 @@ video {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
padding: 16px 14px;
|
||||
scroll-margin-top: 75px;
|
||||
scroll-margin-top: calc(var(--console-top-offset, 56px) + 19px);
|
||||
box-shadow: 0 1px 3px #0000001a;
|
||||
}
|
||||
.config-checkout .section-title {
|
||||
@@ -1690,7 +1690,7 @@ video {
|
||||
@media (width>=1024px) {
|
||||
.config-summary-wrap {
|
||||
position: sticky;
|
||||
top: 76px;
|
||||
top: calc(var(--console-top-offset, 56px) + 20px);
|
||||
}
|
||||
}
|
||||
/* 视口条件 (width<=1199px) 下的响应式覆盖;保留相对基础规则的层叠顺序。 */
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
.help-nav[data-v-2e1fbf8d] {
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
max-height: calc(100dvh - 104px);
|
||||
max-height: calc(100dvh - var(--console-top-offset, 56px) - 48px);
|
||||
padding: 20px 14px 16px;
|
||||
display: flex;
|
||||
position: sticky;
|
||||
top: 78px;
|
||||
top: calc(var(--console-top-offset, 56px) + 22px);
|
||||
}
|
||||
.nav-heading[data-v-2e1fbf8d] {
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -777,6 +777,7 @@ var ce = {
|
||||
{
|
||||
default: withCtx(() => [
|
||||
createVNode(o, {
|
||||
as: `span`,
|
||||
label: `前往安全组管理`,
|
||||
size: `small`,
|
||||
severity: `secondary`,
|
||||
@@ -857,6 +858,7 @@ var ce = {
|
||||
{
|
||||
default: withCtx(() => [
|
||||
createVNode(o, {
|
||||
as: `span`,
|
||||
label: `前往域名白名单`,
|
||||
size: `small`,
|
||||
severity: `secondary`,
|
||||
|
||||
+53
-18
@@ -137,6 +137,28 @@ var Ce = {
|
||||
O = useRoute(),
|
||||
k = useTheme_t(),
|
||||
A = useSiteConfig_t();
|
||||
// 固定层共用实际维护条高度,避免换行、字体加载或窗口变化后仍按单行常量占位。
|
||||
const maintenanceBanner = ref(null);
|
||||
const bannerHeight = ref(0);
|
||||
let bannerObserver;
|
||||
watch(
|
||||
maintenanceBanner,
|
||||
(element) => {
|
||||
bannerObserver?.disconnect();
|
||||
const measure = () => {
|
||||
bannerHeight.value = element
|
||||
? Math.ceil(element.getBoundingClientRect().height)
|
||||
: 0;
|
||||
};
|
||||
measure();
|
||||
if (element) {
|
||||
bannerObserver = new ResizeObserver(measure);
|
||||
bannerObserver.observe(element);
|
||||
}
|
||||
},
|
||||
{ flush: "post" },
|
||||
);
|
||||
onBeforeUnmount(() => bannerObserver?.disconnect());
|
||||
onMounted(() => {
|
||||
(A.load().catch(() => {}),
|
||||
w.isLoggedIn && !w.overview && w.fetchOverview().catch(() => {}),
|
||||
@@ -548,6 +570,15 @@ var Ce = {
|
||||
return (
|
||||
useHead(() => ({
|
||||
title: `${$.value.at(-1) || `会员中心`} - ${A.siteName.value}`,
|
||||
// 通知 Teleport 在 body,变量发布到 html;Unhead 随布局卸载逐属性清理,不影响主题样式。
|
||||
htmlAttrs: {
|
||||
style: {
|
||||
"--console-header-height": "56px",
|
||||
"--console-banner-height": `${A.maintenance.value ? bannerHeight.value : 0}px`,
|
||||
"--console-top-offset":
|
||||
"calc(var(--console-header-height) + var(--console-banner-height))",
|
||||
},
|
||||
},
|
||||
})),
|
||||
// 导航、面包屑和账户/消息浮层来自同一布局状态;移动侧栏需保留焦点约束与滚动锁清理。
|
||||
(e, r) => {
|
||||
@@ -591,25 +622,29 @@ var Ce = {
|
||||
: createCommentVNode(``, !0),
|
||||
unref(A).maintenance.value
|
||||
? (openBlock(),
|
||||
createElementBlock(`div`, Ce, [
|
||||
(r[6] ||= createElementVNode(
|
||||
`i`,
|
||||
{
|
||||
class: `pi pi-exclamation-triangle`,
|
||||
},
|
||||
null,
|
||||
-1,
|
||||
)),
|
||||
createElementVNode(
|
||||
`span`,
|
||||
null,
|
||||
toDisplayString(
|
||||
unref(A).config.value?.maintenance_mode_message ||
|
||||
`站点维护中,部分功能可能不可用。`,
|
||||
createElementBlock(
|
||||
`div`,
|
||||
{ ...Ce, ref: maintenanceBanner },
|
||||
[
|
||||
(r[6] ||= createElementVNode(
|
||||
`i`,
|
||||
{
|
||||
class: `pi pi-exclamation-triangle`,
|
||||
},
|
||||
null,
|
||||
-1,
|
||||
)),
|
||||
createElementVNode(
|
||||
`span`,
|
||||
null,
|
||||
toDisplayString(
|
||||
unref(A).config.value?.maintenance_mode_message ||
|
||||
`站点维护中,部分功能可能不可用。`,
|
||||
),
|
||||
1,
|
||||
),
|
||||
1,
|
||||
),
|
||||
]))
|
||||
],
|
||||
))
|
||||
: createCommentVNode(``, !0),
|
||||
createElementVNode(
|
||||
`aside`,
|
||||
|
||||
@@ -75,6 +75,8 @@ var m = defineComponent({
|
||||
{
|
||||
default: withCtx(() => [
|
||||
createVNode(g, {
|
||||
// 导航只保留外层链接的焦点;内层保留按钮外观,不再生成第二个交互元素。
|
||||
as: `span`,
|
||||
label: `订购云服务器`,
|
||||
icon: `pi pi-plus`,
|
||||
}),
|
||||
|
||||
@@ -75,6 +75,8 @@ var m = defineComponent({
|
||||
{
|
||||
default: withCtx(() => [
|
||||
createVNode(g, {
|
||||
// 外层 NuxtLink 独占导航语义,避免链接里再次嵌套按钮焦点。
|
||||
as: `span`,
|
||||
label: `订购物理服务器`,
|
||||
icon: `pi pi-plus`,
|
||||
}),
|
||||
|
||||
@@ -227,6 +227,7 @@ var ie = {
|
||||
{
|
||||
default: withCtx(() => [
|
||||
createVNode(f, {
|
||||
as: `span`,
|
||||
label: `创建工单`,
|
||||
icon: `pi pi-plus`,
|
||||
}),
|
||||
@@ -398,6 +399,7 @@ var ie = {
|
||||
{
|
||||
default: withCtx(() => [
|
||||
createVNode(f, {
|
||||
as: `span`,
|
||||
label: `创建工单`,
|
||||
icon: `pi pi-plus`,
|
||||
size: `small`,
|
||||
|
||||
Reference in new issue
Block a user