From 1a49544d95ff2d1505e5ebf67665afd66dbc5a87 Mon Sep 17 00:00:00 2001 From: kicer Date: Thu, 24 Sep 2026 10:17:51 +0800 Subject: [PATCH] =?UTF-8?q?data-page=E8=BF=94=E5=9B=9E=E9=94=AE=E9=87=8D?= =?UTF-8?q?=E5=81=9A(=E8=AF=84=E5=AE=A1:=E7=8B=AC=E7=AB=8B=E6=88=90?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=E3=80=8C=E2=86=90=E9=A6=96=E9=A1=B5=E3=80=8D?= =?UTF-8?q?crumb=E7=99=BD=E5=8D=A0=E4=B8=80=E8=A1=8C=E5=9E=82=E7=9B=B4?= =?UTF-8?q?=E7=A9=BA=E9=97=B4):=E6=94=B9=E4=B8=BA=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E8=A1=8C=E5=86=85=E5=B5=8C28px=E5=9C=86=E5=BD=A2=E3=80=8C?= =?UTF-8?q?=E2=80=B9=E3=80=8D=E8=BF=94=E5=9B=9E=E9=94=AE=E2=80=94=E2=80=94?= =?UTF-8?q?table=E5=A1=9E=E8=BF=9Bcard=E7=9A=84.hd(h1=E5=8A=A0flex:1?= =?UTF-8?q?=E6=92=91=E5=BC=80,=E6=96=B0=E5=A2=9E=E9=92=AE=E4=BB=8D?= =?UTF-8?q?=E5=B1=85=E5=8F=B3),dashboard/kanban=E5=8A=A0.page-hd=20flex?= =?UTF-8?q?=E8=A1=8C=E5=8C=85h1(h1=E7=9A=84textContent=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=B8=8D=E5=8F=97=E5=BD=B1=E5=93=8D,crumb?= =?UTF-8?q?=E6=98=AF=E5=85=84=E5=BC=9F=E8=8A=82=E7=82=B9);base.css?= =?UTF-8?q?=E6=8D=A2.crumb=E8=A7=84=E5=88=99(=E5=9C=86=E5=BD=A2/hover?= =?UTF-8?q?=E6=B7=A1=E8=93=9D=E5=BA=95/=E4=B8=8D=E5=8D=A0=E9=A2=9D?= =?UTF-8?q?=E5=A4=96=E8=A1=8C=E9=AB=98)=E5=B9=B6=E6=96=B0=E5=A2=9E.page-hd?= =?UTF-8?q?;=E5=8D=95=E9=A1=B5=E5=AE=88=E5=8D=AB=E4=B8=8D=E5=8F=98(?= =?UTF-8?q?=E5=89=AF=E6=9C=AC=E5=8D=B3index=E6=97=B6querySelector=E7=A7=BB?= =?UTF-8?q?=E9=99=A4crumb,=E6=A0=87=E9=A2=98=E8=A1=8C=E8=87=AA=E7=84=B6?= =?UTF-8?q?=E5=9B=9E=E8=90=BD=E4=B8=BAh1);SKILL.md=E6=AD=A5=E9=AA=A45?= =?UTF-8?q?=E5=8F=A3=E5=BE=84=E5=90=8C=E6=AD=A5;=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E6=89=8B=E5=B7=A5=E5=88=B7=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?(index=E5=AF=BC=E8=88=AA=E5=89=AF=E6=9C=AC=E4=B8=8D=E7=A2=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/data-page/SKILL.md | 4 ++-- skills/data-page/templates/base.css | 10 +++++++--- skills/data-page/templates/dashboard.html | 8 +++++--- skills/data-page/templates/kanban.html | 6 ++++-- skills/data-page/templates/table.html | 6 +++--- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/skills/data-page/SKILL.md b/skills/data-page/SKILL.md index b61d259..1194fbb 100644 --- a/skills/data-page/SKILL.md +++ b/skills/data-page/SKILL.md @@ -83,8 +83,8 @@ const taskId = location.pathname.split('/').filter(Boolean)[1]; 3. **初始化**:调用 `skill(name="data-page", op="run")`。 4. **为每个要生成的页面写 config 文件**(见下一节)。**不要读也不要改模板本身**。 5. **选定入口页 `.app/index.html`**(index 是副本,允许编辑;模板本体不动): - - **用到 ≥2 个模板页** → `cp .app/nav.html .app/index.html`,改标题为业务名,并把未启用页面的卡片删掉(没配过的页点开会报 no such table)。子页顶部的「← 首页」链回此导航页。 - - **只用 1 个模板** → `cp .app/<模板>.html .app/index.html`(同目录复制,引用路径不变)。副本指向自身时「← 首页」会被页面脚本自动隐藏,无需处理。 + - **用到 ≥2 个模板页** → `cp .app/nav.html .app/index.html`,改标题为业务名,并把未启用页面的卡片删掉(没配过的页点开会报 no such table)。子页标题左侧的「‹」返回键链回此导航页。 + - **只用 1 个模板** → `cp .app/<模板>.html .app/index.html`(同目录复制,引用路径不变)。副本指向自身时「‹」返回键会被页面脚本自动移除,无需处理。 6. **告知用户**:把 run 输出末尾「访问地址」那行的完整 URL 发给用户,再简要说明页面功能。 默认只写 config 就够。模板无法覆盖需求时,才走自定义路径(见「自定义页面」一节)。 diff --git a/skills/data-page/templates/base.css b/skills/data-page/templates/base.css index 6399444..3dd0e48 100644 --- a/skills/data-page/templates/base.css +++ b/skills/data-page/templates/base.css @@ -19,9 +19,13 @@ body { padding: 16px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); } .container { max-width: 1200px; margin: 0 auto; } -/* 子页→首页面包屑(单页场景脚本会自动移除,见各模板尾部守卫) */ -.crumb { display: inline-block; color: var(--text-2); text-decoration: none; font-size: 13px; margin: 0 0 8px; } -.crumb:hover { color: var(--accent); } +/* 子页→首页返回键:贴在标题同一行,不占额外行高(单页场景脚本自动移除,见各模板尾部守卫) */ +.crumb { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; + width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; + color: var(--text-2); text-decoration: none; font-size: 20px; line-height: 1; } +.crumb:hover { color: var(--accent); background: rgba(0,113,227,0.08); } +.page-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; } +.page-hd h1 { margin: 0; } h1 { font-size: 20px; margin: 4px 0 20px; letter-spacing: -0.02em; } /* ── 卡片 ─────────────────────────────────────────────── */ diff --git a/skills/data-page/templates/dashboard.html b/skills/data-page/templates/dashboard.html index bf35b74..a291062 100644 --- a/skills/data-page/templates/dashboard.html +++ b/skills/data-page/templates/dashboard.html @@ -11,8 +11,10 @@
- ← 首页 -

数据看板

+
+ ‹ +

数据看板

+

分布

@@ -105,7 +107,7 @@ function backToApp() { location.href = id ? '/?s=' + encodeURIComponent(id) : '/'; } -// 单页场景:本页的副本就是 index.html,「← 首页」指向自身 → 移除(多页导航不受影响) +// 单页场景:本页的副本就是 index.html,标题行返回键指向自身 → 移除(多页导航不受影响) if (/\/(index\.html)?$/.test(location.pathname)) { const c = document.querySelector('.crumb'); if (c) c.remove(); } init(); diff --git a/skills/data-page/templates/kanban.html b/skills/data-page/templates/kanban.html index d151b26..dd3b32f 100644 --- a/skills/data-page/templates/kanban.html +++ b/skills/data-page/templates/kanban.html @@ -11,8 +11,10 @@
-← 首页 +
+‹

看板

+
加载中…
@@ -118,7 +120,7 @@ function backToApp() { location.href = id ? '/?s=' + encodeURIComponent(id) : '/'; } -// 单页场景:本页的副本就是 index.html,「← 首页」指向自身 → 移除(多页导航不受影响) +// 单页场景:本页的副本就是 index.html,标题行返回键指向自身 → 移除(多页导航不受影响) if (/\/(index\.html)?$/.test(location.pathname)) { const c = document.querySelector('.crumb'); if (c) c.remove(); } load(); diff --git a/skills/data-page/templates/table.html b/skills/data-page/templates/table.html index 5b7f61b..c4ba61e 100644 --- a/skills/data-page/templates/table.html +++ b/skills/data-page/templates/table.html @@ -8,9 +8,9 @@
- ← 首页
+ ‹

数据表格

@@ -39,7 +39,7 @@ @@ -241,7 +241,7 @@ function backToApp() { location.href = id ? '/?s=' + encodeURIComponent(id) : '/'; } -// 单页场景:本页的副本就是 index.html,「← 首页」指向自身 → 移除(多页导航不受影响) +// 单页场景:本页的副本就是 index.html,标题行返回键指向自身 → 移除(多页导航不受影响) if (/\/(index\.html)?$/.test(location.pathname)) { const c = document.querySelector('.crumb'); if (c) c.remove(); } load();