fix(历史记录): 展开历史记录面板时未自动加载数据

展开 showHistory 后没有触发 loadHistoryFragments/loadHistoryReports,
需要用户输入搜索或切换 tab 才能看到数据。增加 watch(showHistory) 在展开时
立即加载当前 tab 的分页数据。
This commit is contained in:
2026-07-05 11:55:08 +08:00
parent ea9b7ec569
commit c41aa09b4a
+8
View File
@@ -58,6 +58,14 @@ const reportsTotal = ref(0);
const reportsPage = ref(1); const reportsPage = ref(1);
const PAGE_SIZE = 10; const PAGE_SIZE = 10;
watch(showHistory, (val) => {
if (val) {
// 展开时立即加载当前 tab 的数据
if (historyTab.value === "fragments") loadHistoryFragments();
else loadHistoryReports();
}
});
const loadHistoryFragments = async () => { const loadHistoryFragments = async () => {
loadingHistory.value = true; loadingHistory.value = true;
try { try {