From 4c3c6a2f280b053e7032dc960482460dd2c6b9b6 Mon Sep 17 00:00:00 2001 From: personal82555 Date: Tue, 13 Oct 2026 15:06:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=94=B9=E4=B8=BA=E4=B8=8B=E6=8B=89=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 去掉手填 path/名称输入框, 改为按分类分组的工具下拉框(80+工具) - 选中自动回填 名称/描述/图标emoji, 描述可微调 - 副标题与底部说明同步(对应精选推荐区块) 验证: 下拉70分类756选项, 选二维码生成器自动填icon/描述, path+name输入框移除 CHANGELOG记录 --- CHANGELOG.md | 6 ++++ src/pages/Admin.page.vue | 78 ++++++++++++++++++++++++++++++++-------- 2 files changed, 70 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c8d58e..c298912 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. See [standa ## Version 2026.10.12-it-tools-pro +### 🏠 首页推荐管理改为下拉选择 +- 「首页推荐管理」去掉手动填写的 path / 名称输入框,改为**按分类分组的工具下拉框**(80+ 工具,11 个分组) +- 选中工具自动回填:名称、描述、图标(emoji),无需任何手填;描述可再微调 +- 副标题与底部说明同步更新(对应「⭐ 精选推荐」区块) + + ### 📌 顶部导航滚动固定 - 顶部导航行(菜单/主页/搜索/语言/用户/授权应用)改为 `position:sticky`,页面滚动时固定在视口最顶部 - `top:-26px` 抵消滚动容器 26px padding 内缩,实现真正贴顶(0 位置);通栏负边距 + 主题背景遮挡滚动内容 diff --git a/src/pages/Admin.page.vue b/src/pages/Admin.page.vue index 37a9a11..f99e651 100644 --- a/src/pages/Admin.page.vue +++ b/src/pages/Admin.page.vue @@ -2,6 +2,7 @@ import { computed, ref } from 'vue'; import { useHead } from '@vueuse/head'; import { useUserAuth } from '@/composable/user-auth'; +import { useToolStore } from '@/tools/tools.store'; useHead({ title: '管理后台 - IT-TOOLS-PRO' }); @@ -310,6 +311,51 @@ function fmtTime(t: number) { const reco = ref([]); const recoBusy = ref(false); +// 工具下拉数据:全部工具按分类分组(选择已有功能,无需手填 path/名称) +const toolStore = useToolStore(); +const toolGroups = computed(() => { + const byCat = new Map(); + for (const t of toolStore.tools) { + const c = t.category || '其他'; + if (!byCat.has(c)) { + byCat.set(c, []); + } + byCat.get(c)!.push({ path: t.path, name: t.name, description: t.description }); + } + return [...byCat.entries()] + .map(([cat, list]) => ({ cat, list: [...list].sort((a, b) => a.name.localeCompare(b.name, 'zh')) })) + .sort((a, b) => a.cat.localeCompare(b.cat, 'zh')); +}); +const toolMap = computed(() => new Map(toolStore.tools.map(t => [t.path, t]))); + +// 常见工具 emoji:选中工具时自动填图标 +const RECO_EMOJI: Record = { + '/ai-chat': '🤖', '/ai-image-lab': '🪄', '/ai-retouch': '🎨', '/copywriting': '✍️', + '/video-tools': '🎥', '/audio-tools': '🎙️', '/seal-maker': '🔴', '/signature-pad': '✍️', + '/zh-convert': '🈶', '/pinyin-converter': '🀄', '/user-center': '👤', '/pricing': '🔑', + '/image-ocr': '🔍', '/pdf-ocr': '📄', '/image-tools': '🖼️', '/pdf-tools': '📑', + '/doc-convert': '🔄', '/text-to-image': '🖼️', '/qrcode-generator': '📱', '/encryption': '🔒', + '/hash-text': '#️⃣', '/jwt-parser': '🎫', '/regex-tester': ' .*', '/json-prettify': '{ }', + '/lorem-ipsum-generator': '📝', '/password-strength-analyser': '🔐', '/color-converter': '🎨', + '/markdown-to-html': 'MD', '/base64-string-converter': '64', '/random-port-generator': '🔌', + '/crontab-generator': '⏰', '/uuid-generator': '🆔', '/token-generator': '🎟️', + '/site-bookmarks': '🔖', '/label-designer': '🏷️', '/emoji-picker': '😀', '/git-memo': '🐙', + '/camera-recorder': '📷', '/chronometer': '⏱️', '/device-information': '💻', '/math-evaluator': '🧮', +}; +function emojiFor(path: string) { + return RECO_EMOJI[path] || '🧰'; +} + +// 选中工具:自动填 名称 / 描述 / 图标(无需手动输入) +function onToolPick(it: any) { + const t = toolMap.value.get(it.path); + if (t) { + it.name = t.name; + it.desc = t.description; + it.icon = emojiFor(t.path); + } +} + async function loadReco() { const b = await api('/admin/reco'); reco.value = (b.data ?? []).map((x: any) => ({ ...x })); @@ -327,7 +373,7 @@ async function saveReco() { } function recoAdd() { - reco.value.unshift({ path: '/', icon: '📌', name: '', desc: '', enabled: true }); + reco.value.unshift({ path: '', icon: '🧰', name: '', desc: '', enabled: true }); } function recoDel(i: number) { @@ -529,7 +575,7 @@ function switchTab(id: 'overview' | 'files' | 'usage' | 'storage' | 'reco') { @@ -724,7 +774,8 @@ function switchTab(id: 'overview' | 'files' | 'usage' | 'storage' | 'reco') { flex-shrink: 0; } - input { + input, + select { border: 1px solid rgba(128, 128, 128, 0.32); border-radius: 7px; padding: 5px 8px; @@ -740,14 +791,13 @@ function switchTab(id: 'overview' | 'files' | 'usage' | 'storage' | 'reco') { .adm-reco-icon { width: 46px; text-align: center; + flex-shrink: 0; } - .adm-reco-path { - width: 150px; - } - - .adm-reco-name { - width: 120px; + .adm-reco-sel { + width: 190px; + flex-shrink: 0; + cursor: pointer; } .adm-reco-desc {