优化: CR-08 i18n batch2全量(ProjectDetail5处+TaskDetail16key+AiChat3处+store error fallback 23处+useAiSend 3处)+@/i18n路径统一+vite别名
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button class="btn btn-ghost" @click="handleSync">{{ $t('projectDetail.sync') }}</button>
|
||||
<button class="btn btn-ghost" type="button" @click="handleImportDir">导入目录</button>
|
||||
<button class="btn btn-ghost" type="button" @click="handleImportDir">{{ $t('projectDetail.importDir') }}</button>
|
||||
<button class="btn btn-danger" @click="handleDelete">{{ $t('projectDetail.delete') }}</button>
|
||||
<button class="btn btn-primary" @click="showNewTaskModal = true">{{ $t('projectDetail.newTask') }}</button>
|
||||
</div>
|
||||
@@ -198,7 +198,7 @@
|
||||
:disabled="multiDecisions.length === 0"
|
||||
@click="handleApprovalMulti"
|
||||
>
|
||||
确认({{ multiDecisions.length }})
|
||||
{{ $t('projectDetail.approvalConfirm', { count: multiDecisions.length }) }}
|
||||
</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -217,7 +217,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button class="btn btn-ghost" @click="handleCancelApproval">取消</button>
|
||||
<button class="btn btn-ghost" @click="handleCancelApproval">{{ $t('projectDetail.approvalCancel') }}</button>
|
||||
<button class="btn btn-ghost" @click="showApprovalDialog = false">{{ $t('projectDetail.approvalLater') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -383,25 +383,24 @@ async function relocateDir() {
|
||||
}
|
||||
|
||||
// 导入历史项目(选已存在目录 → 后端创建实体+绑定+探测栈+读 README 首段一步完成)
|
||||
// 文案硬编码:projectDetail i18n 不在本次任务白名单,改用内联中文(避免引用不存在的 key)
|
||||
async function handleImportDir() {
|
||||
try {
|
||||
const selected = await open({ directory: true, multiple: false })
|
||||
if (!selected || Array.isArray(selected)) return
|
||||
const dir = selected as string
|
||||
if (!await confirmDialog(`导入目录为新项目?\n${dir}\n\n将自动用目录名作项目名,探测技术栈,并读 README 首段填描述。`)) return
|
||||
if (!await confirmDialog(t('projectDetail.importConfirm', { dir }))) return
|
||||
const record = await store.importProject({ path: dir })
|
||||
if (!record) {
|
||||
// store 已 toast 错误
|
||||
if (store.error) Message.error(store.error)
|
||||
return
|
||||
}
|
||||
Message.success(`已导入项目「${record.name}」`)
|
||||
Message.success(t('projectDetail.importSuccess', { name: record.name }))
|
||||
// 跳转到新导入项目的详情页
|
||||
router.push(`/projects/${record.id}`)
|
||||
} catch (e: any) {
|
||||
console.error('导入失败:', e)
|
||||
Message.error(`导入失败: ${e?.toString() ?? '未知错误'}`)
|
||||
Message.error(t('projectDetail.importFailed', { msg: e?.toString() ?? t('common.unknownError') }))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user