From db1cb9a6a19e6dac99878835cf7775a210d257db Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期一, 13 十月 2025 16:33:23 +0800
Subject: [PATCH] 更新 total

---
 components/mold.vue |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/components/mold.vue b/components/mold.vue
index 515dc3d..4bc7868 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -160,8 +160,13 @@
 						this.filteredTools = mapped;
 						this.toolList = mapped.slice();
 
-						// 鎬绘暟浼樺厛鍙栭《灞� totalCount锛屽啀鍙栧祵濂� total锛屽啀閫�鍥� payload 闀垮害
-						this.total = Number(res.totalCount ?? res.data?.total ?? res.data?.totalCount ?? res.total ?? mapped.length ?? 0) || 0;
+						// 澶勭悊 total锛氬綋鍚庣 totalCount 涓� 0 鏃讹紝鍥為��鍒板祵濂� total 鎴栨槧灏勬暟缁勯暱搴�
+						const totalFromRes = Number(res.totalCount);
+						if (Number.isFinite(totalFromRes) && totalFromRes > 0) {
+							this.total = totalFromRes;
+						} else {
+							this.total = Number(res.data?.total ?? res.data?.totalCount ?? res.total ?? mapped.length) || 0;
+						}
 					} else {
 						this.$showMessage(res.message || '鏌ヨ澶辫触');
 					}
@@ -331,7 +336,12 @@
 						}));
 
 						// 濡傛灉鍚庣杩斿洖浜� totalCount锛屽彲浠ユ洿鏂� total锛堢敤浜庡垎椤垫樉绀猴級
-						this.total = Number(res.totalCount ?? res.data?.total ?? res.data?.totalCount ?? this.toolRecords.length ?? 0) || 0;
+						const totalFromRes = Number(res.totalCount);
+						if (Number.isFinite(totalFromRes) && totalFromRes > 0) {
+							this.total = totalFromRes;
+						} else {
+							this.total = Number(res.data?.total ?? res.data?.totalCount ?? this.toolRecords.length) || 0;
+						}
 					} else {
 						this.$showMessage(res.message || '鑾峰彇琛ㄥ崟鏁版嵁澶辫触');
 					}

--
Gitblit v1.9.3