From 4a1304871852d9efef67e428a6dca97c3b4a8d72 Mon Sep 17 00:00:00 2001 From: 2256907009 <2256907009@qq.com> Date: Fri, 12 Dec 2025 16:02:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=88=86=E9=A1=B5=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/ProductList.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/product/ProductList.vue b/src/views/product/ProductList.vue index 41ee43e..f658d7d 100644 --- a/src/views/product/ProductList.vue +++ b/src/views/product/ProductList.vue @@ -406,9 +406,12 @@ const fetchProductList = async () => { try { const res = await getProductList(queryParams) if (res.data.code === 200) { - productList.value = res.data.data.data || [] - productList.value = productList.value.filter(item => item.delete == false) - total.value = res.data.data.all_count || 0 + const allData = res.data.data.data || [] + // 过滤掉已删除的数据 + productList.value = allData.filter(item => item.delete == false) + // 计算未删除数据的总数(API返回的all_count包含已删除的,需要减去已删除的数量) + const deletedCount = allData.filter(item => item.delete == true).length + total.value = (res.data.data.data.length || 0) - deletedCount productList.value = productList.value.map(item => { item.image = item.coverId ? getFileDetail({ file_id: item.coverId }).then(res => res.data.data.url) : '' return item