fix(admin-spa): 修复确认弹窗层级和关闭按钮响应问题

- 提高ConfirmDialog的z-index到100,确保显示在最上层
- 修改确认弹窗样式,使用amber色调作为警告色
- 为API Key弹窗X按钮添加单独的handleDirectClose方法
- 解决确认弹窗被API Key弹窗遮挡的问题
This commit is contained in:
shaw
2025-07-29 18:56:11 +08:00
parent d761e89925
commit 179fd26dd8
2 changed files with 33 additions and 5 deletions

View File

@@ -13,8 +13,9 @@
</div>
</div>
<button
@click="handleClose"
@click="handleDirectClose"
class="text-gray-400 hover:text-gray-600 transition-colors"
title="直接关闭(不推荐)"
>
<i class="fas fa-times text-xl"></i>
</button>
@@ -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')
}
}
}
</script>
<style scoped>