fix: 解决网站排序错误的问题 (#5092)

Refs https://github.com/1Panel-dev/1Panel/issues/5021
pull/5096/head
zhengkunwang 6 months ago committed by GitHub
parent 4dc722b83c
commit 0a7144f625
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -54,7 +54,7 @@
<ComplexTable <ComplexTable
:pagination-config="paginationConfig" :pagination-config="paginationConfig"
:data="data" :data="data"
@sort-change="search" @sort-change="changeSort"
@search="search()" @search="search()"
:class="{ mask: nginxStatus != 'Running' }" :class="{ mask: nginxStatus != 'Running' }"
> >
@ -251,12 +251,22 @@ let req = reactive({
const mobile = computed(() => { const mobile = computed(() => {
return globalStore.isMobile(); return globalStore.isMobile();
}); });
const search = async (column?: any) => {
const changeSort = ({ prop, order }) => {
if (order) {
req.orderBy = prop == 'primaryDomain' ? 'primary_domain' : prop;
req.order = order;
} else {
req.orderBy = 'created_at';
req.order = 'null';
}
search();
};
const search = async () => {
req.page = paginationConfig.currentPage; req.page = paginationConfig.currentPage;
req.pageSize = paginationConfig.pageSize; req.pageSize = paginationConfig.pageSize;
req.orderBy = column?.order ? column.prop : 'created_at';
req.orderBy = req.orderBy === 'primaryDomain' ? 'primary_domain' : req.orderBy;
req.order = column?.order ? column.order : 'null';
loading.value = true; loading.value = true;
await SearchWebsites(req) await SearchWebsites(req)
.then((res) => { .then((res) => {

Loading…
Cancel
Save