From a2e41f659f1d83577e13b43fce449c4c24e0910d Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 26 Nov 2026 15:51:01 +0800 Subject: [PATCH] =?UTF-8?q?feat(protect):=20=E7=9A=AE=E8=82=A4=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=97=81=E5=8A=A0=E3=80=8C=E6=9F=A5=E7=9C=8B=E3=80=8D?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E7=94=A8=E5=85=A8=E5=B1=8F=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=9F=A5=E7=9C=8B=E5=99=A8=E7=9C=8B=E5=A4=A7=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原来只能 hover 预览图点「看大图」,出来的是带标题栏的普通弹窗,图只是等比 缩在弹窗里,看不清细节。 - 新增 components/image-lightbox.vue:Teleport 到 body 的全屏查看器 · 黑底 92% + backdrop-blur,图片居中 object-contain · 滚轮缩放 100%~600%,顶部显示百分比、+/-/还原按钮,快捷键 + - 0 · 放大后可按住拖动平移(cursor-grab/grabbing),缩回 100% 自动归位 · 双击切换(1x ↔ 1.25x)、Esc / 点空白 / 右上角 X 关闭 · 打开时锁 body 滚动,关闭还原 - 皮肤下拉右边加「查看」按钮(Eye 图标),点开就是查看器 - 预览图上的 hover「看大图」也改为打开同一个查看器 - 删掉旧的 UiDialog 预览弹窗与 previewTheme/openThemePreview/previewOpen --- frontend/src/components/image-lightbox.vue | 203 ++++++++++++++++++ frontend/src/pages/admin/protect/index.vue | 94 ++++---- frontend/src/plugins/i18n/en.json | 1 + frontend/src/plugins/i18n/zh.json | 1 + .../src/types/auto-import-components.d.ts | 2 + 5 files changed, 244 insertions(+), 57 deletions(-) create mode 100644 frontend/src/components/image-lightbox.vue diff --git a/frontend/src/components/image-lightbox.vue b/frontend/src/components/image-lightbox.vue new file mode 100644 index 0000000..971e17b --- /dev/null +++ b/frontend/src/components/image-lightbox.vue @@ -0,0 +1,203 @@ + + + diff --git a/frontend/src/pages/admin/protect/index.vue b/frontend/src/pages/admin/protect/index.vue index c73eb98..7d2e185 100644 --- a/frontend/src/pages/admin/protect/index.vue +++ b/frontend/src/pages/admin/protect/index.vue @@ -4,6 +4,7 @@ import type { Component } from "vue"; import { CheckCircle2, + Eye, FileUp, Loader2, PackageCheck, @@ -19,6 +20,7 @@ import { toast } from "vue-sonner"; import SingleFilter from "@/components/data-table/single-filter.vue"; import ProtectDataTable from "@/pages/admin/protect/components/data-table.vue"; +import ImageLightbox from "@/components/image-lightbox.vue"; import { BasicPage } from "@/components/global-layout"; import api, { BASE_URL } from "@/services/api"; @@ -106,12 +108,8 @@ function themeSub(label: string) { return parts.length > 1 ? parts.slice(1).join("·").trim() : ""; } // 点卡片角上的放大镜看大图 -const previewTheme = ref<{ value: string; label: string } | null>(null); -const previewOpen = ref(false); -function openThemePreview(theme: { value: string; label: string }) { - previewTheme.value = theme; - previewOpen.value = true; -} +// 皮肤大图:全屏图片查看器(滚轮缩放 / 拖动平移 / Esc 关闭) +const lightboxOpen = ref(false); // 组合框选一套,下方预览图跟着切换(不再铺一整片网格) const currentThemeOption = computed( () => @@ -650,21 +648,32 @@ onBeforeUnmount(() => { {{ t("admin.protect.themeLabel") }}
-
- - - - - - - {{ o.label }} - - - +
+
+ + + + + + + {{ o.label }} + + + +
+ + {{ + t("admin.protect.themeView") + }} +
{ type="button" class="absolute inset-0 flex items-end justify-end p-2 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100" :aria-label="t('admin.protect.themeZoom')" - @click=" - openThemePreview({ - value: shellTheme, - label: currentThemeLabel, - }) - " + @click="lightboxOpen = true" > {
- - - - - {{ previewTheme?.label }} - {{ - t("admin.protect.themeZoomHint") - }} - - - - - {{ t("common.close") }} - - - {{ t("admin.protect.themeUseThis") }} - - - - + +
diff --git a/frontend/src/plugins/i18n/en.json b/frontend/src/plugins/i18n/en.json index afe88ec..5b4e712 100644 --- a/frontend/src/plugins/i18n/en.json +++ b/frontend/src/plugins/i18n/en.json @@ -2676,6 +2676,7 @@ "themeBits64": "64-bit", "themeBits32": "32/64-bit", "themeZoom": "Preview", + "themeView": "View", "themeZoomHint": "Actual rendering of the produced verification dialog (raw screenshot)", "themeUseThis": "Use this skin" }, diff --git a/frontend/src/plugins/i18n/zh.json b/frontend/src/plugins/i18n/zh.json index 4c1e333..5afc310 100644 --- a/frontend/src/plugins/i18n/zh.json +++ b/frontend/src/plugins/i18n/zh.json @@ -2695,6 +2695,7 @@ "themeBits64": "64 位", "themeBits32": "32/64 位", "themeZoom": "看大图", + "themeView": "查看", "themeZoomHint": "这是产物验证弹窗的实际渲染效果(截图,未做任何美化)", "themeUseThis": "用这套皮肤" }, diff --git a/frontend/src/types/auto-import-components.d.ts b/frontend/src/types/auto-import-components.d.ts index bcb5dbe..6f24cb5 100644 --- a/frontend/src/types/auto-import-components.d.ts +++ b/frontend/src/types/auto-import-components.d.ts @@ -46,6 +46,7 @@ declare module 'vue' { GlobalLayoutBasicPage: typeof import('./../components/global-layout/basic-page.vue')['default'] GlobalLayoutTwoCol: typeof import('./../components/global-layout/two-col.vue')['default'] GlobalLayoutTwoColAside: typeof import('./../components/global-layout/two-col-aside.vue')['default'] + ImageLightbox: typeof import('./../components/image-lightbox.vue')['default'] InspiraUiFlickeringGrid: typeof import('./../components/inspira-ui/flickering-grid.vue')['default'] InspiraUiGlowingEffect: typeof import('./../components/inspira-ui/glowing-effect.vue')['default'] InspiraUiMarquee: typeof import('./../components/inspira-ui/marquee/index.vue')['default'] @@ -449,6 +450,7 @@ declare global { const GlobalLayoutBasicPage: typeof import('./../components/global-layout/basic-page.vue')['default'] const GlobalLayoutTwoCol: typeof import('./../components/global-layout/two-col.vue')['default'] const GlobalLayoutTwoColAside: typeof import('./../components/global-layout/two-col-aside.vue')['default'] + const ImageLightbox: typeof import('./../components/image-lightbox.vue')['default'] const InspiraUiFlickeringGrid: typeof import('./../components/inspira-ui/flickering-grid.vue')['default'] const InspiraUiGlowingEffect: typeof import('./../components/inspira-ui/glowing-effect.vue')['default'] const InspiraUiMarquee: typeof import('./../components/inspira-ui/marquee/index.vue')['default']