Skip to content

Commit 1c627ba

Browse files
authored
Merge pull request #87 from tbphp/fix-keytable-page-load
fix: 修复状态变更时分页没有正确重置的问题
2 parents b9620ad + cddd0e2 commit 1c627ba

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

web/src/components/keys/KeyTable.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,18 @@ watch(
9292
{ immediate: true }
9393
);
9494
95-
watch([currentPage, pageSize, statusFilter], async () => {
95+
watch([currentPage, pageSize], async () => {
9696
await loadKeys();
9797
});
9898
99+
watch(statusFilter, async () => {
100+
if (currentPage.value !== 1) {
101+
currentPage.value = 1;
102+
} else {
103+
await loadKeys();
104+
}
105+
});
106+
99107
// 监听任务完成事件,自动刷新密钥列表
100108
watch(
101109
() => appState.groupDataRefreshTrigger,
@@ -119,8 +127,11 @@ watch(
119127
120128
// 处理搜索输入的防抖
121129
function handleSearchInput() {
122-
currentPage.value = 1; // 搜索时重置到第一页
123-
loadKeys();
130+
if (currentPage.value !== 1) {
131+
currentPage.value = 1;
132+
} else {
133+
loadKeys();
134+
}
124135
}
125136
126137
// 处理更多操作菜单

0 commit comments

Comments
 (0)