From 7ef40eeb2a54f9a9e9d1e52e39c0245da0277786 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 22 Jun 2026 09:20:52 -0700 Subject: [PATCH] =?UTF-8?q?feat(mall):=20=E5=95=86=E5=93=81=20tab=20?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E8=B7=9F=E9=9A=8F=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getTabsCount 传入 gridApi.formApi.getValues(),使 tab 数量与列表筛选口径一致;首页统计卡片仍用无参版(全局总数)。web-ele 与 web-antdv-next 同步。 --- apps/web-antdv-next/src/api/mall/product/spu/index.ts | 6 +++--- apps/web-antdv-next/src/views/mall/product/spu/index.vue | 2 +- apps/web-ele/src/api/mall/product/spu/index.ts | 6 +++--- apps/web-ele/src/views/mall/product/spu/index.vue | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/web-antdv-next/src/api/mall/product/spu/index.ts b/apps/web-antdv-next/src/api/mall/product/spu/index.ts index 0c9f4ce94..d970f060b 100644 --- a/apps/web-antdv-next/src/api/mall/product/spu/index.ts +++ b/apps/web-antdv-next/src/api/mall/product/spu/index.ts @@ -76,9 +76,9 @@ export function getSpuPage(params: PageParam) { }); } -/** 获得商品 SPU 列表 tabsCount */ -export function getTabsCount() { - return requestClient.get>('/product/spu/get-count'); +/** 获得商品 SPU 列表 tabsCount(支持按 name/categoryId/createTime 筛选) */ +export function getTabsCount(params?: Record) { + return requestClient.get>('/product/spu/get-count', { params }); } /** 创建商品 SPU */ diff --git a/apps/web-antdv-next/src/views/mall/product/spu/index.vue b/apps/web-antdv-next/src/views/mall/product/spu/index.vue index 16137a7c8..90d808293 100644 --- a/apps/web-antdv-next/src/views/mall/product/spu/index.vue +++ b/apps/web-antdv-next/src/views/mall/product/spu/index.vue @@ -74,7 +74,7 @@ async function handleExport() { /** 获得每个 Tab 的数量 */ async function getTabCount() { - const res = await getTabsCount(); + const res = await getTabsCount(await gridApi.formApi.getValues()); for (const objName in res) { const index = Number(objName); if (tabsData.value[index]) { diff --git a/apps/web-ele/src/api/mall/product/spu/index.ts b/apps/web-ele/src/api/mall/product/spu/index.ts index 0c9f4ce94..d970f060b 100644 --- a/apps/web-ele/src/api/mall/product/spu/index.ts +++ b/apps/web-ele/src/api/mall/product/spu/index.ts @@ -76,9 +76,9 @@ export function getSpuPage(params: PageParam) { }); } -/** 获得商品 SPU 列表 tabsCount */ -export function getTabsCount() { - return requestClient.get>('/product/spu/get-count'); +/** 获得商品 SPU 列表 tabsCount(支持按 name/categoryId/createTime 筛选) */ +export function getTabsCount(params?: Record) { + return requestClient.get>('/product/spu/get-count', { params }); } /** 创建商品 SPU */ diff --git a/apps/web-ele/src/views/mall/product/spu/index.vue b/apps/web-ele/src/views/mall/product/spu/index.vue index d9fe81cbf..aa049581d 100644 --- a/apps/web-ele/src/views/mall/product/spu/index.vue +++ b/apps/web-ele/src/views/mall/product/spu/index.vue @@ -68,7 +68,7 @@ async function handleExport() { /** 获得每个 Tab 的数量 */ async function getTabCount() { - const res = await getTabsCount(); + const res = await getTabsCount(await gridApi.formApi.getValues()); for (const objName in res) { const index = Number(objName); if (tabsData.value[index]) {