mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
fix(admin-spa): 修复确认弹窗层级和关闭按钮响应问题
- 提高ConfirmDialog的z-index到100,确保显示在最上层 - 修改确认弹窗样式,使用amber色调作为警告色 - 为API Key弹窗X按钮添加单独的handleDirectClose方法 - 解决确认弹窗被API Key弹窗遮挡的问题
This commit is contained in:
@@ -13,8 +13,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
@click="handleClose"
|
@click="handleDirectClose"
|
||||||
class="text-gray-400 hover:text-gray-600 transition-colors"
|
class="text-gray-400 hover:text-gray-600 transition-colors"
|
||||||
|
title="直接关闭(不推荐)"
|
||||||
>
|
>
|
||||||
<i class="fas fa-times text-xl"></i>
|
<i class="fas fa-times text-xl"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -158,7 +159,7 @@ const copyApiKey = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗(带确认)
|
||||||
const handleClose = async () => {
|
const handleClose = async () => {
|
||||||
if (window.showConfirm) {
|
if (window.showConfirm) {
|
||||||
const confirmed = await 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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
<Transition name="modal" appear>
|
<Transition name="modal" appear>
|
||||||
<div
|
<div
|
||||||
v-if="isVisible"
|
v-if="isVisible"
|
||||||
class="fixed inset-0 modal z-50 flex items-center justify-center p-4"
|
class="fixed inset-0 modal z-[100] flex items-center justify-center p-4"
|
||||||
@click.self="handleCancel"
|
@click.self="handleCancel"
|
||||||
>
|
>
|
||||||
<div class="modal-content w-full max-w-md p-6 mx-auto">
|
<div class="modal-content w-full max-w-md p-6 mx-auto">
|
||||||
<div class="flex items-start gap-4 mb-6">
|
<div class="flex items-start gap-4 mb-6">
|
||||||
<div class="flex-shrink-0 w-12 h-12 bg-gradient-to-br from-red-500 to-red-600 rounded-xl flex items-center justify-center">
|
<div class="flex-shrink-0 w-12 h-12 bg-gradient-to-br from-amber-500 to-amber-600 rounded-xl flex items-center justify-center">
|
||||||
<i class="fas fa-exclamation-triangle text-white text-lg"></i>
|
<i class="fas fa-exclamation-triangle text-white text-lg"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@click="handleConfirm"
|
@click="handleConfirm"
|
||||||
class="btn btn-danger px-6 py-3"
|
class="btn btn-warning px-6 py-3"
|
||||||
:class="{ 'opacity-50 cursor-not-allowed': isProcessing }"
|
:class="{ 'opacity-50 cursor-not-allowed': isProcessing }"
|
||||||
:disabled="isProcessing"
|
:disabled="isProcessing"
|
||||||
>
|
>
|
||||||
@@ -147,6 +147,10 @@ defineExpose({
|
|||||||
@apply bg-red-600 text-white hover:bg-red-700 focus:ring-red-500;
|
@apply bg-red-600 text-white hover:bg-red-700 focus:ring-red-500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-warning {
|
||||||
|
@apply bg-amber-600 text-white hover:bg-amber-700 focus:ring-amber-500;
|
||||||
|
}
|
||||||
|
|
||||||
.loading-spinner {
|
.loading-spinner {
|
||||||
@apply w-4 h-4 border-2 border-gray-300 border-t-white rounded-full animate-spin;
|
@apply w-4 h-4 border-2 border-gray-300 border-t-white rounded-full animate-spin;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user