From 5af52b9d2622f4354f6462277e5733d40e30c38f Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Thu, 1 Feb 2024 13:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=89=B9=E9=87=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request2.js | 13 +++++++++++++ pages/inspect/job/inspectDetail.vue | 22 ++++++---------------- pages/inspect/job/inspectFullDetail.vue | 23 +++++++---------------- 3 files changed, 26 insertions(+), 32 deletions(-) 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({