Commit a98fb04c authored by lijin's avatar lijin

增加软删除素材的接口

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