fix: reset firewall import dialogs on open (#13198)

This commit is contained in:
ssongliu
2026-07-03 16:51:08 +08:00
committed by GitHub
parent 74f221b895
commit 4a462aecc7
2 changed files with 27 additions and 6 deletions

View File

@@ -88,7 +88,7 @@ const displayData = ref<any>([]);
const currentRules = ref<Host.RuleInfo[]>([]);
const uploadRef = ref();
const uploaderFiles = ref();
const uploaderFiles = ref<UploadFiles>([]);
const pageData = ref([]);
const paginationConfig = reactive({
currentPage: 1,
@@ -97,12 +97,23 @@ const paginationConfig = reactive({
});
const acceptParams = async (): Promise<void> => {
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',

View File

@@ -90,7 +90,7 @@ const displayData = ref<any>([]);
const currentRules = ref<Host.RuleInfo[]>([]);
const uploadRef = ref();
const uploaderFiles = ref();
const uploaderFiles = ref<UploadFiles>([]);
const pageData = ref([]);
const paginationConfig = reactive({
currentPage: 1,
@@ -99,13 +99,23 @@ const paginationConfig = reactive({
});
const acceptParams = async (): Promise<void> => {
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',