From 179fd26dd8dbebc5e4a5c0c96000cb4adb5bb376 Mon Sep 17 00:00:00 2001 From: shaw Date: Tue, 29 Jul 2025 18:56:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin-spa):=20=E4=BF=AE=E5=A4=8D=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=BC=B9=E7=AA=97=E5=B1=82=E7=BA=A7=E5=92=8C=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E6=8C=89=E9=92=AE=E5=93=8D=E5=BA=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 提高ConfirmDialog的z-index到100,确保显示在最上层 - 修改确认弹窗样式,使用amber色调作为警告色 - 为API Key弹窗X按钮添加单独的handleDirectClose方法 - 解决确认弹窗被API Key弹窗遮挡的问题 --- .../src/components/apikeys/NewApiKeyModal.vue | 28 +++++++++++++++++-- .../src/components/common/ConfirmDialog.vue | 10 +++++-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/web/admin-spa/src/components/apikeys/NewApiKeyModal.vue b/web/admin-spa/src/components/apikeys/NewApiKeyModal.vue index 13947829..00fd94c9 100644 --- a/web/admin-spa/src/components/apikeys/NewApiKeyModal.vue +++ b/web/admin-spa/src/components/apikeys/NewApiKeyModal.vue @@ -13,8 +13,9 @@ @@ -158,7 +159,7 @@ const copyApiKey = async () => { } } -// 关闭弹窗 +// 关闭弹窗(带确认) const handleClose = async () => { if (window.showConfirm) { const confirmed = await window.showConfirm( @@ -180,6 +181,29 @@ const handleClose = async () => { } } } + +// 直接关闭(不带确认) +const handleDirectClose = async () => { + if (window.showConfirm) { + const confirmed = await window.showConfirm( + '确定要关闭吗?', + '您还没有保存API Key,关闭后将无法再次查看。\n\n建议您先复制API Key再关闭。', + '仍然关闭', + '返回复制' + ) + if (confirmed) { + emit('close') + } + } else { + // 降级方案 + const confirmed = confirm( + '您还没有保存API Key,关闭后将无法再次查看。\n\n确定要关闭吗?' + ) + if (confirmed) { + emit('close') + } + } +}