修复: 页面反馈真实性与竞态守卫八处
- 知识创建失败不再误关弹窗弹成功提示(补返回值检查) - AuditLog 翻页补请求序号守卫防慢响应覆盖新页 - TaskDrawer 切任务慢响应校验 taskId 才写入 - GitChanges 竞态序号+moduleId 双校验,三处静默失败补错误提示 - 回收站恢复/彻底删除操作中禁用防双击重复提交 - 灵感状态切换失败补错误反馈(原 unhandled rejection) - FileExplorer 三处失败仅 console 补 Message 提示 - Dashboard 消费 store.error 故障不再伪装空数据
This commit is contained in:
+19
-4
@@ -80,8 +80,8 @@
|
||||
<span class="trash-date">{{ formatDate(p.updated_at) }} {{ $t('projects.movedIn') }}</span>
|
||||
</div>
|
||||
<div class="trash-actions">
|
||||
<button class="btn btn-ghost btn-sm" @click="handleRestore(p.id)">{{ $t('projects.restore') }}</button>
|
||||
<button class="btn btn-danger btn-sm" @click="handlePurge(p)">{{ $t('projects.purge') }}</button>
|
||||
<button class="btn btn-ghost btn-sm" :disabled="!!restoringId || !!purgingId" @click="handleRestore(p.id)">{{ $t('projects.restore') }}</button>
|
||||
<button class="btn btn-danger btn-sm" :disabled="!!restoringId || !!purgingId" @click="handlePurge(p)">{{ $t('projects.purge') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -313,6 +313,9 @@ async function submitCreate() {
|
||||
|
||||
// ── 删除 / 回收站 ──
|
||||
const showTrashModal = ref(false)
|
||||
// 回收站操作 pending 守卫:操作中禁用按钮,防双击重复提交/并发互踩
|
||||
const restoringId = ref<string | null>(null)
|
||||
const purgingId = ref<string | null>(null)
|
||||
|
||||
async function handleDelete(project: ProjectRecord) {
|
||||
if (!await confirmDialog(t('projects.confirmDelete', { name: project.name }))) return
|
||||
@@ -325,12 +328,24 @@ async function openTrash() {
|
||||
}
|
||||
|
||||
async function handleRestore(id: string) {
|
||||
await store.restoreProject(id)
|
||||
if (restoringId.value || purgingId.value) return
|
||||
restoringId.value = id
|
||||
try {
|
||||
await store.restoreProject(id)
|
||||
} finally {
|
||||
restoringId.value = null
|
||||
}
|
||||
}
|
||||
|
||||
async function handlePurge(project: ProjectRecord) {
|
||||
if (!await confirmDialog(t('projects.confirmPurge', { name: project.name }))) return
|
||||
await store.purgeProject(project.id)
|
||||
if (restoringId.value || purgingId.value) return
|
||||
purgingId.value = project.id
|
||||
try {
|
||||
await store.purgeProject(project.id)
|
||||
} finally {
|
||||
purgingId.value = null
|
||||
}
|
||||
}
|
||||
|
||||
// ── 加载 ──
|
||||
|
||||
Reference in New Issue
Block a user