From 296ba6a9662fc7e1424262bbcddf1360996928f3 Mon Sep 17 00:00:00 2001 From: Sisyphus Date: Tue, 7 Jul 2026 17:18:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(F006-W17.3.10):=20UserListView=20"=E5=85=A8?= =?UTF-8?q?=E9=83=A8"=20count=20=3D=20=E6=AD=A3=E5=B8=B8+=E7=A6=81?= =?UTF-8?q?=E7=94=A8=20(=E8=B7=A8=20tab=20=E4=B8=80=E8=87=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户反馈: 切已禁用 tab 后, 顶部全部数字变成 1 (跟当前 tab 过滤后的 total 走) 期望: 全部 = 正常 + 禁用, 三个 tab 看到的数字一致 根因: tabItems 的 all 用 total.value, 而 total 是当前 tab 后端返的分页总数 (已禁用 tab 下, total=1 因为只有 1 条禁用用户) 修法: - tabItems.all count = enabledStats.normal + enabledStats.disabled (跨 tab 一致) - PageHeader sub 也改成 enabledStats.normal + enabledStats.disabled (跟搜索条件关联) - 三个 tab 看到的数字自然一致: 2284 = 2283 + 1 --- src/modules/user/UserListView.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/user/UserListView.vue b/src/modules/user/UserListView.vue index 532741b..3c5128c 100644 --- a/src/modules/user/UserListView.vue +++ b/src/modules/user/UserListView.vue @@ -165,7 +165,8 @@ async function load() { } const tabItems = computed(() => [ - { key: 'all', label: '全部', count: total.value }, + // 全部 = 正常 + 已禁用 (跨 tab 一致, 与搜索条件关联) + { key: 'all', label: '全部', count: enabledStats.normal + enabledStats.disabled }, { key: 'normal', label: '正常', count: enabledStats.normal }, { key: 'disabled', label: '已禁用', count: enabledStats.disabled } ]) @@ -228,7 +229,7 @@ onMounted(load)