Preserve publish record history
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import {
|
||||
ClockCircleOutlined,
|
||||
CopyOutlined,
|
||||
DeleteOutlined,
|
||||
DesktopOutlined,
|
||||
ExportOutlined,
|
||||
ReloadOutlined,
|
||||
@@ -194,7 +193,6 @@ 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({
|
||||
@@ -372,22 +370,6 @@ 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('发布记录已删除')
|
||||
if (publishRecords.value.length === 1 && page.value > 1) {
|
||||
page.value -= 1
|
||||
}
|
||||
await recordsQuery.refetch()
|
||||
} catch (error) {
|
||||
message.error(formatError(error))
|
||||
} finally {
|
||||
deletingRecordId.value = null
|
||||
}
|
||||
}
|
||||
|
||||
async function copyErrorMessage(record: PublishRecordItem): Promise<void> {
|
||||
if (!record.errorMessage) {
|
||||
return
|
||||
@@ -640,25 +622,6 @@ 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