fix: 分页排序样式调整 (#1821)

This commit is contained in:
ssongliu 2023-08-03 16:21:27 +08:00 committed by GitHub
parent a031d3ba41
commit b83147220a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 8 deletions

View File

@ -192,6 +192,8 @@ const paginationConfig = reactive({
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
orderBy: 'created_at',
order: 'null',
}); });
const searchName = ref(); const searchName = ref();
const dialogUpgradeRef = ref(); const dialogUpgradeRef = ref();
@ -246,13 +248,15 @@ const dialogReNameRef = ref();
const search = async (column?: any) => { const search = async (column?: any) => {
let filterItem = props.filters ? props.filters : ''; let filterItem = props.filters ? props.filters : '';
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
let params = { let params = {
name: searchName.value, name: searchName.value,
page: paginationConfig.currentPage, page: paginationConfig.currentPage,
pageSize: paginationConfig.pageSize, pageSize: paginationConfig.pageSize,
filters: filterItem, filters: filterItem,
orderBy: column?.order ? column.prop : 'created_at', orderBy: paginationConfig.orderBy,
order: column?.order ? column.order : 'null', order: paginationConfig.order,
}; };
loading.value = true; loading.value = true;
loadStats(); loadStats();

View File

@ -186,6 +186,8 @@ const paginationConfig = reactive({
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
orderBy: 'created_at',
order: 'null',
}); });
const searchName = ref(); const searchName = ref();
@ -205,12 +207,14 @@ const weekOptions = [
]; ];
const search = async (column?: any) => { const search = async (column?: any) => {
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
let params = { let params = {
info: searchName.value, info: searchName.value,
page: paginationConfig.currentPage, page: paginationConfig.currentPage,
pageSize: paginationConfig.pageSize, pageSize: paginationConfig.pageSize,
orderBy: column?.order ? column.prop : 'created_at', orderBy: paginationConfig.orderBy,
order: column?.order ? column.order : 'null', order: paginationConfig.order,
}; };
loading.value = true; loading.value = true;
await getCronjobPage(params) await getCronjobPage(params)

View File

@ -254,6 +254,8 @@ const paginationConfig = reactive({
pageSize: 10, pageSize: 10,
total: 0, total: 0,
from: 'local', from: 'local',
orderBy: 'created_at',
order: 'null',
}); });
const searchName = ref(); const searchName = ref();
@ -302,13 +304,15 @@ const onSetting = async () => {
}; };
const search = async (column?: any) => { const search = async (column?: any) => {
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
let params = { let params = {
page: paginationConfig.currentPage, page: paginationConfig.currentPage,
pageSize: paginationConfig.pageSize, pageSize: paginationConfig.pageSize,
info: searchName.value, info: searchName.value,
from: paginationConfig.from, from: paginationConfig.from,
orderBy: column?.order ? column.prop : 'created_at', orderBy: paginationConfig.orderBy,
order: column?.order ? column.order : 'null', order: paginationConfig.order,
}; };
const res = await searchMysqlDBs(params); const res = await searchMysqlDBs(params);
data.value = res.data.items || []; data.value = res.data.items || [];

View File

@ -109,17 +109,21 @@ const paginationConfig = reactive({
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
orderBy: 'created_at',
order: 'null',
}); });
const searchName = ref(); const searchName = ref();
const search = async (column?: any) => { const search = async (column?: any) => {
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
let params = { let params = {
page: paginationConfig.currentPage, page: paginationConfig.currentPage,
pageSize: paginationConfig.pageSize, pageSize: paginationConfig.pageSize,
info: searchName.value, info: searchName.value,
type: 'mysql', type: 'mysql',
orderBy: column?.order ? column.prop : 'created_at', orderBy: paginationConfig.orderBy,
order: column?.order ? column.order : 'null', order: paginationConfig.order,
}; };
const res = await searchRemoteDBs(params); const res = await searchRemoteDBs(params);
data.value = res.data.items || []; data.value = res.data.items || [];