Commit a4df63ff by lijiabin

【需求 25171】 feat: 新增后台案例库删除功能

parent f5a5dc76
......@@ -47,8 +47,6 @@
<el-icon><IEpDownload /></el-icon>下载导入模板</el-button
>
<ImportExcelBtn :api="importCaseExcel" @success="refresh" @error="handleError" />
<el-button type="primary" @click="handleBatchPublish"> 批量发布/隐藏 </el-button>
<el-button type="danger" @click="handleBatchDelete"> 批量删除 </el-button>
</div>
<!-- 表格区域 -->
......@@ -248,10 +246,10 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" width="100" fixed="right">
<el-table-column label="操作" width="130" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="handleEdit(row)">编辑</el-button>
<!-- <el-button type="danger" link @click="handleDelete(row)">删除</el-button> -->
<el-button type="danger" link @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -280,11 +278,10 @@
import { usePageSearch } from '@/hooks'
import {
getCaseList,
deleteColumn,
hideColumn,
changeUsageStatus,
auditCase,
importCaseExcel,
deleteCase,
} from '@/api/backend'
import type { BackendCaseListItemDto } from '@/api/backend'
import {
......@@ -332,22 +329,6 @@ const handleSelectionChange = (selection: BackendCaseListItemDto[]) => {
selectedRows.value = selection
}
// 批量发布/隐藏
const handleBatchPublish = async () => {
await hideColumn(selectedRows.value.map((item) => item.id))
refresh()
selectedRows.value = []
push.success('发布/隐藏成功')
}
// 批量删除
const handleBatchDelete = async () => {
await deleteColumn(selectedRows.value.map((item) => item.id))
refresh()
selectedRows.value = []
push.success('删除成功')
}
const handleContent = (row: BackendCaseListItemDto) => {
ElMessageBox.alert(row.content, '案例全部文本内容', {
confirmButtonText: '确定',
......@@ -383,6 +364,19 @@ const handleError = (list: BackendCaseListItemDto[]) => {
errorList.value = list
}
const handleDelete = async (row: BackendCaseListItemDto) => {
await confirm({
title: '提示',
message: '确定要删除该案例吗?',
confirmText: '确定',
cancelText: '取消',
type: 'danger',
})
await deleteCase(row.id)
push.success('删除案例库成功')
refresh()
}
const downloadImportTemplate = () => {
window.open(
'https://soundasia.oss-cn-shenzhen.aliyuncs.com/OA/readName/xlsx/2026/03/11/Common/1773219970707.xlsx',
......
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