From ee096d0bb7905b61e8c4799e986fbfaede4732ad Mon Sep 17 00:00:00 2001 From: Nixevol Date: Sun, 5 Jul 2026 06:45:51 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=8D=A1=E7=89=87=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aidocs/project_context.md | 1 + apps/admin/src/locales/en-US.json | 7 +- apps/admin/src/locales/zh-CN.json | 7 +- apps/admin/src/views/Settings.vue | 380 ++++++++++++++++++------------ 4 files changed, 242 insertions(+), 153 deletions(-) diff --git a/aidocs/project_context.md b/aidocs/project_context.md index 7a87aa1..047a71a 100644 --- a/aidocs/project_context.md +++ b/aidocs/project_context.md @@ -161,6 +161,7 @@ - 后台详情页图片预览统一(2026-07-05):艺术品详情页中溯源时间轴图片和认证文件封面不再使用 Naive UI `n-image` 预览层,统一改为普通缩略图点击后调用后台 `openMediaViewer`。这样打开样式与后台其他图片预览一致,并能使用 PhotoSwipe 的鼠标滚轮缩放兜底;视频仍保持原页面内原生 video 控件。 - 后台图片预览工具条(2026-07-05):后台 `openMediaViewer` 在 PhotoSwipe 中注册底部工具条,保留 Naive Image 预览常用的向左旋转、向右旋转、还原、缩小、放大、下载、关闭按钮;默认 PhotoSwipe 顶栏关闭/缩放/计数被关闭,避免重复。工具条按钮通过 `appendTo: root` 创建后再用微任务移动到自建 `.artveris-pswp-toolbar`,避免 PhotoSwipe 默认 append 时机把按钮重新挂回根节点导致不可见。图片按钮在视频项自动置灰,视频仍使用现有 video 控件。已用 Codex 内置浏览器验证:作品图片和认证文件预览均显示 7 个底部按钮,放大按钮和鼠标滚轮缩放均生效。 - 后台图片预览工具条国际化(2026-07-05):`openMediaViewer` 不再硬编码工具条 title,统一从 `pages.mediaViewer.*` 读取翻译;`zh-CN/en-US` 已覆盖旋转、还原、缩放、下载、关闭。已用 Codex 内置浏览器切换英文后台验证,预览工具条按钮 title 为 `Rotate left / Rotate right / Reset / Zoom out / Zoom in / Download / Close`。 +- 系统设置卡片布局(2026-07-05):后台「系统设置」去掉基础设置/备份恢复顶部 tab,改为一个连续页面。上方基础配置使用小卡片表单:左侧平台设置,右侧日志设置和备份策略上下排列;保存按钮固定在右上角,不独占工具栏。客户端轮播间隔归入平台设置;查询日志保留天数、操作日志保留天数、备份保留天数、最多保留备份数量等数字输入框使用窄宽并居中显示。备份策略中的“启用定时备份 + 备份周期”合并为一个“定时备份”下拉,选项为关闭/每天/每周;下方直接显示备份与恢复面板。 ## 当前代码基准与注意事项 diff --git a/apps/admin/src/locales/en-US.json b/apps/admin/src/locales/en-US.json index cdb97f6..9a56543 100644 --- a/apps/admin/src/locales/en-US.json +++ b/apps/admin/src/locales/en-US.json @@ -423,8 +423,8 @@ }, "settings": { "baseSettings": "Basic Settings", - "platformInfo": "Platform Info", - "logAndDisplay": "Logs & Display", + "platformInfo": "Platform Settings", + "logAndDisplay": "Log Settings", "backupPolicy": "Backup Policy", "appName": "Platform Name", "appIcon": "System Icon", @@ -435,9 +435,10 @@ "carouselInterval": "Client Carousel Interval (s)", "carouselIntervalHint": "Seconds each media stays; decimals allowed. 0 disables auto-advance (manual loop still works).", "backupEnabled": "Enable Scheduled Backup", - "backupSchedule": "Backup Schedule", + "backupSchedule": "Scheduled Backup", "backupRetentionDays": "Backup Retention Days", "backupRetentionCount": "Max Backup Count", + "scheduleOff": "Off", "scheduleDaily": "Daily", "scheduleWeekly": "Weekly", "saved": "Settings saved" diff --git a/apps/admin/src/locales/zh-CN.json b/apps/admin/src/locales/zh-CN.json index 9ccedf0..9984478 100644 --- a/apps/admin/src/locales/zh-CN.json +++ b/apps/admin/src/locales/zh-CN.json @@ -423,8 +423,8 @@ }, "settings": { "baseSettings": "基础设置", - "platformInfo": "平台信息", - "logAndDisplay": "日志与展示", + "platformInfo": "平台设置", + "logAndDisplay": "日志设置", "backupPolicy": "备份策略", "appName": "平台名称", "appIcon": "系统图标", @@ -435,9 +435,10 @@ "carouselInterval": "客户端轮播间隔(秒)", "carouselIntervalHint": "每张媒体停留秒数,支持小数;填 0 则不自动切换(仍可手动循环切换)", "backupEnabled": "启用定时备份", - "backupSchedule": "备份周期", + "backupSchedule": "定时备份", "backupRetentionDays": "备份保留天数", "backupRetentionCount": "最多保留备份数量", + "scheduleOff": "关闭", "scheduleDaily": "每天", "scheduleWeekly": "每周", "saved": "设置已保存" diff --git a/apps/admin/src/views/Settings.vue b/apps/admin/src/views/Settings.vue index fd530c5..ef95869 100644 --- a/apps/admin/src/views/Settings.vue +++ b/apps/admin/src/views/Settings.vue @@ -1,87 +1,95 @@ @@ -97,10 +105,18 @@ import { DEFAULT_APP_ICON_URL, resolveAppIcon, setFavicon } from '@/utils/appIco const { t } = useI18n(); const saving = ref(false); -const backupScheduleOptions = [ +const backupScheduleOptions = computed(() => [ + { label: t('pages.settings.scheduleOff'), value: 'off' }, { label: t('pages.settings.scheduleDaily'), value: 'daily' }, { label: t('pages.settings.scheduleWeekly'), value: 'weekly' }, -]; +]); +const backupScheduleValue = computed({ + get: () => (form.backupEnabled ? form.backupSchedule : 'off'), + set: (value: string) => { + form.backupEnabled = value !== 'off'; + if (value !== 'off') form.backupSchedule = value; + }, +}); const form = reactive({ appName: '', appIconFiles: [] as Array<{ key: string; url?: string; name?: string; type?: string }>, @@ -168,9 +184,10 @@ const currentIconUrl = computed(() => resolveAppIcon(form.appIconFiles[0]?.url | display: flex; flex-direction: column; overflow: hidden; - padding: 16px; + padding: 14px 16px 16px; } .settings-shell { + position: relative; width: 100%; height: 100%; min-width: 0; @@ -178,106 +195,175 @@ const currentIconUrl = computed(() => resolveAppIcon(form.appIconFiles[0]?.url | display: flex; flex-direction: column; } -.settings-tabs { - flex: 1 1 auto; - width: 100%; - min-height: 0; - display: flex; - flex-direction: column; +.settings-save { + position: absolute; + top: 0; + right: 10px; + z-index: 8; } -.settings-tabs :deep(.n-tabs-pane-wrapper) { - flex: 1 1 auto; - min-height: 0; - padding-top: 12px; -} -.settings-tabs :deep(.n-tab-pane) { +.settings-content { height: 100%; min-height: 0; -} -.settings-base-pane { - height: 100%; overflow: auto; - padding-right: 8px; -} -.settings-backup-pane { - height: 100%; - min-height: 0; + padding: 0 10px 24px 0; } .settings-form { - width: min(980px, 100%); + width: min(1060px, 100%); } -.settings-section { - padding: 16px 0 10px; +.settings-card-grid { + display: grid; + grid-template-columns: minmax(420px, 1fr) minmax(360px, 420px); + align-items: start; + gap: 12px; + padding-right: 84px; +} +.settings-side-stack { + display: grid; + gap: 12px; +} +.settings-card { + overflow: hidden; + border: 1px solid var(--n-border-color); + border-radius: 8px; + background: var(--n-card-color); + box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); +} +.card-title { + display: flex; + align-items: center; + min-height: 36px; + padding: 0 12px; + border-bottom: 1px solid var(--n-border-color); + background: rgba(148, 163, 184, 0.08); + color: var(--n-text-color); + font-size: 14px; + font-weight: 700; + line-height: 20px; +} +.setting-row { + padding: 8px 12px; border-bottom: 1px solid var(--n-border-color); } -.section-title { - font-size: 15px; - font-weight: 600; - margin-bottom: 12px; +.setting-row:last-child { + border-bottom: 0; } -.field-grid { +.settings-form :deep(.n-form-item) { display: grid; - gap: 12px 20px; - align-items: start; + grid-template-columns: 108px minmax(0, 1fr); + grid-template-rows: auto; + grid-template-areas: "label blank"; + align-items: center; + column-gap: 12px; + margin-bottom: 0; } -.field-grid.two { - grid-template-columns: repeat(2, minmax(280px, 1fr)); +.settings-form :deep(.n-form-item-label) { + min-height: auto; + padding: 0; + color: var(--n-text-color-2); + font-weight: 600; + line-height: 20px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } -.field-grid.three { - grid-template-columns: repeat(3, minmax(180px, 1fr)); +.settings-form :deep(.n-form-item-blank) { + min-height: 32px; } -.field-grid.four { - grid-template-columns: repeat(4, minmax(150px, 1fr)); +.setting-row :deep(.n-form-item-feedback-wrapper) { + display: none; } .control-wide { width: 100%; } -.control-short { - width: 100%; +.number-control { + width: 132px; } -.field-stack { - width: 100%; - display: flex; - flex-direction: column; - gap: 4px; +.number-control :deep(.n-input__input-el) { + text-align: center; } -.field-tip { - max-width: 320px; - font-size: 12px; - color: #999; +.select-control { + width: 160px; +} +.setting-label { + color: var(--n-text-color-2); + font-weight: 600; + font-size: 14px; + line-height: 20px; + white-space: nowrap; +} +.icon-row { + display: grid; + grid-template-columns: 108px minmax(0, 1fr); + align-items: center; + column-gap: 12px; } .icon-setting { + display: grid; + grid-template-columns: 60px minmax(0, 1fr); + align-items: center; + gap: 12px; + width: 100%; +} +.icon-preview-wrap { + width: 60px; + min-height: 60px; + border-radius: 8px; + border: 1px solid var(--n-border-color); + background: var(--n-color); display: flex; align-items: center; - gap: 14px; -} -.icon-preview { - width: 52px; - height: 52px; - border-radius: 12px; - border: 1px solid var(--n-border-color); - object-fit: cover; - background: #f6f8fb; + justify-content: center; flex-shrink: 0; } -.switch-field { - display: flex; - align-items: center; - height: 34px; +.icon-preview { + width: 42px; + height: 42px; + border-radius: 10px; + object-fit: cover; + background: var(--n-color); } -.form-actions { - display: flex; - justify-content: flex-start; - padding-top: 18px; +.icon-upload { + min-width: 0; +} +.icon-upload :deep(.image-grid) { + gap: 8px; +} +.icon-upload :deep(.image-item) { + width: 60px; + height: 60px; +} +.icon-upload :deep(.image-item.add span) { + display: none; +} +.settings-backup-panel { + width: min(1060px, 100%); + height: 430px; + min-height: 360px; + margin-top: 12px; + padding: 12px; + border: 1px solid var(--n-border-color); + border-radius: 8px; + background: var(--n-card-color); + box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); } @media (max-width: 900px) { .settings-shell { min-width: 0; } - .field-grid.two, - .field-grid.three, - .field-grid.four { + .settings-card-grid { grid-template-columns: 1fr; + padding-right: 0; + padding-top: 46px; + } + .icon-setting { + grid-template-columns: 60px minmax(0, 1fr); + } +} +@media (max-width: 640px) { + .settings-form :deep(.n-form-item), + .icon-row { + grid-template-columns: 1fr; + row-gap: 8px; } }