Commit 2cb5537a by lijiabin

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

parent 861e50b6
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<el-button type="primary" link @click="jumpToEditPage({ type: item.type, id: item.id })" <el-button type="primary" link @click="jumpToEditPage({ type: item.type, id: item.id })"
>编辑</el-button >编辑</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> </div>
</div> </div>
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
import { getSelfPublishList, deleteArticle } from '@/api' import { getSelfPublishList, deleteArticle } from '@/api'
import { usePageSearch } from '@/hooks' import { usePageSearch } from '@/hooks'
import { import {
articleTypeListOptions,
articleTypeListOptionsForReal, articleTypeListOptionsForReal,
articleTypeListOptionsForNotReal, articleTypeListOptionsForNotReal,
} from '@/constants/options' } from '@/constants/options'
...@@ -132,14 +133,16 @@ onActivated(() => { ...@@ -132,14 +133,16 @@ onActivated(() => {
refresh() 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({ await confirm({
title: '提示', title: '删除确认',
message: '确定删除该吗?', message: `确定要删除${typeLabel}《${item.title}》吗?删除后将无法恢复。`,
confirmText: '确认删除',
type: 'danger', type: 'danger',
}) })
await deleteArticle(articleId) await deleteArticle(item.id)
refresh() refresh()
push.success('删除成功') 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