diff --git a/api/request2.js b/api/request2.js index 3ca2ba5d..4bdd9c61 100644 --- a/api/request2.js +++ b/api/request2.js @@ -3550,6 +3550,19 @@ export function deleteFileById(id) { }); } +/** + * 删除文件(多个文件) + * @param {*} + * + */ +export function deleteFileByTable(tableName, tableId) { + return request({ + url: baseApi + "/infra/file/deleteByTable?tableName=" + tableName + "&tableId=" + tableId, + method: "delete", + data: {}, + }); +} + /** * 获取文件列表 diff --git a/pages/inspect/job/inspectDetail.vue b/pages/inspect/job/inspectDetail.vue index 6e6c8033..7716cc99 100644 --- a/pages/inspect/job/inspectDetail.vue +++ b/pages/inspect/job/inspectDetail.vue @@ -40,8 +40,8 @@ cancleTakeInspectJob, getInspectJobDetail, inspectJobSubmit, - deleteFileById, - getFileList + getFileList, + deleteFileByTable } from '@/api/request2.js'; import { goHome, @@ -147,25 +147,15 @@ }, methods: { - deleteFileById(id) { - deleteFileById(id).then(res => { - - }) - - }, - getFileList(id) { - getFileList("jobInspectDetail", id).then(res => { - if (res.data) { - res.data.forEach(res => { - this.deleteFileById(res.id) - }) - } + deleteFileByTable(id) { + debugger + deleteFileByTable("jobInspectDetail", id).then(res=>{ }) }, clearPicList(subList) { subList.forEach(item => { - this.getFileList(item.id) + this.deleteFileByTable(item.id) }) }, diff --git a/pages/inspect/job/inspectFullDetail.vue b/pages/inspect/job/inspectFullDetail.vue index 896e6b7c..ae599b6a 100644 --- a/pages/inspect/job/inspectFullDetail.vue +++ b/pages/inspect/job/inspectFullDetail.vue @@ -41,7 +41,8 @@ getInspectJobDetail, inspectJobSubmit, deleteFileById, - getFileList + getFileList, + deleteFileByTable } from '@/api/request2.js'; import { goHome, @@ -151,27 +152,17 @@ }, methods: { - deleteFileById(id) { - deleteFileById(id).then(res => { - + deleteFileByTable(id) { + deleteFileByTable("jobInspectDetail", id).then(res=>{ }) - }, - getFileList(id) { - getFileList("jobInspectDetail", id).then(res => { - if (res.data) { - res.data.forEach(res => { - this.deleteFileById(res.id) - }) - } - }) - }, - + clearPicList(subList) { subList.forEach(item => { - this.getFileList(item.id) + this.deleteFileByTable(item.id) }) }, + //接收 receive(callback) { uni.showLoading({