diff --git a/backend/utils/files/fileinfo.go b/backend/utils/files/fileinfo.go index 03d72573b..05f4e079f 100644 --- a/backend/utils/files/fileinfo.go +++ b/backend/utils/files/fileinfo.go @@ -149,10 +149,14 @@ func (f *FileInfo) listChildren(dir, showHidden bool, page, pageSize int) error start := (page - 1) * pageSize end := pageSize + start var result []*FileInfo - if start < 0 || start > f.ItemTotal || end < 0 || start > end || end > f.ItemTotal { + if start < 0 || start > f.ItemTotal || end < 0 || start > end { result = items } else { - result = items[start:end] + if end > f.ItemTotal { + result = items[start:] + } else { + result = items[start:end] + } } f.Items = result diff --git a/frontend/src/components/complex-table/index.vue b/frontend/src/components/complex-table/index.vue index 902ad1258..76e0db45a 100644 --- a/frontend/src/components/complex-table/index.vue +++ b/frontend/src/components/complex-table/index.vue @@ -53,6 +53,7 @@ defineProps({ const emit = defineEmits(['search', 'update:selects']); const condition = ref({}); function search(conditions: any, e: any) { + console.log(conditions); if (conditions) { condition.value = conditions; } diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue index a1f061e9f..0ca6a9e50 100644 --- a/frontend/src/views/host/file-management/index.vue +++ b/frontend/src/views/host/file-management/index.vue @@ -43,45 +43,41 @@ v-model:selects="selects" :data="data" v-loading="loading" - @search="search(req)" + @search="search" >