From 75756e5a64445396a85360f8f31d7d222b2f1161 Mon Sep 17 00:00:00 2001 From: yiqiu Date: Wed, 18 Mar 2026 23:57:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8F=92=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=20UI=20=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Tab 合并 6→4:SEO 并入基础配置,JSON 并入高级配置 - 表单双列 grid 布局,短字段两两并排 - section-body 加 20px 24px 内边距 - 配置项可折叠(▼箭头,点击 header 切换) - 响应式 768px 以下回退单列 - 版权信息和 SEO 描述加 form-item--full 整行 --- .../template/admin/index.html | 62 +++++++------------ .../template/admin/theme.css | 39 +++++++++++- 2 files changed, 60 insertions(+), 41 deletions(-) diff --git a/plugins/addon/theme_configurator/template/admin/index.html b/plugins/addon/theme_configurator/template/admin/index.html index 3bce964..513a0bb 100644 --- a/plugins/addon/theme_configurator/template/admin/index.html +++ b/plugins/addon/theme_configurator/template/admin/index.html @@ -60,13 +60,6 @@ 基础配置 - - - - - - SEO设置 - - 其他配置 - - - - - - - - JSON编辑器 + 高级配置
- +
@@ -120,24 +105,23 @@
- +
- + +
+
+ +
- +
-
- - -
-
+
-
- -

SEO设置

+

搜索引擎优化配置

@@ -180,7 +158,7 @@
-
+
@@ -245,7 +223,7 @@
- +
@@ -266,10 +244,7 @@
-
- -

JSON配置编辑器

@@ -323,6 +298,15 @@ }); }); + // 配置项折叠 — 点击 header 切换 + document.addEventListener('click', (e) => { + const header = e.target.closest('.config-item__header'); + if (!header) return; + // 如果点的是 header 内的按钮(如删除),不触发折叠 + if (e.target.closest('button')) return; + header.closest('.config-item').classList.toggle('collapsed'); + }); + // 加载配置 function loadConfig() { console.log('开始加载配置...'); diff --git a/plugins/addon/theme_configurator/template/admin/theme.css b/plugins/addon/theme_configurator/template/admin/theme.css index d4912c8..8e8778c 100644 --- a/plugins/addon/theme_configurator/template/admin/theme.css +++ b/plugins/addon/theme_configurator/template/admin/theme.css @@ -144,13 +144,18 @@ body { } .section-body { - padding: 0; + padding: 20px 24px; } /* 表单 */ .form-fields { display: grid; - gap: var(--spacing-lg); + grid-template-columns: 1fr 1fr; + gap: 16px 24px; +} + +.form-item--full { + grid-column: 1 / -1; } .form-item { @@ -312,6 +317,28 @@ textarea.form-control { padding: 16px; } +/* 折叠 */ +.config-item__header { + cursor: pointer; + user-select: none; +} + +.config-item__header h4::before { + content: '▼'; + display: inline-block; + margin-right: 6px; + font-size: 10px; + transition: transform 0.2s ease; +} + +.config-item.collapsed .config-item__header h4::before { + transform: rotate(-90deg); +} + +.config-item.collapsed .config-item__body { + display: none; +} + /* JSON编辑器 */ .json-editor { width: 100%; @@ -366,4 +393,12 @@ textarea.form-control { .tab-item { flex-shrink: 0; } + + .form-fields { + grid-template-columns: 1fr; + } + + .section-body { + padding: 16px; + } } \ No newline at end of file