From 4a462aecc732699dea4859e744cf6d02e030a7b2 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Fri, 3 Jul 2026 16:51:08 +0800 Subject: [PATCH] fix: reset firewall import dialogs on open (#13198) --- .../src/views/host/firewall/ip/import/index.vue | 17 ++++++++++++++--- .../views/host/firewall/port/import/index.vue | 16 +++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/host/firewall/ip/import/index.vue b/frontend/src/views/host/firewall/ip/import/index.vue index ccaf5021b..9817738e6 100644 --- a/frontend/src/views/host/firewall/ip/import/index.vue +++ b/frontend/src/views/host/firewall/ip/import/index.vue @@ -88,7 +88,7 @@ const displayData = ref([]); const currentRules = ref([]); const uploadRef = ref(); -const uploaderFiles = ref(); +const uploaderFiles = ref([]); const pageData = ref([]); const paginationConfig = reactive({ currentPage: 1, @@ -97,12 +97,23 @@ const paginationConfig = reactive({ }); const acceptParams = async (): Promise => { + resetImportData(); visible.value = true; - displayData.value = []; - selects.value = []; + loadCurrentData(); }; +const resetImportData = () => { + loading.value = false; + displayData.value = []; + pageData.value = []; + selects.value = []; + uploaderFiles.value = []; + paginationConfig.currentPage = 1; + paginationConfig.total = 0; + uploadRef.value?.clearFiles(); +}; + const loadCurrentData = async () => { const res = await searchFireRule({ type: 'address', diff --git a/frontend/src/views/host/firewall/port/import/index.vue b/frontend/src/views/host/firewall/port/import/index.vue index a020c3d20..11fd5a251 100644 --- a/frontend/src/views/host/firewall/port/import/index.vue +++ b/frontend/src/views/host/firewall/port/import/index.vue @@ -90,7 +90,7 @@ const displayData = ref([]); const currentRules = ref([]); const uploadRef = ref(); -const uploaderFiles = ref(); +const uploaderFiles = ref([]); const pageData = ref([]); const paginationConfig = reactive({ currentPage: 1, @@ -99,13 +99,23 @@ const paginationConfig = reactive({ }); const acceptParams = async (): Promise => { + resetImportData(); visible.value = true; - displayData.value = []; - selects.value = []; loadCurrentData(); }; +const resetImportData = () => { + loading.value = false; + displayData.value = []; + pageData.value = []; + selects.value = []; + uploaderFiles.value = []; + paginationConfig.currentPage = 1; + paginationConfig.total = 0; + uploadRef.value?.clearFiles(); +}; + const loadCurrentData = async () => { const res = await searchFireRule({ type: 'port',