From 8b2e658340401d57f59500ad8ab01b1886876e60 Mon Sep 17 00:00:00 2001 From: Lazy <2211717435@qq.com> Date: Mon, 8 Jan 2024 22:53:57 +0800 Subject: [PATCH] Fix: reset current page --- frontend/src/widgets/InstanceList.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/widgets/InstanceList.vue b/frontend/src/widgets/InstanceList.vue index b18a1695..dcac4b7b 100644 --- a/frontend/src/widgets/InstanceList.vue +++ b/frontend/src/widgets/InstanceList.vue @@ -74,9 +74,10 @@ const initNodes = async () => { } }; -const initInstancesData = async () => { +const initInstancesData = async (resetPage?: boolean) => { try { selectedInstance.value = []; + if (resetPage) operationForm.value.currentPage = 1; if (!currentRemoteNode.value) { await initNodes(); } @@ -112,7 +113,7 @@ const handleChangeNode = async (item: NodeStatus) => { try { currentRemoteNode.value = item; selectedInstance.value = []; - await initInstancesData(); + await initInstancesData(true); localStorage.setItem("pageSelectedRemote", JSON.stringify(item)); } catch (err: any) { console.error(err.message); @@ -262,7 +263,7 @@ const batchDeleteInstance = async (deleteFile: boolean) => { message: t("TXT_CODE_c3c06801"), description: t("TXT_CODE_50075e02") }); - await initInstancesData(); + await initInstancesData(true); } } catch (err: any) { console.error(err); @@ -406,7 +407,7 @@ onMounted(async () => { v-model:pageSize="operationForm.pageSize" :total="instances.maxPage * operationForm.pageSize" show-size-changer - @change="initInstancesData" + @change="initInstancesData()" />