优化: CR-08 i18n batch2全量(ProjectDetail5处+TaskDetail16key+AiChat3处+store error fallback 23处+useAiSend 3处)+@/i18n路径统一+vite别名

This commit is contained in:
2026-06-15 15:06:21 +08:00
parent d6eb8551da
commit 6254d06c7a
24 changed files with 181 additions and 34 deletions

View File

@@ -104,7 +104,7 @@
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>
</button>
<!-- 清空对话(真删 DB messages,带二次确认防误删) -->
<button class="ai-btn-icon" @click="confirmClearChat" title="清空">
<button class="ai-btn-icon" @click="confirmClearChat" :title="$t('aiChat.clearChat')">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"/><path d="M10 11v6"/><path d="M14 11v6"/><path d="M9 6V4a1 1 0 011-1h4a1 1 0 011 1v2"/></svg>
</button>
<!-- 嵌入模式最大化/还原 + 分离 + 关闭 -->
@@ -468,8 +468,7 @@ async function confirmDeleteConversation(id: string) {
/** 清空当前对话(真删 DB messages,带二次确认防误删) */
async function confirmClearChat() {
// i18n 不在本任务白名单:文案硬编码,后续补 aiChat.confirmClearChat key
if (!await confirmDialog('确定清空当前对话的所有消息?此操作不可恢复。')) return
if (!await confirmDialog(t('aiChat.confirmClearChat'))) return
await store.clearChat()
}
@@ -685,7 +684,7 @@ async function handleSend() {
pendingSkill.value = skill
// 用户可见提示(原仅 console.error,用户无感);Tauri IPC 错误是字符串非 Error 对象
const msg = e instanceof Error ? e.message : String(e)
showToast(`发送失败:${msg}`, 'error')
showToast(t('aiChat.toastSendFail', { msg }), 'error')
}
await nextTick()
scrollToBottom()