Commit a98fb04c authored by lijin's avatar lijin

增加软删除素材的接口

parent 318d8afd
......@@ -604,6 +604,13 @@ export function getYoutubeUploadDetaillist() {
})
}
export function deleteMaterialById(params) {
return request({
// url: 'http://localhost:8567/material/getYoutubeUploadDetaillist',
url: process.env.PUTIN_API + '/material/business/deleteMaterialById',
method: 'post',
params
})
}
// ----------------------------------------
......@@ -256,7 +256,8 @@ import {
uploadMaterial,
getMaterialDesigners,
getAllTags,
getMaterialsByTag
getMaterialsByTag,
deleteMaterialById
} from '@/api/report';
export default {
......@@ -620,27 +621,21 @@ export default {
},
// 删除文件
handleDelete(file) {
handleDelete(row) {
this.$confirm('确认删除该文件吗?', '提示', {
type: 'warning'
})
.then(async () => {
try {
const response = await this.request({
url: '/api/materials/delete',
method: 'post',
params: { fileId: file.id }
});
if (response.code === 0) {
this.$message.success('删除成功');
await this.fetchMaterials(this.currentDirectory); // 重新获取文件列表
.then(()=>{
this.loading = true
deleteMaterialById({id: row.id}).then((res) => {
if (res.status == 200) {
this.$message.success("删除成功!")
this.fetchMaterialsByDirectoryId(this.currentDirectory)
} else {
this.$message.error(response.message || '删除失败');
this.$message.error("保存失败!")
this.loading = false
}
} catch (error) {
this.$message.error('删除失败');
console.error('删除文件失败:', error);
}
})
})
.catch(() => {});
},
......
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