feat(mall): 商品 tab 计数跟随筛选条件

getTabsCount 传入 gridApi.formApi.getValues(),使 tab 数量与列表筛选口径一致;首页统计卡片仍用无参版(全局总数)。web-ele 与 web-antdv-next 同步。
This commit is contained in:
YunaiV
2026-06-22 09:20:52 -07:00
parent 23df7c7f30
commit 7ef40eeb2a
4 changed files with 8 additions and 8 deletions

View File

@@ -76,9 +76,9 @@ export function getSpuPage(params: PageParam) {
});
}
/** 获得商品 SPU 列表 tabsCount */
export function getTabsCount() {
return requestClient.get<Record<string, number>>('/product/spu/get-count');
/** 获得商品 SPU 列表 tabsCount(支持按 name/categoryId/createTime 筛选) */
export function getTabsCount(params?: Record<string, any>) {
return requestClient.get<Record<string, number>>('/product/spu/get-count', { params });
}
/** 创建商品 SPU */

View File

@@ -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]) {

View File

@@ -76,9 +76,9 @@ export function getSpuPage(params: PageParam) {
});
}
/** 获得商品 SPU 列表 tabsCount */
export function getTabsCount() {
return requestClient.get<Record<string, number>>('/product/spu/get-count');
/** 获得商品 SPU 列表 tabsCount(支持按 name/categoryId/createTime 筛选) */
export function getTabsCount(params?: Record<string, any>) {
return requestClient.get<Record<string, number>>('/product/spu/get-count', { params });
}
/** 创建商品 SPU */

View File

@@ -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]) {