Merge pull request #87 from tbphp/fix-keytable-page-load

fix: 修复状态变更时分页没有正确重置的问题
This commit is contained in:
tbphp
2025-08-01 09:31:17 +08:00
committed by GitHub

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,9 +127,12 @@ watch(
// 处理搜索输入的防抖 // 处理搜索输入的防抖
function handleSearchInput() { function handleSearchInput() {
currentPage.value = 1; // 搜索时重置到第一页 if (currentPage.value !== 1) {
currentPage.value = 1;
} else {
loadKeys(); loadKeys();
} }
}
// 处理更多操作菜单 // 处理更多操作菜单
function handleMoreAction(key: string) { function handleMoreAction(key: string) {