From b1f7589538715204eb14397b36533b9742c1babd Mon Sep 17 00:00:00 2001 From: CNWei Date: Mon, 2 Nov 2026 19:50:51 +0800 Subject: [PATCH] =?UTF-8?q?style(admin):=20=E7=BB=9F=E4=B8=80=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=B1=82=E7=BA=A7=E4=B8=8E=E9=A1=B5=E9=9D=A2=E6=8E=92?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 每个后台页面新增统一的加粗标题 + 说明 + 右侧操作区 - 分组/数据页操作按钮移到标题右侧,取消正文里的『说明:』散排 - 页头/资料/系统改为 820px 窄栏,标签加粗,保存按钮与表单对齐 - 系统管理拆成『修改密码 / 数据备份』两段,按钮不再整行拉伸 - 外层标题改为『后台管理』,侧栏与卡片页去掉重复说明,卡片列表标题加粗 --- stash-web/src/App.css | 63 +++++++- stash-web/src/components/admin/AdminNext.tsx | 154 ++++++++++++------- 2 files changed, 163 insertions(+), 54 deletions(-) diff --git a/stash-web/src/App.css b/stash-web/src/App.css index fa54630..c44b4c3 100644 --- a/stash-web/src/App.css +++ b/stash-web/src/App.css @@ -787,7 +787,67 @@ } .admin-form { - margin-top: var(--su-space-5); + margin-top: 0; +} + +.admin-form-narrow { + max-width: 820px; +} + +/* 每个后台页面统一的标题区 */ +.admin-panel-head { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: var(--su-space-5); + padding-bottom: var(--su-space-4); + border-bottom: 1px solid var(--su-border); + margin-bottom: var(--su-space-2); +} + +.admin-panel-heading { + min-width: 0; +} + +.admin-panel-title { + margin: 0; + color: var(--su-text-main); + font-size: 20px; + font-weight: 700; + line-height: 1.3; + letter-spacing: -0.01em; +} + +.admin-panel-desc { + max-width: 760px; + margin: var(--su-space-2) 0 0; + color: var(--su-text-muted); + font-size: var(--su-font-size-sm); + line-height: 1.65; +} + +.admin-panel-actions { + display: flex; + flex: none; + flex-wrap: wrap; + align-items: center; + justify-content: flex-end; + gap: var(--su-space-2); +} + +/* 表单标签统一加粗,避免组件默认字重在不同字体下发虚 */ +.admin-panel label { + font-weight: 600; +} + +.admin-inline-actions { + display: flex; + gap: var(--su-space-2); +} + +.admin-form-divider { + margin: var(--su-space-1) 0; + border-top: 1px dashed var(--su-border-strong); } .admin-row { @@ -896,6 +956,7 @@ } .admin-actions { + max-width: 820px; margin-top: var(--su-space-6); } diff --git a/stash-web/src/components/admin/AdminNext.tsx b/stash-web/src/components/admin/AdminNext.tsx index c10d3ef..306e2e7 100644 --- a/stash-web/src/components/admin/AdminNext.tsx +++ b/stash-web/src/components/admin/AdminNext.tsx @@ -30,7 +30,7 @@ import { type IconName, type MenuItem, } from '@stash/ui' -import { useEffect, useMemo, useRef, useState } from 'react' +import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react' import { changePassword, fetchSession, logout, type SessionState } from '../../auth' import { LoginDialog } from '../auth/LoginDialog' import { GroupMark as GroupGlyph } from '../common/GroupMark' @@ -127,6 +127,27 @@ function flattenCardsGroups(groups: GroupNode[]) { return flattenGroups(groups) } +/** 后台每个页面统一的标题区:加粗标题 + 说明 + 右侧操作 */ +function PanelHeader({ + title, + description, + children, +}: { + title: string + description?: string + children?: ReactNode +}) { + return ( +
+
+

{title}

+ {description !== undefined &&

{description}

} +
+ {children !== undefined &&
{children}
} +
+ ) +} + export function AdminNext() { const [session, setSession] = useState(null) const [loginOpen, setLoginOpen] = useState(false) @@ -292,9 +313,9 @@ export function AdminNext() {
- 站点设置 + 后台管理 - 分组是唯一容器;侧边栏和内容卡片都只是勾选分组来组合展示。 + 管理内容、首页展示与站点设置。 @@ -332,7 +353,10 @@ export function AdminNext() { {tab === 'home-sidebar' && (
- 侧边栏 + - 内容卡片 - - 说明:卡片是首页上的一个区块;在这里勾选它包含哪些分组,并调整这些分组的先后顺序与预览条数。 - 分组是否启用仍由「分组管理」决定,停用的分组不会出现在卡片里。 - + - - 说明:分组用于控制前台侧边栏与卡片;可多层嵌套,根分组决定格式。内容(条目)只挂在分组上。 - - -
+ -
+
- - 说明:数据只属于一个分组;选中主分组时会连同其所有子分组的数据一起列出。 - - -
-
- ({ + value: option.key, + label: option.title, + }))} + value={group?.key ?? ''} + onChange={setGroupKey} + /> +
+
- - + {group?.title ?? ''} 下共 {rows.length} 条(含子分组) @@ -1333,11 +1356,7 @@ function SidebarPanel({ saving: boolean }) { return ( - - - 说明:分组在侧边栏的显隐只由「分组管理 → 状态」决定;这里只管三块侧栏卡片。 - - +