fix publish record deletion
Desktop Client Build / Resolve Build Metadata (push) Successful in 26s
Frontend CI / Frontend (push) Successful in 2m47s
Backend CI / Backend (push) Failing after 10m1s
Desktop Client Build / Build Desktop Client (push) Successful in 23m3s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 29s
Desktop Client Build / Resolve Build Metadata (push) Successful in 26s
Frontend CI / Frontend (push) Successful in 2m47s
Backend CI / Backend (push) Failing after 10m1s
Desktop Client Build / Build Desktop Client (push) Successful in 23m3s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 29s
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import {
|
||||
ClockCircleOutlined,
|
||||
CopyOutlined,
|
||||
DeleteOutlined,
|
||||
DesktopOutlined,
|
||||
ExportOutlined,
|
||||
ReloadOutlined,
|
||||
@@ -193,6 +194,7 @@ const appliedTitle = ref('')
|
||||
const copiedErrorTaskId = ref<string | null>(null)
|
||||
const retryingTaskId = ref<string | null>(null)
|
||||
const cancelingTaskId = ref<string | null>(null)
|
||||
const deletingRecordId = ref<string | null>(null)
|
||||
const manualRefreshing = ref(false)
|
||||
|
||||
const recordsQuery = useQuery({
|
||||
@@ -370,6 +372,19 @@ async function cancelTask(record: PublishRecordItem): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteRecord(record: PublishRecordItem): Promise<void> {
|
||||
deletingRecordId.value = record.id
|
||||
try {
|
||||
await publishRecordsApi.remove(record.recordId)
|
||||
message.success('发文记录已删除')
|
||||
await recordsQuery.refetch()
|
||||
} catch (error) {
|
||||
message.error(formatError(error))
|
||||
} finally {
|
||||
deletingRecordId.value = null
|
||||
}
|
||||
}
|
||||
|
||||
async function copyErrorMessage(record: PublishRecordItem): Promise<void> {
|
||||
if (!record.errorMessage) {
|
||||
return
|
||||
@@ -622,6 +637,25 @@ async function copyErrorMessage(record: PublishRecordItem): Promise<void> {
|
||||
<ClockCircleOutlined />
|
||||
</span>
|
||||
</a-tooltip>
|
||||
<a-popconfirm
|
||||
title="确认删除这条发文记录?删除后后台和客户端发文管理都不再显示。"
|
||||
ok-text="删除"
|
||||
cancel-text="保留"
|
||||
placement="topRight"
|
||||
@confirm="deleteRecord(record)"
|
||||
>
|
||||
<a-tooltip title="删除发文记录" placement="top">
|
||||
<a-button
|
||||
type="text"
|
||||
class="publish-action-btn publish-action-btn--danger"
|
||||
:loading="deletingRecordId === record.id"
|
||||
:aria-label="`删除发文记录:${record.title}`"
|
||||
@click.stop
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user