Files
AstrBot/dashboard/src/components/ConfirmDialog.vue
T
IGCrystal 0f95f62aa1 feat: 完成仪表板国际化系统重构
 核心特性:
- 实现模块化i18n架构,支持22个功能模块
- 完成中英双语翻译文件(44个翻译文件)
- 新增懒加载翻译模块,提升性能
- 类型安全的翻译键值验证系统

🌐 国际化覆盖:
- 所有主要页面(15+)完成国际化
- 导航侧边栏、顶栏、共享组件全部支持
- 仪表板统计组件完整国际化
- 登录页面及认证流程完整国际化

🎨 UI/UX 优化:
- 统一顶栏按钮样式(语言切换+主题切换)
- 移动端登录页采用全屏设计
- Logo组件智能换行支持中英文
- 响应式语言切换组件

📱 移动端适配:
- 登录卡片移动端全屏布局
- 悬浮工具栏底部固定定位
- 触摸友好的交互设计
- 多设备响应式支持

🔧 技术改进:
- 模块化翻译文件结构 (core/*, features/*)
- 懒加载机制减少初始包体积
- TypeScript类型定义完整
- 翻译键值自动验证
2025-06-16 13:53:33 +08:00

48 lines
1.4 KiB
Vue

<template>
<v-dialog v-model="isOpen" max-width="400">
<v-card>
<v-card-title class="text-h6">{{ title }}</v-card-title>
<v-card-text>{{ message }}</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="gray" @click="handleCancel">{{ t('core.common.dialog.cancelButton') }}</v-btn>
<v-btn color="red" @click="handleConfirm">{{ t('core.common.dialog.confirmButton') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script setup>
import { ref } from "vue";
import { useI18n } from '@/i18n/composables';
const { t } = useI18n();
const isOpen = ref(false);
const title = ref("");
const message = ref("");
let resolvePromise = null; // ✅ 确保 Promise 句柄可用
const open = (options) => {
title.value = options.title || t('core.common.dialog.confirmTitle');
message.value = options.message || t('core.common.dialog.confirmMessage');
isOpen.value = true;
return new Promise((resolve) => {
resolvePromise = resolve; // ✅ 赋值 Promise 解析方法
});
};
const handleConfirm = () => {
isOpen.value = false;
if (resolvePromise) resolvePromise(true); // ✅ 解析 Promise
};
const handleCancel = () => {
isOpen.value = false;
if (resolvePromise) resolvePromise(false); // ✅ 解析 Promise
};
defineExpose({ open }); // ✅ 确保 `confirmPlugin.ts` 可以访问 `open`
</script>