Commit 2cb5537a by lijiabin

【需求 25171】fix: 个人中心删除提示补充类型和标题,说明无法恢复

parent 861e50b6
......@@ -60,7 +60,7 @@
<el-button type="primary" link @click="jumpToEditPage({ type: item.type, id: item.id })"
>编辑</el-button
>
<el-button type="danger" link @click="handleDelete(item.id)">删除</el-button>
<el-button type="danger" link @click="handleDelete(item)">删除</el-button>
</div>
</div>
</div>
......@@ -90,6 +90,7 @@
import { getSelfPublishList, deleteArticle } from '@/api'
import { usePageSearch } from '@/hooks'
import {
articleTypeListOptions,
articleTypeListOptionsForReal,
articleTypeListOptionsForNotReal,
} from '@/constants/options'
......@@ -132,14 +133,16 @@ onActivated(() => {
refresh()
})
const handleDelete = async (articleId: number) => {
const handleDelete = async (item: { id: number; type: ArticleTypeEnum; title: string }) => {
const typeLabel = articleTypeListOptions.find((option) => option.value === item.type)?.label
await confirm({
title: '提示',
message: '确定删除该吗?',
title: '删除确认',
message: `确定要删除${typeLabel}《${item.title}》吗?删除后将无法恢复。`,
confirmText: '确认删除',
type: 'danger',
})
await deleteArticle(articleId)
await deleteArticle(item.id)
refresh()
push.success('删除成功')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment