fix: 修复状态变更时分页没有正确重置的问题

This commit is contained in:
tbphp
2025-07-30 19:44:24 +08:00
parent 734938b787
commit cddd0e268d

View File

@@ -92,10 +92,18 @@ watch(
{ immediate: true } { immediate: true }
); );
watch([currentPage, pageSize, statusFilter], async () => { watch([currentPage, pageSize], async () => {
await loadKeys(); await loadKeys();
}); });
watch(statusFilter, async () => {
if (currentPage.value !== 1) {
currentPage.value = 1;
} else {
await loadKeys();
}
});
// 监听任务完成事件,自动刷新密钥列表 // 监听任务完成事件,自动刷新密钥列表
watch( watch(
() => appState.groupDataRefreshTrigger, () => appState.groupDataRefreshTrigger,
@@ -119,8 +127,11 @@ watch(
// 处理搜索输入的防抖 // 处理搜索输入的防抖
function handleSearchInput() { function handleSearchInput() {
currentPage.value = 1; // 搜索时重置到第一页 if (currentPage.value !== 1) {
loadKeys(); currentPage.value = 1;
} else {
loadKeys();
}
} }
// 处理更多操作菜单 // 处理更多操作菜单