mirror of https://github.com/1Panel-dev/1Panel
fix: 解决收藏夹和回收站切换每页数量不生效的问题 (#2797)
parent
dc420256e2
commit
6546c10fb8
|
@ -18,7 +18,7 @@ import (
|
|||
// @Router /files/favorite/search [post]
|
||||
func (b *BaseApi) SearchFavorite(c *gin.Context) {
|
||||
var req dto.PageInfo
|
||||
if err := helper.CheckBind(req, c); err != nil {
|
||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||
return
|
||||
}
|
||||
total, list, err := favoriteService.Page(req)
|
||||
|
|
|
@ -18,12 +18,12 @@ import { reactive, ref } from 'vue';
|
|||
const paginationConfig = reactive({
|
||||
cacheSizeKey: 'favorite-page-size',
|
||||
currentPage: 1,
|
||||
pageSize: 100,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
});
|
||||
const req = reactive({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
pageSize: 20,
|
||||
});
|
||||
const open = ref(false);
|
||||
const data = ref([]);
|
||||
|
@ -40,6 +40,8 @@ const acceptParams = () => {
|
|||
|
||||
const search = async () => {
|
||||
try {
|
||||
req.page = paginationConfig.currentPage;
|
||||
req.pageSize = paginationConfig.pageSize;
|
||||
const res = await SearchFavorite(req);
|
||||
data.value = res.data.items;
|
||||
paginationConfig.total = res.data.total;
|
||||
|
|
|
@ -55,7 +55,7 @@ import Delete from './delete/index.vue';
|
|||
const open = ref(false);
|
||||
const req = reactive({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
pageSize: 20,
|
||||
});
|
||||
const data = ref([]);
|
||||
const em = defineEmits(['close']);
|
||||
|
@ -66,7 +66,7 @@ const files = ref([]);
|
|||
const paginationConfig = reactive({
|
||||
cacheSizeKey: 'recycle-page-size',
|
||||
currentPage: 1,
|
||||
pageSize: 100,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
});
|
||||
|
||||
|
@ -87,6 +87,8 @@ const acceptParams = () => {
|
|||
|
||||
const search = async () => {
|
||||
try {
|
||||
req.page = paginationConfig.currentPage;
|
||||
req.pageSize = paginationConfig.pageSize;
|
||||
const res = await getRecycleList(req);
|
||||
data.value = res.data.items;
|
||||
paginationConfig.total = res.data.total;
|
||||
|
|
Loading…
Reference in New Issue